APIFlights

Get flight statistics

GET
/api/v1/stats

Authorization

bearerAuth stats.read, flight.read.own
headerAuthorizationBearer <API key or OAuth 2.1 access 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.

Scope: stats.read, 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.

Response Body

Statistics.

application/json
  1. response
data*
Example Request
curl -X GET 'https://your-instance.example/api/v1/stats'
Example Response
{  "data": {    "flights": 0,    "distanceKm": 0,    "durationSeconds": 0,    "airports": 0,    "topAirline": {},    "topAirport": {},    "topAircraft": {},    "topRoute": {}  }}