// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; export class Flights extends APIResource { /** * Returns all recent and upcoming flights departing from or arriving at the * specified airport. Filtering/ordering behavior for the optional start and end * parameters for each type (`scheduled_departures`, `scheduled_arrivals`, * `departures`, `arrivals`) match the behavior in their corresponding endpoints. * * @example * ```ts * const flights = await client.airports.flights.list('id'); * ``` */ list( id: string, query: FlightListParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/airports/${id}/flights`, { query, ...options }); } /** * Returns counts of flights for an airport broken down by flight status. The * returned categories are subtly different from what is returned from the * `/airports/{id}/flights` endpoints. Specifically, this operation does not * include completed flights in its counts, and it does not count * cancelled/diverted flights. It also does not strictly bound the time for which * scheduled flights are counted, so all future flights that FlightAware knows * about are included in the counts. See the response schema and documentation for * the airport flights endpoints for more information. * * @example * ```ts * const response = await client.airports.flights.getCounts( * 'id', * ); * ``` */ getCounts(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/airports/${id}/flights/counts`, options); } /** * Returns flights that have arrived at an airport, orderd by `actual_on` * descending. The start parameter's default value is 24 hours before the current * time. The end parameter's default value is the current time. * * @example * ```ts * const response = await client.airports.flights.listArrivals( * 'id', * ); * ``` */ listArrivals( id: string, query: FlightListArrivalsParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/airports/${id}/flights/arrivals`, { query, ...options }); } /** * Returns flights that have departed from an airport and not been diverted, * ordered by `actual_off` descending. The optional start and end parameters will * be compared against `actual_off` to limit the flights returned. The start * parameter's default value is 24 hours before the current time. The end * parameter's default value is the current time. * * @example * ```ts * const response = * await client.airports.flights.listDepartures('id'); * ``` */ listDepartures( id: string, query: FlightListDeparturesParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/airports/${id}/flights/departures`, { query, ...options }); } /** * Returns flights that are expected to arrive at an airport. This can include both * undeparted and en route flights. Flights are ordered by `estimated_on` * ascending. The optional start and end parameters will be compared against * `estimated_on` to limit the flights returned. The start parameter's default * value is 48 hours before the current time (this accounts for delayed flights). * The end parameter's default value is 24 hours after the current time. * * @example * ```ts * const response = * await client.airports.flights.listScheduledArrivals('id'); * ``` */ listScheduledArrivals( id: string, query: FlightListScheduledArrivalsParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/airports/${id}/flights/scheduled_arrivals`, { query, ...options }); } /** * Returns flights that are scheduled to depart from an airport or have recently * been cancelled, ordered by `estimated_off` (or `scheduled_off` if * `estimated_off` is missing) ascending. The optional start and end parameters * will be compared against `scheduled_off` to limit the flights returned. The * start parameter's default value is 2 hours before the current time. The end * parameter's default value is 24 hours after the current time. * * @example * ```ts * const response = * await client.airports.flights.listScheduledDepartures( * 'id', * ); * ``` */ listScheduledDepartures( id: string, query: FlightListScheduledDeparturesParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/airports/${id}/flights/scheduled_departures`, { query, ...options }); } /** * This endpoint is quite similar to the `FindFlight` operator in prior versions of * AeroAPI. Results may include both non-stop and one-stop flights. Note that * because the returned flights can include multiple legs, the response format * differs from most other flight-returning endpoints. If the optional start or end * query parameters are not provided start will default to 1 day in the future, * while end will default to 7 days in the past relative to the time the query is * made. * * @example * ```ts * const response = * await client.airports.flights.listToDestination( * 'dest_id', * { id: 'id' }, * ); * ``` */ listToDestination( destID: string, params: FlightListToDestinationParams, options?: RequestOptions, ): APIPromise { const { id, ...query } = params; return this._client.get(path`/airports/${id}/flights/to/${destID}`, { query, ...options }); } } export interface FlightListResponse { arrivals: Array; departures: Array; /** * Object containing links to related resources. */ links: FlightListResponse.Links | null; /** * Number of pages returned */ num_pages: number; scheduled_arrivals: Array; scheduled_departures: Array; } export namespace FlightListResponse { export interface Arrival { /** * Actual gate arrival time. */ actual_in: string | null; /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Actual gate departure time. */ actual_out: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * Arrival delay (in seconds) based on either actual or estimated gate arrival * time. If gate time is unavailable then based on runway arrival time. A negative * value indicates the flight is early. */ arrival_delay: number | null; /** * The ident of the flight for Air Traffic Control purposes, when known and * different than ident. */ atc_ident: string | null; /** * Baggage claim location at the destination airport. */ baggage_claim: string | null; /** * Flag indicating whether this flight is blocked from public viewing. */ blocked: boolean; /** * Flag indicating that the flight is no longer being tracked by FlightAware. There * are a number of reasons this could happen including cancellation by the airline, * but that will not always be the case. */ cancelled: boolean; /** * List of any ICAO codeshares operating on this flight. */ codeshares: Array | null; /** * Departure delay (in seconds) based on either actual or estimated gate departure * time. If gate time is unavailable then based on runway departure time. A * negative value indicates the flight is early. */ departure_delay: number | null; /** * Information for this flight's destination airport. */ destination: Arrival.Destination | null; /** * Flag indicating whether this flight was diverted. */ diverted: boolean; /** * Estimated gate arrival time. */ estimated_in: string | null; /** * Estimated runway departure time. */ estimated_off: string | null; /** * Estimated runway arrival time. */ estimated_on: string | null; /** * Estimated gate departure time. */ estimated_out: string | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Filed IFR airspeed (knots). */ filed_airspeed: number | null; /** * Filed IFR altitude (100s of feet). */ filed_altitude: number | null; /** * Runway-to-runway filed duration (seconds). */ filed_ete: number | null; /** * Bare flight number of the flight. */ flight_number: string | null; /** * Arrival gate at the destination airport. */ gate_destination: string | null; /** * Departure gate at the origin airport. */ gate_origin: string | null; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * Unique identifier assigned by FlightAware for the previous flight of the * aircraft serving this flight. */ inbound_fa_flight_id: string | null; /** * ICAO code, if exists, of the operator of the flight, otherwise the IATA code */ operator: string | null; /** * IATA code of the operator of the flight. */ operator_iata: string | null; /** * Information for this flight's origin airport. */ origin: Arrival.Origin | null; /** * Flag indicating that this flight does not have a flight plan, schedule, or other * indication of intent available. */ position_only: boolean; /** * The percent completion of a flight, based on runway departure/arrival. Null for * en route position-only flights. */ progress_percent: number | null; /** * Aircraft registration (tail number) of the aircraft, when known. */ registration: string | null; /** * The textual description of the flight's route. */ route: string | null; /** * Planned flight distance (statute miles) based on the filed route. May vary from * actual flown distance. */ route_distance: number | null; /** * Scheduled gate arrival time. */ scheduled_in: string | null; /** * Scheduled runway departure time. */ scheduled_off: string | null; /** * Scheduled runway arrival time. */ scheduled_on: string | null; /** * Scheduled gate departure time. */ scheduled_out: string | null; /** * Number of seats in the business class cabin. */ seats_cabin_business: number | null; /** * Number of seats in the coach cabin. */ seats_cabin_coach: number | null; /** * Number of seats in the first class cabin. */ seats_cabin_first: number | null; /** * Human-readable summary of flight status. */ status: string; /** * Arrival terminal at the destination airport. */ terminal_destination: string | null; /** * Departure terminal at the origin airport. */ terminal_origin: string | null; /** * Whether this is a commercial or general aviation flight. */ type: 'General_Aviation' | 'Airline'; /** * Actual departure runway at origin, when known */ actual_runway_off?: string | null; /** * Actual arrival runway at destination, when known */ actual_runway_on?: string | null; /** * List of any IATA codeshares operating on this flight. */ codeshares_iata?: Array | null; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * ICAO code of the operator of the flight. */ operator_icao?: string | null; } export namespace Arrival { /** * Information for this flight's destination airport. */ export interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Information for this flight's origin airport. */ export interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } export interface Departure { /** * Actual gate arrival time. */ actual_in: string | null; /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Actual gate departure time. */ actual_out: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * Arrival delay (in seconds) based on either actual or estimated gate arrival * time. If gate time is unavailable then based on runway arrival time. A negative * value indicates the flight is early. */ arrival_delay: number | null; /** * The ident of the flight for Air Traffic Control purposes, when known and * different than ident. */ atc_ident: string | null; /** * Baggage claim location at the destination airport. */ baggage_claim: string | null; /** * Flag indicating whether this flight is blocked from public viewing. */ blocked: boolean; /** * Flag indicating that the flight is no longer being tracked by FlightAware. There * are a number of reasons this could happen including cancellation by the airline, * but that will not always be the case. */ cancelled: boolean; /** * List of any ICAO codeshares operating on this flight. */ codeshares: Array | null; /** * Departure delay (in seconds) based on either actual or estimated gate departure * time. If gate time is unavailable then based on runway departure time. A * negative value indicates the flight is early. */ departure_delay: number | null; /** * Information for this flight's destination airport. */ destination: Departure.Destination | null; /** * Flag indicating whether this flight was diverted. */ diverted: boolean; /** * Estimated gate arrival time. */ estimated_in: string | null; /** * Estimated runway departure time. */ estimated_off: string | null; /** * Estimated runway arrival time. */ estimated_on: string | null; /** * Estimated gate departure time. */ estimated_out: string | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Filed IFR airspeed (knots). */ filed_airspeed: number | null; /** * Filed IFR altitude (100s of feet). */ filed_altitude: number | null; /** * Runway-to-runway filed duration (seconds). */ filed_ete: number | null; /** * Bare flight number of the flight. */ flight_number: string | null; /** * Arrival gate at the destination airport. */ gate_destination: string | null; /** * Departure gate at the origin airport. */ gate_origin: string | null; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * Unique identifier assigned by FlightAware for the previous flight of the * aircraft serving this flight. */ inbound_fa_flight_id: string | null; /** * ICAO code, if exists, of the operator of the flight, otherwise the IATA code */ operator: string | null; /** * IATA code of the operator of the flight. */ operator_iata: string | null; /** * Information for this flight's origin airport. */ origin: Departure.Origin | null; /** * Flag indicating that this flight does not have a flight plan, schedule, or other * indication of intent available. */ position_only: boolean; /** * The percent completion of a flight, based on runway departure/arrival. Null for * en route position-only flights. */ progress_percent: number | null; /** * Aircraft registration (tail number) of the aircraft, when known. */ registration: string | null; /** * The textual description of the flight's route. */ route: string | null; /** * Planned flight distance (statute miles) based on the filed route. May vary from * actual flown distance. */ route_distance: number | null; /** * Scheduled gate arrival time. */ scheduled_in: string | null; /** * Scheduled runway departure time. */ scheduled_off: string | null; /** * Scheduled runway arrival time. */ scheduled_on: string | null; /** * Scheduled gate departure time. */ scheduled_out: string | null; /** * Number of seats in the business class cabin. */ seats_cabin_business: number | null; /** * Number of seats in the coach cabin. */ seats_cabin_coach: number | null; /** * Number of seats in the first class cabin. */ seats_cabin_first: number | null; /** * Human-readable summary of flight status. */ status: string; /** * Arrival terminal at the destination airport. */ terminal_destination: string | null; /** * Departure terminal at the origin airport. */ terminal_origin: string | null; /** * Whether this is a commercial or general aviation flight. */ type: 'General_Aviation' | 'Airline'; /** * Actual departure runway at origin, when known */ actual_runway_off?: string | null; /** * Actual arrival runway at destination, when known */ actual_runway_on?: string | null; /** * List of any IATA codeshares operating on this flight. */ codeshares_iata?: Array | null; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * ICAO code of the operator of the flight. */ operator_icao?: string | null; } export namespace Departure { /** * Information for this flight's destination airport. */ export interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Information for this flight's origin airport. */ export interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } /** * Object containing links to related resources. */ export interface Links { /** * A link to the next set of records in a collection. */ next: string; } export interface ScheduledArrival { /** * Actual gate arrival time. */ actual_in: string | null; /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Actual gate departure time. */ actual_out: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * Arrival delay (in seconds) based on either actual or estimated gate arrival * time. If gate time is unavailable then based on runway arrival time. A negative * value indicates the flight is early. */ arrival_delay: number | null; /** * The ident of the flight for Air Traffic Control purposes, when known and * different than ident. */ atc_ident: string | null; /** * Baggage claim location at the destination airport. */ baggage_claim: string | null; /** * Flag indicating whether this flight is blocked from public viewing. */ blocked: boolean; /** * Flag indicating that the flight is no longer being tracked by FlightAware. There * are a number of reasons this could happen including cancellation by the airline, * but that will not always be the case. */ cancelled: boolean; /** * List of any ICAO codeshares operating on this flight. */ codeshares: Array | null; /** * Departure delay (in seconds) based on either actual or estimated gate departure * time. If gate time is unavailable then based on runway departure time. A * negative value indicates the flight is early. */ departure_delay: number | null; /** * Information for this flight's destination airport. */ destination: ScheduledArrival.Destination | null; /** * Flag indicating whether this flight was diverted. */ diverted: boolean; /** * Estimated gate arrival time. */ estimated_in: string | null; /** * Estimated runway departure time. */ estimated_off: string | null; /** * Estimated runway arrival time. */ estimated_on: string | null; /** * Estimated gate departure time. */ estimated_out: string | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Filed IFR airspeed (knots). */ filed_airspeed: number | null; /** * Filed IFR altitude (100s of feet). */ filed_altitude: number | null; /** * Runway-to-runway filed duration (seconds). */ filed_ete: number | null; /** * Bare flight number of the flight. */ flight_number: string | null; /** * Arrival gate at the destination airport. */ gate_destination: string | null; /** * Departure gate at the origin airport. */ gate_origin: string | null; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * Unique identifier assigned by FlightAware for the previous flight of the * aircraft serving this flight. */ inbound_fa_flight_id: string | null; /** * ICAO code, if exists, of the operator of the flight, otherwise the IATA code */ operator: string | null; /** * IATA code of the operator of the flight. */ operator_iata: string | null; /** * Information for this flight's origin airport. */ origin: ScheduledArrival.Origin | null; /** * Flag indicating that this flight does not have a flight plan, schedule, or other * indication of intent available. */ position_only: boolean; /** * The percent completion of a flight, based on runway departure/arrival. Null for * en route position-only flights. */ progress_percent: number | null; /** * Aircraft registration (tail number) of the aircraft, when known. */ registration: string | null; /** * The textual description of the flight's route. */ route: string | null; /** * Planned flight distance (statute miles) based on the filed route. May vary from * actual flown distance. */ route_distance: number | null; /** * Scheduled gate arrival time. */ scheduled_in: string | null; /** * Scheduled runway departure time. */ scheduled_off: string | null; /** * Scheduled runway arrival time. */ scheduled_on: string | null; /** * Scheduled gate departure time. */ scheduled_out: string | null; /** * Number of seats in the business class cabin. */ seats_cabin_business: number | null; /** * Number of seats in the coach cabin. */ seats_cabin_coach: number | null; /** * Number of seats in the first class cabin. */ seats_cabin_first: number | null; /** * Human-readable summary of flight status. */ status: string; /** * Arrival terminal at the destination airport. */ terminal_destination: string | null; /** * Departure terminal at the origin airport. */ terminal_origin: string | null; /** * Whether this is a commercial or general aviation flight. */ type: 'General_Aviation' | 'Airline'; /** * Actual departure runway at origin, when known */ actual_runway_off?: string | null; /** * Actual arrival runway at destination, when known */ actual_runway_on?: string | null; /** * List of any IATA codeshares operating on this flight. */ codeshares_iata?: Array | null; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * ICAO code of the operator of the flight. */ operator_icao?: string | null; } export namespace ScheduledArrival { /** * Information for this flight's destination airport. */ export interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Information for this flight's origin airport. */ export interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } export interface ScheduledDeparture { /** * Actual gate arrival time. */ actual_in: string | null; /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Actual gate departure time. */ actual_out: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * Arrival delay (in seconds) based on either actual or estimated gate arrival * time. If gate time is unavailable then based on runway arrival time. A negative * value indicates the flight is early. */ arrival_delay: number | null; /** * The ident of the flight for Air Traffic Control purposes, when known and * different than ident. */ atc_ident: string | null; /** * Baggage claim location at the destination airport. */ baggage_claim: string | null; /** * Flag indicating whether this flight is blocked from public viewing. */ blocked: boolean; /** * Flag indicating that the flight is no longer being tracked by FlightAware. There * are a number of reasons this could happen including cancellation by the airline, * but that will not always be the case. */ cancelled: boolean; /** * List of any ICAO codeshares operating on this flight. */ codeshares: Array | null; /** * Departure delay (in seconds) based on either actual or estimated gate departure * time. If gate time is unavailable then based on runway departure time. A * negative value indicates the flight is early. */ departure_delay: number | null; /** * Information for this flight's destination airport. */ destination: ScheduledDeparture.Destination | null; /** * Flag indicating whether this flight was diverted. */ diverted: boolean; /** * Estimated gate arrival time. */ estimated_in: string | null; /** * Estimated runway departure time. */ estimated_off: string | null; /** * Estimated runway arrival time. */ estimated_on: string | null; /** * Estimated gate departure time. */ estimated_out: string | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Filed IFR airspeed (knots). */ filed_airspeed: number | null; /** * Filed IFR altitude (100s of feet). */ filed_altitude: number | null; /** * Runway-to-runway filed duration (seconds). */ filed_ete: number | null; /** * Bare flight number of the flight. */ flight_number: string | null; /** * Arrival gate at the destination airport. */ gate_destination: string | null; /** * Departure gate at the origin airport. */ gate_origin: string | null; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * Unique identifier assigned by FlightAware for the previous flight of the * aircraft serving this flight. */ inbound_fa_flight_id: string | null; /** * ICAO code, if exists, of the operator of the flight, otherwise the IATA code */ operator: string | null; /** * IATA code of the operator of the flight. */ operator_iata: string | null; /** * Information for this flight's origin airport. */ origin: ScheduledDeparture.Origin | null; /** * Flag indicating that this flight does not have a flight plan, schedule, or other * indication of intent available. */ position_only: boolean; /** * The percent completion of a flight, based on runway departure/arrival. Null for * en route position-only flights. */ progress_percent: number | null; /** * Aircraft registration (tail number) of the aircraft, when known. */ registration: string | null; /** * The textual description of the flight's route. */ route: string | null; /** * Planned flight distance (statute miles) based on the filed route. May vary from * actual flown distance. */ route_distance: number | null; /** * Scheduled gate arrival time. */ scheduled_in: string | null; /** * Scheduled runway departure time. */ scheduled_off: string | null; /** * Scheduled runway arrival time. */ scheduled_on: string | null; /** * Scheduled gate departure time. */ scheduled_out: string | null; /** * Number of seats in the business class cabin. */ seats_cabin_business: number | null; /** * Number of seats in the coach cabin. */ seats_cabin_coach: number | null; /** * Number of seats in the first class cabin. */ seats_cabin_first: number | null; /** * Human-readable summary of flight status. */ status: string; /** * Arrival terminal at the destination airport. */ terminal_destination: string | null; /** * Departure terminal at the origin airport. */ terminal_origin: string | null; /** * Whether this is a commercial or general aviation flight. */ type: 'General_Aviation' | 'Airline'; /** * Actual departure runway at origin, when known */ actual_runway_off?: string | null; /** * Actual arrival runway at destination, when known */ actual_runway_on?: string | null; /** * List of any IATA codeshares operating on this flight. */ codeshares_iata?: Array | null; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * ICAO code of the operator of the flight. */ operator_icao?: string | null; } export namespace ScheduledDeparture { /** * Information for this flight's destination airport. */ export interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Information for this flight's origin airport. */ export interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } } /** * None of the counts include cancellations. */ export interface FlightGetCountsResponse { /** * Number of flights that have departed the airport and are currently airborne. */ departed: number; /** * Number of flights that are currently bound for the airport. */ enroute: number; /** * Number of flights that have not yet departed but are scheduled to arrive at the * airport. */ scheduled_arrivals: number; /** * Number of flights that are scheduled to depart from the airport. */ scheduled_departures: number; } export interface FlightListArrivalsResponse { arrivals: Array; /** * Object containing links to related resources. */ links: FlightListArrivalsResponse.Links | null; /** * Number of pages returned */ num_pages: number; } export namespace FlightListArrivalsResponse { export interface Arrival { /** * Actual gate arrival time. */ actual_in: string | null; /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Actual gate departure time. */ actual_out: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * Arrival delay (in seconds) based on either actual or estimated gate arrival * time. If gate time is unavailable then based on runway arrival time. A negative * value indicates the flight is early. */ arrival_delay: number | null; /** * The ident of the flight for Air Traffic Control purposes, when known and * different than ident. */ atc_ident: string | null; /** * Baggage claim location at the destination airport. */ baggage_claim: string | null; /** * Flag indicating whether this flight is blocked from public viewing. */ blocked: boolean; /** * Flag indicating that the flight is no longer being tracked by FlightAware. There * are a number of reasons this could happen including cancellation by the airline, * but that will not always be the case. */ cancelled: boolean; /** * List of any ICAO codeshares operating on this flight. */ codeshares: Array | null; /** * Departure delay (in seconds) based on either actual or estimated gate departure * time. If gate time is unavailable then based on runway departure time. A * negative value indicates the flight is early. */ departure_delay: number | null; /** * Information for this flight's destination airport. */ destination: Arrival.Destination | null; /** * Flag indicating whether this flight was diverted. */ diverted: boolean; /** * Estimated gate arrival time. */ estimated_in: string | null; /** * Estimated runway departure time. */ estimated_off: string | null; /** * Estimated runway arrival time. */ estimated_on: string | null; /** * Estimated gate departure time. */ estimated_out: string | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Filed IFR airspeed (knots). */ filed_airspeed: number | null; /** * Filed IFR altitude (100s of feet). */ filed_altitude: number | null; /** * Runway-to-runway filed duration (seconds). */ filed_ete: number | null; /** * Bare flight number of the flight. */ flight_number: string | null; /** * Arrival gate at the destination airport. */ gate_destination: string | null; /** * Departure gate at the origin airport. */ gate_origin: string | null; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * Unique identifier assigned by FlightAware for the previous flight of the * aircraft serving this flight. */ inbound_fa_flight_id: string | null; /** * ICAO code, if exists, of the operator of the flight, otherwise the IATA code */ operator: string | null; /** * IATA code of the operator of the flight. */ operator_iata: string | null; /** * Information for this flight's origin airport. */ origin: Arrival.Origin | null; /** * Flag indicating that this flight does not have a flight plan, schedule, or other * indication of intent available. */ position_only: boolean; /** * The percent completion of a flight, based on runway departure/arrival. Null for * en route position-only flights. */ progress_percent: number | null; /** * Aircraft registration (tail number) of the aircraft, when known. */ registration: string | null; /** * The textual description of the flight's route. */ route: string | null; /** * Planned flight distance (statute miles) based on the filed route. May vary from * actual flown distance. */ route_distance: number | null; /** * Scheduled gate arrival time. */ scheduled_in: string | null; /** * Scheduled runway departure time. */ scheduled_off: string | null; /** * Scheduled runway arrival time. */ scheduled_on: string | null; /** * Scheduled gate departure time. */ scheduled_out: string | null; /** * Number of seats in the business class cabin. */ seats_cabin_business: number | null; /** * Number of seats in the coach cabin. */ seats_cabin_coach: number | null; /** * Number of seats in the first class cabin. */ seats_cabin_first: number | null; /** * Human-readable summary of flight status. */ status: string; /** * Arrival terminal at the destination airport. */ terminal_destination: string | null; /** * Departure terminal at the origin airport. */ terminal_origin: string | null; /** * Whether this is a commercial or general aviation flight. */ type: 'General_Aviation' | 'Airline'; /** * Actual departure runway at origin, when known */ actual_runway_off?: string | null; /** * Actual arrival runway at destination, when known */ actual_runway_on?: string | null; /** * List of any IATA codeshares operating on this flight. */ codeshares_iata?: Array | null; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * ICAO code of the operator of the flight. */ operator_icao?: string | null; } export namespace Arrival { /** * Information for this flight's destination airport. */ export interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Information for this flight's origin airport. */ export interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } /** * Object containing links to related resources. */ export interface Links { /** * A link to the next set of records in a collection. */ next: string; } } export interface FlightListDeparturesResponse { departures: Array; /** * Object containing links to related resources. */ links: FlightListDeparturesResponse.Links | null; /** * Number of pages returned */ num_pages: number; } export namespace FlightListDeparturesResponse { export interface Departure { /** * Actual gate arrival time. */ actual_in: string | null; /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Actual gate departure time. */ actual_out: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * Arrival delay (in seconds) based on either actual or estimated gate arrival * time. If gate time is unavailable then based on runway arrival time. A negative * value indicates the flight is early. */ arrival_delay: number | null; /** * The ident of the flight for Air Traffic Control purposes, when known and * different than ident. */ atc_ident: string | null; /** * Baggage claim location at the destination airport. */ baggage_claim: string | null; /** * Flag indicating whether this flight is blocked from public viewing. */ blocked: boolean; /** * Flag indicating that the flight is no longer being tracked by FlightAware. There * are a number of reasons this could happen including cancellation by the airline, * but that will not always be the case. */ cancelled: boolean; /** * List of any ICAO codeshares operating on this flight. */ codeshares: Array | null; /** * Departure delay (in seconds) based on either actual or estimated gate departure * time. If gate time is unavailable then based on runway departure time. A * negative value indicates the flight is early. */ departure_delay: number | null; /** * Information for this flight's destination airport. */ destination: Departure.Destination | null; /** * Flag indicating whether this flight was diverted. */ diverted: boolean; /** * Estimated gate arrival time. */ estimated_in: string | null; /** * Estimated runway departure time. */ estimated_off: string | null; /** * Estimated runway arrival time. */ estimated_on: string | null; /** * Estimated gate departure time. */ estimated_out: string | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Filed IFR airspeed (knots). */ filed_airspeed: number | null; /** * Filed IFR altitude (100s of feet). */ filed_altitude: number | null; /** * Runway-to-runway filed duration (seconds). */ filed_ete: number | null; /** * Bare flight number of the flight. */ flight_number: string | null; /** * Arrival gate at the destination airport. */ gate_destination: string | null; /** * Departure gate at the origin airport. */ gate_origin: string | null; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * Unique identifier assigned by FlightAware for the previous flight of the * aircraft serving this flight. */ inbound_fa_flight_id: string | null; /** * ICAO code, if exists, of the operator of the flight, otherwise the IATA code */ operator: string | null; /** * IATA code of the operator of the flight. */ operator_iata: string | null; /** * Information for this flight's origin airport. */ origin: Departure.Origin | null; /** * Flag indicating that this flight does not have a flight plan, schedule, or other * indication of intent available. */ position_only: boolean; /** * The percent completion of a flight, based on runway departure/arrival. Null for * en route position-only flights. */ progress_percent: number | null; /** * Aircraft registration (tail number) of the aircraft, when known. */ registration: string | null; /** * The textual description of the flight's route. */ route: string | null; /** * Planned flight distance (statute miles) based on the filed route. May vary from * actual flown distance. */ route_distance: number | null; /** * Scheduled gate arrival time. */ scheduled_in: string | null; /** * Scheduled runway departure time. */ scheduled_off: string | null; /** * Scheduled runway arrival time. */ scheduled_on: string | null; /** * Scheduled gate departure time. */ scheduled_out: string | null; /** * Number of seats in the business class cabin. */ seats_cabin_business: number | null; /** * Number of seats in the coach cabin. */ seats_cabin_coach: number | null; /** * Number of seats in the first class cabin. */ seats_cabin_first: number | null; /** * Human-readable summary of flight status. */ status: string; /** * Arrival terminal at the destination airport. */ terminal_destination: string | null; /** * Departure terminal at the origin airport. */ terminal_origin: string | null; /** * Whether this is a commercial or general aviation flight. */ type: 'General_Aviation' | 'Airline'; /** * Actual departure runway at origin, when known */ actual_runway_off?: string | null; /** * Actual arrival runway at destination, when known */ actual_runway_on?: string | null; /** * List of any IATA codeshares operating on this flight. */ codeshares_iata?: Array | null; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * ICAO code of the operator of the flight. */ operator_icao?: string | null; } export namespace Departure { /** * Information for this flight's destination airport. */ export interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Information for this flight's origin airport. */ export interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } /** * Object containing links to related resources. */ export interface Links { /** * A link to the next set of records in a collection. */ next: string; } } export interface FlightListScheduledArrivalsResponse { /** * Object containing links to related resources. */ links: FlightListScheduledArrivalsResponse.Links | null; /** * Number of pages returned */ num_pages: number; scheduled_arrivals: Array; } export namespace FlightListScheduledArrivalsResponse { /** * Object containing links to related resources. */ export interface Links { /** * A link to the next set of records in a collection. */ next: string; } export interface ScheduledArrival { /** * Actual gate arrival time. */ actual_in: string | null; /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Actual gate departure time. */ actual_out: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * Arrival delay (in seconds) based on either actual or estimated gate arrival * time. If gate time is unavailable then based on runway arrival time. A negative * value indicates the flight is early. */ arrival_delay: number | null; /** * The ident of the flight for Air Traffic Control purposes, when known and * different than ident. */ atc_ident: string | null; /** * Baggage claim location at the destination airport. */ baggage_claim: string | null; /** * Flag indicating whether this flight is blocked from public viewing. */ blocked: boolean; /** * Flag indicating that the flight is no longer being tracked by FlightAware. There * are a number of reasons this could happen including cancellation by the airline, * but that will not always be the case. */ cancelled: boolean; /** * List of any ICAO codeshares operating on this flight. */ codeshares: Array | null; /** * Departure delay (in seconds) based on either actual or estimated gate departure * time. If gate time is unavailable then based on runway departure time. A * negative value indicates the flight is early. */ departure_delay: number | null; /** * Information for this flight's destination airport. */ destination: ScheduledArrival.Destination | null; /** * Flag indicating whether this flight was diverted. */ diverted: boolean; /** * Estimated gate arrival time. */ estimated_in: string | null; /** * Estimated runway departure time. */ estimated_off: string | null; /** * Estimated runway arrival time. */ estimated_on: string | null; /** * Estimated gate departure time. */ estimated_out: string | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Filed IFR airspeed (knots). */ filed_airspeed: number | null; /** * Filed IFR altitude (100s of feet). */ filed_altitude: number | null; /** * Runway-to-runway filed duration (seconds). */ filed_ete: number | null; /** * Bare flight number of the flight. */ flight_number: string | null; /** * Arrival gate at the destination airport. */ gate_destination: string | null; /** * Departure gate at the origin airport. */ gate_origin: string | null; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * Unique identifier assigned by FlightAware for the previous flight of the * aircraft serving this flight. */ inbound_fa_flight_id: string | null; /** * ICAO code, if exists, of the operator of the flight, otherwise the IATA code */ operator: string | null; /** * IATA code of the operator of the flight. */ operator_iata: string | null; /** * Information for this flight's origin airport. */ origin: ScheduledArrival.Origin | null; /** * Flag indicating that this flight does not have a flight plan, schedule, or other * indication of intent available. */ position_only: boolean; /** * The percent completion of a flight, based on runway departure/arrival. Null for * en route position-only flights. */ progress_percent: number | null; /** * Aircraft registration (tail number) of the aircraft, when known. */ registration: string | null; /** * The textual description of the flight's route. */ route: string | null; /** * Planned flight distance (statute miles) based on the filed route. May vary from * actual flown distance. */ route_distance: number | null; /** * Scheduled gate arrival time. */ scheduled_in: string | null; /** * Scheduled runway departure time. */ scheduled_off: string | null; /** * Scheduled runway arrival time. */ scheduled_on: string | null; /** * Scheduled gate departure time. */ scheduled_out: string | null; /** * Number of seats in the business class cabin. */ seats_cabin_business: number | null; /** * Number of seats in the coach cabin. */ seats_cabin_coach: number | null; /** * Number of seats in the first class cabin. */ seats_cabin_first: number | null; /** * Human-readable summary of flight status. */ status: string; /** * Arrival terminal at the destination airport. */ terminal_destination: string | null; /** * Departure terminal at the origin airport. */ terminal_origin: string | null; /** * Whether this is a commercial or general aviation flight. */ type: 'General_Aviation' | 'Airline'; /** * Actual departure runway at origin, when known */ actual_runway_off?: string | null; /** * Actual arrival runway at destination, when known */ actual_runway_on?: string | null; /** * List of any IATA codeshares operating on this flight. */ codeshares_iata?: Array | null; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * ICAO code of the operator of the flight. */ operator_icao?: string | null; } export namespace ScheduledArrival { /** * Information for this flight's destination airport. */ export interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Information for this flight's origin airport. */ export interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } } export interface FlightListScheduledDeparturesResponse { /** * Object containing links to related resources. */ links: FlightListScheduledDeparturesResponse.Links | null; /** * Number of pages returned */ num_pages: number; scheduled_departures: Array; } export namespace FlightListScheduledDeparturesResponse { /** * Object containing links to related resources. */ export interface Links { /** * A link to the next set of records in a collection. */ next: string; } export interface ScheduledDeparture { /** * Actual gate arrival time. */ actual_in: string | null; /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Actual gate departure time. */ actual_out: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * Arrival delay (in seconds) based on either actual or estimated gate arrival * time. If gate time is unavailable then based on runway arrival time. A negative * value indicates the flight is early. */ arrival_delay: number | null; /** * The ident of the flight for Air Traffic Control purposes, when known and * different than ident. */ atc_ident: string | null; /** * Baggage claim location at the destination airport. */ baggage_claim: string | null; /** * Flag indicating whether this flight is blocked from public viewing. */ blocked: boolean; /** * Flag indicating that the flight is no longer being tracked by FlightAware. There * are a number of reasons this could happen including cancellation by the airline, * but that will not always be the case. */ cancelled: boolean; /** * List of any ICAO codeshares operating on this flight. */ codeshares: Array | null; /** * Departure delay (in seconds) based on either actual or estimated gate departure * time. If gate time is unavailable then based on runway departure time. A * negative value indicates the flight is early. */ departure_delay: number | null; /** * Information for this flight's destination airport. */ destination: ScheduledDeparture.Destination | null; /** * Flag indicating whether this flight was diverted. */ diverted: boolean; /** * Estimated gate arrival time. */ estimated_in: string | null; /** * Estimated runway departure time. */ estimated_off: string | null; /** * Estimated runway arrival time. */ estimated_on: string | null; /** * Estimated gate departure time. */ estimated_out: string | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Filed IFR airspeed (knots). */ filed_airspeed: number | null; /** * Filed IFR altitude (100s of feet). */ filed_altitude: number | null; /** * Runway-to-runway filed duration (seconds). */ filed_ete: number | null; /** * Bare flight number of the flight. */ flight_number: string | null; /** * Arrival gate at the destination airport. */ gate_destination: string | null; /** * Departure gate at the origin airport. */ gate_origin: string | null; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * Unique identifier assigned by FlightAware for the previous flight of the * aircraft serving this flight. */ inbound_fa_flight_id: string | null; /** * ICAO code, if exists, of the operator of the flight, otherwise the IATA code */ operator: string | null; /** * IATA code of the operator of the flight. */ operator_iata: string | null; /** * Information for this flight's origin airport. */ origin: ScheduledDeparture.Origin | null; /** * Flag indicating that this flight does not have a flight plan, schedule, or other * indication of intent available. */ position_only: boolean; /** * The percent completion of a flight, based on runway departure/arrival. Null for * en route position-only flights. */ progress_percent: number | null; /** * Aircraft registration (tail number) of the aircraft, when known. */ registration: string | null; /** * The textual description of the flight's route. */ route: string | null; /** * Planned flight distance (statute miles) based on the filed route. May vary from * actual flown distance. */ route_distance: number | null; /** * Scheduled gate arrival time. */ scheduled_in: string | null; /** * Scheduled runway departure time. */ scheduled_off: string | null; /** * Scheduled runway arrival time. */ scheduled_on: string | null; /** * Scheduled gate departure time. */ scheduled_out: string | null; /** * Number of seats in the business class cabin. */ seats_cabin_business: number | null; /** * Number of seats in the coach cabin. */ seats_cabin_coach: number | null; /** * Number of seats in the first class cabin. */ seats_cabin_first: number | null; /** * Human-readable summary of flight status. */ status: string; /** * Arrival terminal at the destination airport. */ terminal_destination: string | null; /** * Departure terminal at the origin airport. */ terminal_origin: string | null; /** * Whether this is a commercial or general aviation flight. */ type: 'General_Aviation' | 'Airline'; /** * Actual departure runway at origin, when known */ actual_runway_off?: string | null; /** * Actual arrival runway at destination, when known */ actual_runway_on?: string | null; /** * List of any IATA codeshares operating on this flight. */ codeshares_iata?: Array | null; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * ICAO code of the operator of the flight. */ operator_icao?: string | null; } export namespace ScheduledDeparture { /** * Information for this flight's destination airport. */ export interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Information for this flight's origin airport. */ export interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } } export interface FlightListToDestinationResponse { flights: Array; /** * Object containing links to related resources. */ links: FlightListToDestinationResponse.Links | null; /** * Number of pages returned */ num_pages: number; } export namespace FlightListToDestinationResponse { export interface Flight { segments: Array; } export namespace Flight { export interface Segment { /** * Actual gate arrival time. */ actual_in: string | null; /** * Actual runway departure time. */ actual_off: string | null; /** * Actual runway arrival time. */ actual_on: string | null; /** * Actual gate departure time. */ actual_out: string | null; /** * Aircraft type will generally be ICAO code, but IATA code will be given when the * ICAO code is not known. */ aircraft_type: string | null; /** * Arrival delay (in seconds) based on either actual or estimated gate arrival * time. If gate time is unavailable then based on runway arrival time. A negative * value indicates the flight is early. */ arrival_delay: number | null; /** * The ident of the flight for Air Traffic Control purposes, when known and * different than ident. */ atc_ident: string | null; /** * Baggage claim location at the destination airport. */ baggage_claim: string | null; /** * Flag indicating whether this flight is blocked from public viewing. */ blocked: boolean; /** * Flag indicating that the flight is no longer being tracked by FlightAware. There * are a number of reasons this could happen including cancellation by the airline, * but that will not always be the case. */ cancelled: boolean; /** * List of any ICAO codeshares operating on this flight. */ codeshares: Array | null; /** * Departure delay (in seconds) based on either actual or estimated gate departure * time. If gate time is unavailable then based on runway departure time. A * negative value indicates the flight is early. */ departure_delay: number | null; /** * Information for this flight's destination airport. */ destination: Segment.Destination | null; /** * Flag indicating whether this flight was diverted. */ diverted: boolean; /** * Estimated gate arrival time. */ estimated_in: string | null; /** * Estimated runway departure time. */ estimated_off: string | null; /** * Estimated runway arrival time. */ estimated_on: string | null; /** * Estimated gate departure time. */ estimated_out: string | null; /** * Unique identifier assigned by FlightAware for this specific flight. If the * flight is diverted, the new leg of the flight will have a duplicate * fa_flight_id. */ fa_flight_id: string; /** * Filed IFR airspeed (knots). */ filed_airspeed: number | null; /** * Filed IFR altitude (100s of feet). */ filed_altitude: number | null; /** * Runway-to-runway filed duration (seconds). */ filed_ete: number | null; /** * Bare flight number of the flight. */ flight_number: string | null; /** * Arrival gate at the destination airport. */ gate_destination: string | null; /** * Departure gate at the origin airport. */ gate_origin: string | null; /** * Either the operator code followed by the flight number for the flight (for * commercial flights) or the aircraft's registration (for general aviation). */ ident: string; /** * Unique identifier assigned by FlightAware for the previous flight of the * aircraft serving this flight. */ inbound_fa_flight_id: string | null; /** * ICAO code, if exists, of the operator of the flight, otherwise the IATA code */ operator: string | null; /** * IATA code of the operator of the flight. */ operator_iata: string | null; /** * Information for this flight's origin airport. */ origin: Segment.Origin | null; /** * Flag indicating that this flight does not have a flight plan, schedule, or other * indication of intent available. */ position_only: boolean; /** * The percent completion of a flight, based on runway departure/arrival. Null for * en route position-only flights. */ progress_percent: number | null; /** * Aircraft registration (tail number) of the aircraft, when known. */ registration: string | null; /** * The textual description of the flight's route. */ route: string | null; /** * Planned flight distance (statute miles) based on the filed route. May vary from * actual flown distance. */ route_distance: number | null; /** * Scheduled gate arrival time. */ scheduled_in: string | null; /** * Scheduled runway departure time. */ scheduled_off: string | null; /** * Scheduled runway arrival time. */ scheduled_on: string | null; /** * Scheduled gate departure time. */ scheduled_out: string | null; /** * Number of seats in the business class cabin. */ seats_cabin_business: number | null; /** * Number of seats in the coach cabin. */ seats_cabin_coach: number | null; /** * Number of seats in the first class cabin. */ seats_cabin_first: number | null; /** * Human-readable summary of flight status. */ status: string; /** * Arrival terminal at the destination airport. */ terminal_destination: string | null; /** * Departure terminal at the origin airport. */ terminal_origin: string | null; /** * Whether this is a commercial or general aviation flight. */ type: 'General_Aviation' | 'Airline'; /** * Actual departure runway at origin, when known */ actual_runway_off?: string | null; /** * Actual arrival runway at destination, when known */ actual_runway_on?: string | null; /** * List of any IATA codeshares operating on this flight. */ codeshares_iata?: Array | null; /** * The IATA operator code followed by the flight number for the flight (for * commercial flights) */ ident_iata?: string | null; /** * The ICAO operator code followed by the flight number for the flight (for * commercial flights) */ ident_icao?: string | null; /** * ICAO code of the operator of the flight. */ operator_icao?: string | null; } export namespace Segment { /** * Information for this flight's destination airport. */ export interface Destination { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } /** * Information for this flight's origin airport. */ export interface Origin { /** * The URL to more information about the airport. Will be null for position-only * flights. */ airport_info_url: string | null; /** * ICAO/IATA/LID code or string indicating the location where tracking of the * flight began/ended for position-only flights. */ code: string | null; /** * Closest city to the airport */ city?: string | null; /** * IATA code */ code_iata?: string | null; /** * ICAO code */ code_icao?: string | null; /** * LID code */ code_lid?: string | null; /** * Common name of airport */ name?: string | null; /** * Applicable timezone for the airport, in the TZ database format */ timezone?: string | null; } } } /** * Object containing links to related resources. */ export interface Links { /** * A link to the next set of records in a collection. */ next: string; } } export interface FlightListParams { /** * Airline to filter flights by. Do not provide airline if type is provided. */ airline?: string; /** * Opaque value used to get the next batch of data from a paged collection. */ cursor?: string; /** * The ending date range for flight results. The format is ISO8601 date or * datetime, and the bound is exclusive. Specified end date must be no further than * 10 days in the past and 2 days in the future. If using date instead of datetime, * the time will default to 00:00:00Z. */ end?: unknown; /** * Maximum number of pages to fetch. This is an upper limit and not a guarantee of * how many pages will be returned. */ max_pages?: number; /** * The starting date range for flight results. The format is ISO8601 date or * datetime, and the bound is inclusive. Specified start date must be no further * than 10 days in the past and 2 days in the future. If using date instead of * datetime, the time will default to 00:00:00Z. */ start?: unknown; /** * Type of flights to return. Do not provide type if airline is provided. */ type?: 'General_Aviation' | 'Airline'; } export interface FlightListArrivalsParams { /** * Airline to filter flights by. Do not provide airline if type is provided. */ airline?: string; /** * Opaque value used to get the next batch of data from a paged collection. */ cursor?: string; /** * The ending date range for flight results. The format is ISO8601 date or * datetime, and the bound is exclusive. Specified end date must be no further than * 10 days in the past and 2 days in the future. If using date instead of datetime, * the time will default to 00:00:00Z. */ end?: unknown; /** * Maximum number of pages to fetch. This is an upper limit and not a guarantee of * how many pages will be returned. */ max_pages?: number; /** * The starting date range for flight results. The format is ISO8601 date or * datetime, and the bound is inclusive. Specified start date must be no further * than 10 days in the past and 2 days in the future. If using date instead of * datetime, the time will default to 00:00:00Z. */ start?: unknown; /** * Type of flights to return. Do not provide type if airline is provided. */ type?: 'General_Aviation' | 'Airline'; } export interface FlightListDeparturesParams { /** * Airline to filter flights by. Do not provide airline if type is provided. */ airline?: string; /** * Opaque value used to get the next batch of data from a paged collection. */ cursor?: string; /** * The ending date range for flight results. The format is ISO8601 date or * datetime, and the bound is exclusive. Specified end date must be no further than * 10 days in the past and 2 days in the future. If using date instead of datetime, * the time will default to 00:00:00Z. */ end?: unknown; /** * Maximum number of pages to fetch. This is an upper limit and not a guarantee of * how many pages will be returned. */ max_pages?: number; /** * The starting date range for flight results. The format is ISO8601 date or * datetime, and the bound is inclusive. Specified start date must be no further * than 10 days in the past and 2 days in the future. If using date instead of * datetime, the time will default to 00:00:00Z. */ start?: unknown; /** * Type of flights to return. Do not provide type if airline is provided. */ type?: 'General_Aviation' | 'Airline'; } export interface FlightListScheduledArrivalsParams { /** * Airline to filter flights by. Do not provide airline if type is provided. */ airline?: string; /** * Opaque value used to get the next batch of data from a paged collection. */ cursor?: string; /** * The ending date range for flight results. The format is ISO8601 date or * datetime, and the bound is exclusive. Specified end date must be no further than * 10 days in the past and 2 days in the future. If using date instead of datetime, * the time will default to 00:00:00Z. */ end?: unknown; /** * Maximum number of pages to fetch. This is an upper limit and not a guarantee of * how many pages will be returned. */ max_pages?: number; /** * The starting date range for flight results. The format is ISO8601 date or * datetime, and the bound is inclusive. Specified start date must be no further * than 10 days in the past and 2 days in the future. If using date instead of * datetime, the time will default to 00:00:00Z. */ start?: unknown; /** * Type of flights to return. Do not provide type if airline is provided. */ type?: 'General_Aviation' | 'Airline'; } export interface FlightListScheduledDeparturesParams { /** * Airline to filter flights by. Do not provide airline if type is provided. */ airline?: string; /** * Opaque value used to get the next batch of data from a paged collection. */ cursor?: string; /** * The ending date range for flight results. The format is ISO8601 date or * datetime, and the bound is exclusive. Specified end date must be no further than * 10 days in the past and 2 days in the future. If using date instead of datetime, * the time will default to 00:00:00Z. */ end?: unknown; /** * Maximum number of pages to fetch. This is an upper limit and not a guarantee of * how many pages will be returned. */ max_pages?: number; /** * The starting date range for flight results. The format is ISO8601 date or * datetime, and the bound is inclusive. Specified start date must be no further * than 10 days in the past and 2 days in the future. If using date instead of * datetime, the time will default to 00:00:00Z. */ start?: unknown; /** * Type of flights to return. Do not provide type if airline is provided. */ type?: 'General_Aviation' | 'Airline'; } export interface FlightListToDestinationParams { /** * Path param: ICAO, IATA or LID ID of destination airport to fetch. * [ICAO is highly preferred](/aeroapi/portal/resources#icaoCode) to prevent * ambiguity. */ id: string; /** * Query param: Whether flights should be filtered based on their connection * status. If setting start/end date parameters then connection must be set to * nonstop, and will default to nonstop if left blank. If start/end are not * specified then leaving this blank will result in a mix of nonstop and one-stop * flights being returned, with a preference for nonstop flights. One-stop flights * are identified with a custom heuristic, which may be incomplete. */ connection?: 'nonstop' | 'onestop'; /** * Query param: Opaque value used to get the next batch of data from a paged * collection. */ cursor?: string; /** * Query param: The ending date range for flight results. The format is ISO8601 * date or datetime, and the bound is exclusive. Specified end date must be no * further than 10 days in the past and 2 days in the future. If using date instead * of datetime, the time will default to 00:00:00Z. */ end?: unknown; /** * Query param: Maximum number of pages to fetch. This is an upper limit and not a * guarantee of how many pages will be returned. */ max_pages?: number; /** * Query param: The starting date range for flight results. The format is ISO8601 * date or datetime, and the bound is inclusive. Specified start date must be no * further than 10 days in the past and 2 days in the future. If using date instead * of datetime, the time will default to 00:00:00Z. */ start?: unknown; /** * Query param: Type of flights to return. */ type?: 'General_Aviation' | 'Airline'; } export declare namespace Flights { export { type FlightListResponse as FlightListResponse, type FlightGetCountsResponse as FlightGetCountsResponse, type FlightListArrivalsResponse as FlightListArrivalsResponse, type FlightListDeparturesResponse as FlightListDeparturesResponse, type FlightListScheduledArrivalsResponse as FlightListScheduledArrivalsResponse, type FlightListScheduledDeparturesResponse as FlightListScheduledDeparturesResponse, type FlightListToDestinationResponse as FlightListToDestinationResponse, type FlightListParams as FlightListParams, type FlightListArrivalsParams as FlightListArrivalsParams, type FlightListDeparturesParams as FlightListDeparturesParams, type FlightListScheduledArrivalsParams as FlightListScheduledArrivalsParams, type FlightListScheduledDeparturesParams as FlightListScheduledDeparturesParams, type FlightListToDestinationParams as FlightListToDestinationParams, }; }