APIFlights

List visible flights

GET
/api/v1/flights

Returns flights in deterministic descending order by flight date, then descending ID. Results are cursor-paginated. Start without a cursor, then pass the returned page.nextCursor value unchanged as cursor to fetch the next page. When page.nextCursor is null, the response is the last page. Cursors are opaque and must not be decoded or constructed by clients.

Authorization

bearerAuth flight.read.own
AuthorizationBearer <token>

Send Authorization: Bearer <credential>. Create API keys in AirTrail Security settings. OAuth clients use authorization code with PKCE S256 and a resource identifier matching /api/v1.

In: header

Scope: flight.read.own

Query Parameters

scope?string

Flight ownership scope.

Default"mine"

Value in

  • "mine"
  • "user"
  • "all"
userId?string

User ID required when scope=user.

limit?integer
Range1 <= value <= 100
Default50
cursor?string

An opaque pagination cursor returned in page.nextCursor. Pass it unchanged to retrieve the next page. Omit it for the first page. A null page.nextCursor means there are no more pages.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/flights"
{  "data": [    {      "id": 0,      "date": "2019-08-24",      "datePrecision": "day",      "departure": "2019-08-24T14:15:22Z",      "arrival": "2019-08-24T14:15:22Z",      "departureScheduled": "2019-08-24T14:15:22Z",      "arrivalScheduled": "2019-08-24T14:15:22Z",      "takeoffScheduled": "2019-08-24T14:15:22Z",      "takeoffActual": "2019-08-24T14:15:22Z",      "landingScheduled": "2019-08-24T14:15:22Z",      "landingActual": "2019-08-24T14:15:22Z",      "duration": 0,      "departureTerminal": "string",      "departureGate": "string",      "arrivalTerminal": "string",      "arrivalGate": "string",      "flightNumber": "string",      "aircraftReg": "string",      "note": "string",      "from": {        "id": 0,        "icao": "string",        "iata": "string",        "name": "string",        "municipality": "string",        "latitude": 0,        "longitude": 0,        "timezone": "string",        "type": "small_airport",        "continent": "AF",        "country": "string"      },      "to": {        "id": 0,        "icao": "string",        "iata": "string",        "name": "string",        "municipality": "string",        "latitude": 0,        "longitude": 0,        "timezone": "string",        "type": "small_airport",        "continent": "AF",        "country": "string"      },      "airline": {        "id": 0,        "name": "string",        "icao": "string",        "iata": "string",        "iconPath": "string"      },      "aircraft": {        "id": 0,        "name": "string",        "icao": "string"      },      "passengers": [        {          "id": 0,          "user": {            "id": "string",            "username": "string",            "displayName": "string"          },          "guestName": "string",          "seat": "window",          "seatNumber": "string",          "seatClass": "economy",          "flightReason": "leisure"        }      ],      "track": {        "pointCount": 0,        "updatedAt": "2019-08-24T14:15:22Z",        "sourceFormat": "string",        "sourceName": "string"      }    }  ],  "page": {    "nextCursor": "string"  }}