Skip to main content

Usage

Connection#

The following curl command connects to the Flights Live endpoint, retrieves real-time in UTC for the specified ICAO address and prints the received data to the console.

curl -H "Authorization: Bearer <your_token>" "https://api.airsafe.spire.com/v2/flights/live?icao_address=896497"

Query Parameters#

The following parameters can be specified to retrieve real-time data with more accuracy.

Query ParametersTypeDescription
flight_idIDSpire internal unique flight ID
icao_addressstringHexadecimal representation of ICAO 24 – bit address
callsignstringCall sign
flight_numberstringFlight number (IATA format)
tail_numberstringAircraft registration
aircraft_typestringIATA/ICAO aircraft type code
aircraft_rolestringAircraft role e.g. PAX
airlinestringIATA/ICAO airline code
departure_airportstringIATA/ICAO departure airport code
arrival_airportstringIATA/ICAO arrival airport code
operating_airportstringIATA/ICAO airport code for all inbound and outbound flights
flight_statestringFlight state as one of "ON_GROUND","AIRBORNE","LANDED","POST_FLIGHT"
page_cursorstringPage cursor to retrieve data from following pages

Pagination#

Pagination is enforced in this endpoint. Whenever a next page is available, you will receive a cursor in the pagination object. Subsequent request should include a page_cursor=<previous_cursor_value> as a query parameter.

Pagination output sample#

An example pagination response with next page(s) available:

{
...
"pagination": {
"total_count": 15000,
"count": 10000,
"cursor": "MTY3NTEyOT...jI4Yzg5NA"
}
}

An example request to retrieve data from next page:

curl -H "Authorization: Bearer <your_token>" "https://api.airsafe.spire.com/v2/flights/live?page_cursor=MTY3NTEyOT...jI4Yzg5NA"