APIStats
Get statistics
Deprecated
GET
Deprecated: This endpoint will be removed in the next major AirTrail release. Migrate to GET /api/v1/stats. Get aggregated statistics for completed flights visible to the authenticated API key. scope=mine requires flight.read.own. scope=user and scope=all require flight.read.any.
bearerAuthheader
AuthorizationBearer <token>Go to Settings -> Security and create a new API key. Use the generated key as the bearer token.
scope?stringWhich flights to aggregate. mine is the default. user and all require flight.read.any.
Default
"mine"Value in
"mine""user""all"userId?stringThe user ID whose statistics should be returned when scope=user.
Aggregated statistics
application/json- response
success?booleanstats?curl -X GET 'https://your-instance.com/api/stats'Example Response
{ "success": true, "stats": { "flights": 0, "distanceKm": 0, "durationSeconds": 0, "airports": 0, "topAirline": { "id": 0, "name": "string", "iata": "string", "icao": "string", "count": 0 }, "topAirport": { "id": 0, "name": "string", "icao": "string", "iata": "string", "count": 0 }, "topAircraft": { "id": 0, "name": "string", "icao": "string", "count": 0 }, "topRoute": { "from": { "id": 0, "name": "string", "icao": "string", "iata": "string" }, "to": { "id": 0, "name": "string", "icao": "string", "iata": "string" }, "count": 0 } }}