### Future Schedules API - Example Response Source: https://github.com/aviationedgeapi/future-schedules-api/blob/main/README.md This snippet demonstrates a typical successful response from the Future Schedules API, detailing a single flight's schedule information. ```APIDOC ## GET /aviationedgeapi/future-schedules-api ### Description Retrieves a list of future flight schedules. This endpoint provides detailed information about upcoming flights, including departure and arrival times, airport codes, aircraft details, and airline information. ### Method GET ### Endpoint /aviationedgeapi/future-schedules-api ### Parameters #### Query Parameters - **departureIata** (string) - Optional - Filter flights by departure airport IATA code. - **arrivalIata** (string) - Optional - Filter flights by arrival airport IATA code. - **flightnumber** (string) - Optional - Filter flights by flight number. - **from_date** (string) - Optional - Filter flights from a specific date (YYYY-MM-DD). - **to_date** (string) - Optional - Filter flights up to a specific date (YYYY-MM-DD). - **airlinecode** (string) - Optional - Filter flights by airline IATA code. - **limit** (integer) - Optional - Limit the number of results. - **page** (integer) - Optional - Specify the page number for pagination. ### Request Example ```json { "example": "Request details for a specific flight schedule" } ``` ### Response #### Success Response (200) - **weekday** (string) - The day of the week for the schedule (e.g., "1" for Monday). - **departure** (object) - Details about the departure, including airport codes, terminal, gate, and scheduled time. - **iataCode** (string) - IATA code of the departure airport. - **icaoCode** (string) - ICAO code of the departure airport. - **terminal** (string) - Departure terminal. - **gate** (string) - Departure gate. - **scheduledTime** (string) - Scheduled departure time (HH:MM). - **arrival** (object) - Details about the arrival, including airport codes, terminal, gate, and scheduled time. - **iataCode** (string) - IATA code of the arrival airport. - **icaoCode** (string) - ICAO code of the arrival airport. - **terminal** (string) - Arrival terminal. - **gate** (string) - Arrival gate. - **scheduledTime** (string) - Scheduled arrival time (HH:MM). - **aircraft** (object) - Details about the aircraft. - **modelCode** (string) - Aircraft model code. - **modelText** (string) - Aircraft model description. - **airline** (object) - Details about the airline. - **name** (string) - Airline name. - **iataCode** (string) - Airline IATA code. - **icaoCode** (string) - Airline ICAO code. - **flight** (object) - Details about the flight number. - **number** (string) - Flight number. - **iataNumber** (string) - Flight IATA number. - **icaoNumber** (string) - Flight ICAO number. #### Response Example ```json [ { "weekday": "1", "departure": { "iataCode": "mty", "icaoCode": "mmmy", "terminal": "c", "gate": "f2", "scheduledTime": "20:35" }, "arrival": { "iataCode": "iah", "icaoCode": "kiah", "terminal": "d", "gate": "d12", "scheduledTime": "22:00" }, "aircraft": { "modelCode": "a320", "modelText": "airbus a320-232" }, "airline": { "name": "vivaaerobus", "iataCode": "vb", "icaoCode": "viv" }, "flight": { "number": "616", "iataNumber": "vb616", "icaoNumber": "viv616" } } ] ``` ``` -------------------------------- ### GET /v2/public/flightsFuture Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Fetches future flight schedules for a given airport, supporting both departures and arrivals, with optional filtering capabilities. ```APIDOC ## GET /v2/public/flightsFuture ### Description Retrieves scheduled flights (departures or arrivals) for a specified airport on a given date. Supports filtering by various criteria. ### Method GET ### Endpoint https://aviation-edge.com/v2/public/flightsFuture ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **type** (string) - Required - Type of schedule, either 'departure' or 'arrival'. - **iataCode** (string) - Required - The IATA code of the airport. - **date** (string) - Required - The date for the schedule in 'YYYY-MM-DD' format. - **arr_iataCode** (string) - Optional - Filter by arrival airport IATA code. - **dep_iataCode** (string) - Optional - Filter by departure airport IATA code. ### Request Example ```json { "example": "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=departure&iataCode=BER&date=2024-12-25&arr_iataCode=JFK" } ``` ### Response #### Success Response (200) - **flights** (array) - An array of flight objects, each containing detailed information about the scheduled flight. #### Response Example ```json { "example": [ { "flight": { "number": "BA284", "iataNumber": "BA284", "icaoNumber": "BAW284", "codeshared": null }, "departure": { "airport": { "name": "Berlin Brandenburg Willy Brandt Airport", "iata": "BER", "icao": "EDDB", "timezone": "Europe/Berlin", "gmt": "+01:00", "elevation": 488 }, "estimatedRunway": null, "actualRunway": null, "scheduled": "2024-12-25T08:00:00Z", "estimated": "2024-12-25T08:05:00Z", "actual": null, "estimatedRunwayProgram": null, "actualRunwayProgram": null, "scheduledTime": "2024-12-25T08:00:00", "estimatedTime": "2024-12-25T08:05:00", "actualTime": null }, "arrival": { "airport": { "name": "John F. Kennedy International Airport", "iata": "JFK", "icao": "KJFK", "timezone": "America/New_York", "gmt": "-05:00", "elevation": 13 }, "estimatedRunway": null, "actualRunway": null, "scheduled": "2024-12-25T11:00:00Z", "estimated": "2024-12-25T11:10:00Z", "actual": null, "estimatedRunwayProgram": null, "actualRunwayProgram": null, "scheduledTime": "2024-12-25T11:00:00", "estimatedTime": "2024-12-25T11:10:00", "actualTime": null }, "airline": { "name": "Lufthansa", "iata": "LH", "icao": "DLH" }, "flightAttributes": { "codeshared": null, "isCargo": false, "isCharter": false, "isScheduled": true } } ] } ``` ``` -------------------------------- ### Get Arrival Schedule for Airport (Bash) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Retrieves all scheduled arrivals to a specific airport on a given future date. This function requires an API key, airport IATA code, and the target date. The response includes comprehensive flight details for inbound traffic. ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=arrival&iataCode=BER&date=2024-12-25" \ -H "Accept: application/json" ``` -------------------------------- ### Get Arrival Schedule for Airport on Future Date Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Retrieves all scheduled arrivals to a specific airport on a given future date, providing comprehensive flight details for inbound traffic. ```APIDOC ## GET /v2/public/flightsFuture ### Description Retrieves scheduled arrivals to a specific airport on a given future date. ### Method GET ### Endpoint /v2/public/flightsFuture ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **type** (string) - Required - Specifies the schedule type, 'arrival'. - **iataCode** (string) - Required - The IATA code of the airport to get arrivals for. - **date** (string) - Required - The future date in 'YYYY-MM-DD' format. ### Request Example ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=arrival&iataCode=BER&date=2024-12-25" -H "Accept: application/json" ``` ### Response #### Success Response (200) *Response format identical to departure schedule but filtered for arrivals.* - **weekday** (string) - The day of the week for the flight. - **departure** (object) - Details about the departure. - **iataCode** (string) - Departure airport IATA code. - **scheduledTime** (string) - Scheduled departure time (HH:MM). - **arrival** (object) - Details about the arrival. - **iataCode** (string) - Arrival airport IATA code. - **icaoCode** (string) - Arrival airport ICAO code. - **terminal** (string) - Arrival terminal. - **gate** (string) - Arrival gate. - **scheduledTime** (string) - Scheduled arrival time (HH:MM). - **aircraft** (object) - Details about the aircraft. - **airline** (object) - Details about the airline. - **flight** (object) - Details about the flight. #### Response Example ```json [ { "weekday": "3", "departure": { "iataCode": "jfk", "scheduledTime": "09:00" }, "arrival": { "iataCode": "ber", "icaoCode": "eddb", "terminal": "1", "gate": "a12", "scheduledTime": "11:45" }, "aircraft": { "modelCode": "b789", "modelText": "boeing 787-9 dreamliner" }, "airline": { "name": "lufthansa", "iataCode": "lh" }, "flight": { "number": "401", "iataNumber": "lh401" } } ] ``` ``` -------------------------------- ### Future Schedules API Response Example (JSON) Source: https://github.com/aviationedgeapi/future-schedules-api/blob/main/README.md This snippet demonstrates the structure of a successful response from the Future Schedules API. It includes details about flight departure and arrival times, IATA/ICAO codes, terminal and gate information, aircraft model, and airline details. The response is an array of flight objects. ```json [ { "weekday": "1", "departure": { "iataCode": "mty", "icaoCode": "mmmy", "terminal": "c", "gate": "f2", "scheduledTime": "20:35" }, "arrival": { "iataCode": "iah", "icaoCode": "kiah", "terminal": "d", "gate": "d12", "scheduledTime": "22:00" }, "aircraft": { "modelCode": "a320", "modelText": "airbus a320-232" }, "airline": { "name": "vivaaerobus", "iataCode": "vb", "icaoCode": "viv" }, "flight": { "number": "616", "iataNumber": "vb616", "icaoNumber": "viv616" } } ] ``` -------------------------------- ### Get Departure Schedule for Airport (Bash) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Retrieves all scheduled departures from a specific airport on a given future date. Requires an API key, airport IATA code, and the target date. Outputs detailed flight information including departure and arrival details, aircraft, airline, and flight numbers. ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=departure&iataCode=BER&date=2024-12-25" \ -H "Accept: application/json" ``` -------------------------------- ### Get Departure Schedule for Airport on Future Date Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Retrieves all scheduled departures from a specific airport on a given future date. Includes flight details, aircraft information, and terminal/gate assignments. ```APIDOC ## GET /v2/public/flightsFuture ### Description Retrieves scheduled departures from a specific airport on a given future date. ### Method GET ### Endpoint /v2/public/flightsFuture ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **type** (string) - Required - Specifies the schedule type, 'departure'. - **iataCode** (string) - Required - The IATA code of the airport to get departures from. - **date** (string) - Required - The future date in 'YYYY-MM-DD' format. ### Request Example ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=departure&iataCode=BER&date=2024-12-25" -H "Accept: application/json" ``` ### Response #### Success Response (200) - **weekday** (string) - The day of the week for the flight. - **departure** (object) - Details about the departure. - **iataCode** (string) - Departure airport IATA code. - **icaoCode** (string) - Departure airport ICAO code. - **terminal** (string) - Departure terminal. - **gate** (string) - Departure gate. - **scheduledTime** (string) - Scheduled departure time (HH:MM). - **arrival** (object) - Details about the arrival. - **iataCode** (string) - Arrival airport IATA code. - **icaoCode** (string) - Arrival airport ICAO code. - **terminal** (string) - Arrival terminal. - **gate** (string) - Arrival gate. - **scheduledTime** (string) - Scheduled arrival time (HH:MM). - **aircraft** (object) - Details about the aircraft. - **modelCode** (string) - Aircraft model code. - **modelText** (string) - Aircraft model description. - **airline** (object) - Details about the airline. - **name** (string) - Airline name. - **iataCode** (string) - Airline IATA code. - **icaoCode** (string) - Airline ICAO code. - **flight** (object) - Details about the flight. - **number** (string) - Flight number. - **iataNumber** (string) - Flight IATA number. - **icaoNumber** (string) - Flight ICAO number. #### Response Example ```json [ { "weekday": "3", "departure": { "iataCode": "ber", "icaoCode": "eddb", "terminal": "1", "gate": "a12", "scheduledTime": "08:15" }, "arrival": { "iataCode": "jfk", "icaoCode": "kjfk", "terminal": "4", "gate": "b21", "scheduledTime": "11:45" }, "aircraft": { "modelCode": "b789", "modelText": "boeing 787-9 dreamliner" }, "airline": { "name": "lufthansa", "iataCode": "lh", "icaoCode": "dlh" }, "flight": { "number": "400", "iataNumber": "lh400", "icaoNumber": "dlh400" } } ] ``` ``` -------------------------------- ### Build Flight Timetable Display (JavaScript) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Constructs a formatted flight timetable from an array of flight data. It sorts flights by departure time and can format the output as a console table. Optional parameters can control the display format. Requires flight data as input. ```javascript function buildFlightTimetable(flights, options = {}) { const sortedFlights = flights.sort((a, b) => a.departure.scheduledTime.localeCompare(b.departure.scheduledTime) ); const timetable = sortedFlights.map(flight => ({ time: flight.departure.scheduledTime, flight: flight.flight.iataNumber, airline: flight.airline.name, destination: flight.arrival.iataCode.toUpperCase(), aircraft: flight.aircraft.modelCode.toUpperCase(), terminal: flight.departure.terminal || '-', gate: flight.departure.gate || '-', status: 'Scheduled' })); if (options.format === 'table') { console.log('TIME | FLIGHT | AIRLINE | DEST | AIRCRAFT | TERM | GATE'); console.log('------|--------|---------------|------|----------|------|------'); timetable.forEach(row => { console.log( `${row.time} | ${row.flight.padEnd(6)} | ${row.airline.padEnd(13)} | ${row.destination} | ${row.aircraft.padEnd(8)} | ${row.terminal.padEnd(4)} | ${row.gate}` ); }); } return timetable; } // Example: Create departure board for airport fetchAirportSchedule('LAX', 'departure', '2024-12-25') .then(result => { if (result.success) { const timetable = buildFlightTimetable(result.data, { format: 'table' }); console.log(`\nTotal flights: ${timetable.length}`); } }); ``` -------------------------------- ### Filter Arrival Schedule by Departure Airport (Bash) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Queries arrival schedules to a destination airport filtered by a specific origin airport. This enables reverse route queries. Requires API key, destination IATA code, origin IATA code, and the target date. ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=arrival&iataCode=BER&dep_iataCode=ORY&date=2024-12-25" \ -H "Accept: application/json" ``` -------------------------------- ### Fetch Airport Schedule Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt This endpoint allows you to fetch future flight schedules for a given airport. You can specify whether to retrieve departures or arrivals, the date, and apply various filters. ```APIDOC ## GET /v2/public/flightsFuture ### Description Fetches future flight schedules for a specified airport (departures or arrivals). ### Method GET ### Endpoint `/v2/public/flightsFuture` ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **type** (string) - Required - Type of schedule, either 'departure' or 'arrival'. - **iataCode** (string) - Required - The IATA code of the airport. - **date** (string) - Required - The date for which to fetch schedules (YYYY-MM-DD). - **dep_iataCode** (string) - Optional - Filter by departure IATA code. - **arr_iataCode** (string) - Optional - Filter by arrival IATA code. - **airline_iata** (string) - Optional - Filter by airline IATA code. - **flight_iata** (string) - Optional - Filter by flight IATA number. ### Request Example ```json { "example": "GET https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=departure&iataCode=BER&date=2024-12-25&dep_iataCode=ORY&airline_iata=AF" } ``` ### Response #### Success Response (200) - **data** (array) - An array of flight objects. - **flight_date** (string) - The date of the flight. - **departure** (object) - Departure details. - **airport** (string) - Departure airport name. - **iataCode** (string) - Departure airport IATA code. - **icaoCode** (string) - Departure airport ICAO code. - **terminal** (string) - Departure terminal. - **gate** (string) - Departure gate. - **delay** (integer) - Departure delay in minutes. - **scheduledTime** (string) - Scheduled departure time. - **estimatedTime** (string) - Estimated departure time. - **actualTime** (string) - Actual departure time. - **arrival** (object) - Arrival details. - **airport** (string) - Arrival airport name. - **iataCode** (string) - Arrival airport IATA code. - **icaoCode** (string) - Arrival airport ICAO code. - **terminal** (string) - Arrival terminal. - **gate** (string) - Arrival gate. - **delay** (integer) - Arrival delay in minutes. - **scheduledTime** (string) - Scheduled arrival time. - **estimatedTime** (string) - Estimated arrival time. - **actualTime** (string) - Actual arrival time. - **airline** (object) - Airline details. - **name** (string) - Airline name. - **iataCode** (string) - Airline IATA code. - **icaoCode** (string) - Airline ICAO code. - **flight** (object) - Flight details. - **number** (string) - Flight number. - **iataNumber** (string) - Flight IATA number. - **icaoNumber** (string) - Flight ICAO number. - **aircraft** (object) - Aircraft details. - **model** (string) - Aircraft model. - **registration** (string) - Aircraft registration. - **Icao24bit** (string) - Aircraft 24-bit ICAO address. - **codeshared** (object) - Codeshare flight details (if applicable). - **airline** (object) - Codeshare airline details. - **flight** (object) - Codeshare flight details. - **live** (object) - Live flight status (if available). - **isLive** (boolean) - Indicates if the flight is currently live. - **speed** (integer) - Current speed. - **altitude** (integer) - Current altitude. - **direction** (integer) - Current direction. - **latitude** (number) - Current latitude. - **longitude** (number) - Current longitude. - **updated** (string) - Timestamp of the last update. #### Response Example ```json { "example": [ { "flight_date": "2024-12-25", "departure": { "airport": "Berlin Brandenburg Airport", "iataCode": "BER", "icaoCode": "EDDB", "terminal": "1", "gate": "A12", "delay": 0, "scheduledTime": "2024-12-25T10:30:00Z", "estimatedTime": "2024-12-25T10:30:00Z", "actualTime": null }, "arrival": { "airport": "Paris-Charles de Gaulle Airport", "iataCode": "CDG", "icaoCode": "LFPG", "terminal": "2E", "gate": "F40", "delay": 15, "scheduledTime": "2024-12-25T12:15:00Z", "estimatedTime": "2024-12-25T12:30:00Z", "actualTime": null }, "airline": { "name": "Air France", "iataCode": "AF", "icaoCode": "AFR" }, "flight": { "number": "AF1234", "iataNumber": "AF1234", "icaoNumber": "AFR1234" }, "aircraft": { "model": "Airbus A320", "registration": "F-ABCDE", "Icao24bit": "a1b2c3d" }, "codeshared": null, "live": null } ] } ``` ### Error Handling - **400 Bad Request**: Invalid parameters provided. - **401 Unauthorized**: Invalid API key. - **404 Not Found**: No flights found for the given criteria. - **500 Internal Server Error**: Server error. ``` -------------------------------- ### Fetch Airport Schedule Data with Python Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Fetches future flight schedule data for a given airport and date. It supports filtering by departure or arrival and handles potential request errors gracefully. Dependencies include the 'requests' library. Input parameters are airport IATA code, schedule type, date, and optional filters. Output is a dictionary indicating success status, data, or an error message. ```python import requests from datetime import datetime from typing import Dict, List, Optional class AirportScheduleAPI: BASE_URL = "https://aviation-edge.com/v2/public/flightsFuture" def __init__(self, api_key: str): self.api_key = api_key self.session = requests.Session() def get_schedule(self, iata_code: str, schedule_type: str, date: str, filters: Optional[Dict] = None) -> Dict: """ Fetch airport schedule with comprehensive error handling. Args: iata_code: Airport IATA code (e.g., 'BER') schedule_type: Either 'departure' or 'arrival' date: Date in YYYY-MM-DD format filters: Optional dict with filter parameters Returns: Dict with 'success', 'data', and optional 'error' keys """ params = { 'key': self.api_key, 'type': schedule_type, 'iataCode': iata_code, 'date': date } if filters: params.update(filters) try: response = self.session.get(self.BASE_URL, params=params, timeout=30) response.raise_for_status() data = response.json() return { 'success': True, 'data': data, 'count': len(data) if isinstance(data, list) else 0 } except requests.exceptions.RequestException as e: return { 'success': False, 'data': None, 'error': str(e) } def filter_by_route(self, origin: str, destination: str, date: str) -> Dict: """Get all flights between two airports.""" result = self.get_schedule( iata_code=origin, schedule_type='departure', date=date, filters={'arr_iataCode': destination} ) return result # Example usage api = AirportScheduleAPI(api_key='YOUR_API_KEY') # Get departures from Berlin result = api.get_schedule('BER', 'departure', '2024-12-25') if result['success']: for flight in result['data'][:5]: print(f"{flight['flight']['iataNumber']}: " f"{flight['departure']['iataCode'].upper()} -> " f"{flight['arrival']['iataCode'].upper()} " f"at {flight['departure']['scheduledTime']}") # Get flights on specific route route_flights = api.filter_by_route('BER', 'JFK', '2024-12-25') if route_flights['success']: print(f"Found {route_flights['count']} flights from BER to JFK") ``` -------------------------------- ### Analyze Flight Schedules with Javascript Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt A Javascript class for analyzing flight schedules, providing methods to calculate airline statistics, aircraft distribution, busiest hours, and destination lists. It takes an array of flight objects as input and returns structured analytical data. Requires a `fetchAirportSchedule` function (not provided) to retrieve the initial flight data. ```javascript class FlightScheduleAnalyzer { constructor(flights) { this.flights = flights; } getAirlineStatistics() { const stats = {}; this.flights.forEach(flight => { const airline = flight.airline.iataCode; if (!stats[airline]) { stats[airline] = { name: flight.airline.name, count: 0, flights: [] }; } stats[airline].count++; stats[airline].flights.push(flight.flight.iataNumber); }); return stats; } getAircraftDistribution() { const distribution = {}; this.flights.forEach(flight => { const model = flight.aircraft.modelText; distribution[model] = (distribution[model] || 0) + 1; }); return Object.entries(distribution) .sort((a, b) => b[1] - a[1]) .map(([model, count]) => ({ model, count })); } getBusiestHours() { const hourlyCount = Array(24).fill(0); this.flights.forEach(flight => { const hour = parseInt(flight.departure.scheduledTime.split(':')[0]); hourlyCount[hour]++; }); return hourlyCount.map((count, hour) => ({ hour: `${hour.toString().padStart(2, '0')}:00`, flights: count })); } getDestinationList() { const destinations = {}; this.flights.forEach(flight => { const dest = flight.arrival.iataCode.toUpperCase(); destinations[dest] = (destinations[dest] || 0) + 1; }); return Object.entries(destinations) .sort((a, b) => b[1] - a[1]) .map(([code, count]) => ({ code, count })); } } // Example usage async function analyzeAirport(iataCode, date) { const result = await fetchAirportSchedule(iataCode, 'departure', date); if (result.success) { const analyzer = new FlightScheduleAnalyzer(result.data); console.log('=== Airport Statistics ==='); console.log('Airlines:', analyzer.getAirlineStatistics()); console.log('\nAircraft Distribution:', analyzer.getAircraftDistribution().slice(0, 5)); console.log('\nBusiest Hours:', analyzer.getBusiestHours().filter(h => h.flights > 0)); console.log('\nTop Destinations:', analyzer.getDestinationList().slice(0, 10)); } } analyzeAirport('ATL', '2024-12-25'); ``` -------------------------------- ### Display Flight Details (JavaScript) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Parses and formats detailed information for a single flight object obtained from the AviationEdge API. It extracts key details such as flight numbers, airline, aircraft, departure/arrival times, terminals, gates, and codeshare information, then logs them to the console in a human-readable format. ```javascript function displayFlightDetails(flight) { const flightInfo = { flightNumber: flight.flight.iataNumber, icaoNumber: flight.flight.icaoNumber, airline: { name: flight.airline.name, code: flight.airline.iataCode }, aircraft: { model: flight.aircraft.modelText, code: flight.aircraft.modelCode }, departure: { airport: flight.departure.iataCode.toUpperCase(), time: flight.departure.scheduledTime, terminal: flight.departure.terminal || 'N/A', gate: flight.departure.gate || 'N/A' }, arrival: { airport: flight.arrival.iataCode.toUpperCase(), time: flight.arrival.scheduledTime, terminal: flight.arrival.terminal || 'N/A', gate: flight.arrival.gate || 'N/A' }, weekday: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][flight.weekday - 1], codeshare: flight.codeshared ? { airline: flight.codeshared.airline.name, flightNumber: flight.codeshared.flight.iataNumber } : null }; console.log(` ===== Flight ${flightInfo.flightNumber} ===== Airline: ${flightInfo.airline.name} (${flightInfo.airline.code}) Aircraft: ${flightInfo.aircraft.model} Route: ${flightInfo.departure.airport} → ${flightInfo.arrival.airport} Departure: ${flightInfo.departure.time} (Terminal ${flightInfo.departure.terminal}, Gate ${flightInfo.departure.gate}) Arrival: ${flightInfo.arrival.time} (Terminal ${flightInfo.arrival.terminal}, Gate ${flightInfo.arrival.gate}) Day of Week: ${flightInfo.weekday} ${flightInfo.codeshare ? `Codeshare: ${flightInfo.codeshare.airline} ${flightInfo.codeshare.flightNumber}` : 'No codeshare'} `); return flightInfo; } // Example usage fetchAirportSchedule('MTY', 'departure', '2024-12-25') .then(result => { if (result.success && result.data.length > 0) { result.data.forEach(flight => displayFlightDetails(flight)); } }); ``` -------------------------------- ### Filter Arrival Schedule by Departure Airport Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Queries arrival schedules to a destination airport filtered by a specific origin airport, enabling reverse route queries. ```APIDOC ## GET /v2/public/flightsFuture ### Description Queries arrival schedules to a destination airport filtered by a specific origin airport. ### Method GET ### Endpoint /v2/public/flightsFuture ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **type** (string) - Required - Specifies the schedule type, 'arrival'. - **iataCode** (string) - Required - The IATA code of the arrival airport. - **dep_iataCode** (string) - Required - The IATA code of the departure airport. - **date** (string) - Required - The future date in 'YYYY-MM-DD' format. ### Request Example ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=arrival&iataCode=BER&dep_iataCode=ORY&date=2024-12-25" -H "Accept: application/json" ``` ### Response #### Success Response (200) *Returns only flights arriving at the specified `iataCode` that departed from the specified `dep_iataCode`.* *Response structure is the same as 'Get Arrival Schedule for Airport on Future Date'.* #### Response Example ```json [ { "weekday": "3", "departure": { "iataCode": "ory", "scheduledTime": "10:00" }, "arrival": { "iataCode": "ber", "scheduledTime": "12:30" }, "aircraft": { "modelCode": "a320", "modelText": "airbus a320" }, "airline": { "name": "air france", "iataCode": "af" }, "flight": { "number": "1023", "iataNumber": "af1023" } } ] ``` ``` -------------------------------- ### Display Flight Details (JavaScript) Source: https://github.com/aviationedgeapi/future-schedules-api/blob/main/README.md Displays key details of a given flight object, including flight number, aircraft model, scheduled times, gate information, and codeshare details. Assumes flight data is provided as an argument. ```javascript function displayFlightDetails(flight) { console.log("Flight Number:", flight.flight.iataNumber); console.log("Aircraft:", flight.aircraft.modelText); console.log("Departure Time:", flight.departure.scheduledTime); console.log("Arrival Time:", flight.arrival.scheduledTime); console.log("Departure Gate:", flight.departure.gate); console.log("Arrival Gate:", flight.arrival.gate); console.log("Codeshare Information:", flight.codeshared ? flight.codeshared.airline.name : "No codeshare information available."); } // Test display function with the first flight from fetched data fetchAirportSchedule().then(data => { if(data && data.length > 0) { displayFlightDetails(data[0]); } }); ``` -------------------------------- ### Filter Departure Schedule by Arrival Airport (Bash) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Queries departure schedules from a source airport filtered by a specific destination airport. This is useful for retrieving route-specific flight information. Parameters include API key, source IATA code, destination IATA code, and date. ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=departure&iataCode=BER&arr_iataCode=ORY&date=2024-12-25" \ -H "Accept: application/json" ``` -------------------------------- ### Filter Departure Schedule by Arrival Airport Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Queries departure schedules from a source airport filtered by a specific destination airport, useful for route-specific flight information. ```APIDOC ## GET /v2/public/flightsFuture ### Description Queries departure schedules from a source airport filtered by a specific destination airport. ### Method GET ### Endpoint /v2/public/flightsFuture ### Parameters #### Query Parameters - **key** (string) - Required - Your API key. - **type** (string) - Required - Specifies the schedule type, 'departure'. - **iataCode** (string) - Required - The IATA code of the departure airport. - **arr_iataCode** (string) - Required - The IATA code of the arrival airport. - **date** (string) - Required - The future date in 'YYYY-MM-DD' format. ### Request Example ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=departure&iataCode=BER&arr_iataCode=ORY&date=2024-12-25" -H "Accept: application/json" ``` ### Response #### Success Response (200) *Returns only flights departing from the specified `iataCode` and arriving at the specified `arr_iataCode`.* *Response structure is the same as 'Get Departure Schedule for Airport on Future Date'.* #### Response Example ```json [ { "weekday": "3", "departure": { "iataCode": "ber", "scheduledTime": "10:00" }, "arrival": { "iataCode": "ory", "scheduledTime": "12:30" }, "aircraft": { "modelCode": "a320", "modelText": "airbus a320" }, "airline": { "name": "air france", "iataCode": "af" }, "flight": { "number": "1023", "iataNumber": "af1023" } } ] ``` ``` -------------------------------- ### Filter Flight Schedules by Specific Flight Number (Bash) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Queries a specific flight by its flight number, ideal for tracking individual flight schedules across dates. Requires API key, type (departure/arrival), airport IATA code, flight number, and the target date. ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=departure&iataCode=BER&flight_num=400&date=2024-12-25" \ -H "Accept: application/json" ``` -------------------------------- ### Fetch Airport Schedule (JavaScript/Node.js) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Fetches future flight schedules for a given airport (departures or arrivals) using the AviationEdge API. It requires the 'axios' library for HTTP requests and handles API responses and errors gracefully. The function accepts airport IATA code, flight type, date, and optional filters. ```javascript const axios = require('axios'); const API_KEY = 'your_api_key_here'; const BASE_URL = 'https://aviation-edge.com/v2/public/flightsFuture'; async function fetchAirportSchedule(iataCode, type, date, filters = {}) { try { const params = { key: API_KEY, type: type, iataCode: iataCode, date: date, ...filters }; const response = await axios.get(BASE_URL, { params }); if (response.status === 200) { return { success: true, data: response.data, count: response.data.length }; } } catch (error) { console.error("API Error:", error.response?.status, error.message); return { success: false, error: error.message, data: null }; } } // Example usage: Get all departures from Berlin fetchAirportSchedule('BER', 'departure', '2024-12-25') .then(result => { if (result.success) { console.log(`Found ${result.count} flights`); console.log("First flight:", result.data[0]); } }); // Example with filters: Get arrivals from specific origin fetchAirportSchedule('BER', 'arrival', '2024-12-25', { dep_iataCode: 'ORY', airline_iata: 'AF' }) .then(result => { if (result.success) { result.data.forEach(flight => { console.log(`${flight.flight.iataNumber}: ${flight.departure.iataCode} -> ${flight.arrival.iataCode}`); }); } }); ``` -------------------------------- ### Filter Flights by Time (JavaScript) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Filters an array of flight objects based on departure or arrival time conditions. It supports filtering by time before, after, or within a specified range. Dependencies include the flight data array and a time condition object. ```javascript function filterFlightsByTime(flights, timeCondition) { return flights.filter(flight => { const depTime = flight.departure.scheduledTime; const arrTime = flight.arrival.scheduledTime; switch(timeCondition.type) { case 'departure_before': return depTime < timeCondition.time; case 'departure_after': return depTime > timeCondition.time; case 'departure_between': return depTime >= timeCondition.startTime && depTime <= timeCondition.endTime; case 'arrival_before': return arrTime < timeCondition.time; case 'arrival_after': return arrTime > timeCondition.time; default: return true; } }); } // Example: Find all early morning departures fetchAirportSchedule('BER', 'departure', '2024-12-25') .then(result => { if (result.success) { const morningFlights = filterFlightsByTime(result.data, { type: 'departure_before', time: '09:00' }); console.log(`Found ${morningFlights.length} flights before 9 AM`); // Find flights in specific time window const businessHours = filterFlightsByTime(result.data, { type: 'departure_between', startTime: '08:00', endTime: '18:00' }); console.log(`Business hours flights: ${businessHours.length}`); } }); ``` -------------------------------- ### Fetch Future Airport Schedules Data (Node.js) Source: https://github.com/aviationedgeapi/future-schedules-api/blob/main/README.md Fetches future flight schedule data for a specific airport and date using the Axios library. Requires an API key and specifies departure type. Returns flight data or an error message. ```javascript const axios = require('axios'); const API_ENDPOINT = "https://aviation-edge.com/v2/public/flightsFuture?key=api-key&type=departure&iataCode=BER&date=2023-12-17"; async function fetchAirportSchedule() { try { const response = await axios.get(API_ENDPOINT); return response.data; } catch (error) { console.error("Error fetching data:", error); return null; } } // Test fetching the data fetchAirportSchedule().then(data => { if(data) { console.log("Received Data:", data); } }); ``` -------------------------------- ### Filter Flight Schedules by Airline IATA Code (Bash) Source: https://context7.com/aviationedgeapi/future-schedules-api/llms.txt Retrieves flight schedules filtered by a specific airline using its IATA code. This is useful for airline-specific applications. Parameters include API key, type (departure/arrival), airport IATA code, airline IATA code, and date. ```bash curl -X GET "https://aviation-edge.com/v2/public/flightsFuture?key=YOUR_API_KEY&type=departure&iataCode=BER&airline_iata=LH&date=2024-12-25" \ -H "Accept: application/json" ```