APIFlights
Get flight statistics
Authorization
bearerAuth stats.read, flight.read.ownAuthorizationBearer <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: 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
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/stats"{ "data": { "flights": 0, "distanceKm": 0, "durationSeconds": 0, "airports": 0, "topAirline": {}, "topAirport": {}, "topAircraft": {}, "topRoute": {} }}