sondahub / Flights API / Airlines
Fake airlines API
6 airlines from the Flights API, a fake flight booking API. Carriers.
Reads with filters, sorting, search and relations; writes that answer like a real server and stay in your session token. Same ids on every build. Free, no key, CORS open.
Connect
- List
- https://api.sondahub.com/v1/flights/airlines
- One record
- https://api.sondahub.com/v1/flights/airlines/{id}
- OpenAPI 3
- https://api.sondahub.com/v1/flights/openapi.json
- GraphQL
- https://api.sondahub.com/v1/flights/graphql
- JSON file
- https://api.sondahub.com/data/flights/airlines.json
- MCP
- https://api.sondahub.com/mcp · list_records
curl "https://api.sondahub.com/v1/flights/airlines?limit=3"
Sample records
Records 1 to 3 of 6, exactly as GET /v1/flights/airlines/{id} answers them. The data file holds all of them.
[
{
"id": 1,
"created_at": "2023-12-06T12:00:00Z",
"updated_at": "2023-12-06T12:00:00Z",
"code": "SH",
"name": "Sondahub Air",
"alliance": null,
"fleet_size": 117
},
{
"id": 2,
"created_at": "2023-12-06T12:00:00Z",
"updated_at": "2023-12-06T12:00:00Z",
"code": "SK",
"name": "Skyway Airlines",
"alliance": null,
"fleet_size": 83
},
{
"id": 3,
"created_at": "2023-12-06T12:00:00Z",
"updated_at": "2023-12-06T12:00:00Z",
"code": "AT",
"name": "Atlas Wings",
"alliance": "Meridian Alliance",
"fleet_size": 192
}
]
Fields
| Field | Type | Notes |
|---|---|---|
idread-only | int | Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. |
created_atread-only | datetime | When the record was created (ISO 8601, UTC). |
updated_atread-only | datetime | When the record last changed. |
coderequired | string | |
namerequired | string | |
alliance | string | |
fleet_size | int |
Relations: flights → the flights whose airline_id is this airline. Use ?expand=flights to embed them, or the nested routes.
Endpoints
Try it
curl "https://api.sondahub.com/v1/flights/airlines?fleet_size_gte=1&limit=3"
curl https://api.sondahub.com/v1/flights/airlines/1
curl "https://api.sondahub.com/v1/flights/airlines/1/flights?limit=5"
curl -i -X POST https://api.sondahub.com/v1/flights/airlines \
-H "Content-Type: application/json" \
-d '{"code":"SH","name":"A name"}'
curl "https://api.sondahub.com/v1/flights/airlines?sort=-id&limit=3" \ -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
curl -X PATCH https://api.sondahub.com/v1/flights/airlines/1 \
-H "Content-Type: application/json" \
-d '{"fleet_size":2}'
curl -X DELETE https://api.sondahub.com/v1/flights/airlines/7 \ -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
Query recipes
Every list option works on airlines; these are ready to paste. All the options.
| What | Request |
|---|---|
| Page 2, 50 at a time (of 6) | /v1/flights/airlines?page=2&limit=50 |
| Fleet size between two values, largest first | /v1/flights/airlines?fleet_size_gte=1&fleet_size_lte=500&sort=-fleet_size |
| Newest first by created at | /v1/flights/airlines?sort=-created_at&limit=5 |
| Code contains “sh” | /v1/flights/airlines?code_like=sh |
| Full-text search | /v1/flights/airlines?q=sh |
| Only some fields | /v1/flights/airlines?fields=id,code&limit=5 |
| Its flights (nested route) | /v1/flights/airlines/1/flights?limit=5 |
| Just the count | /v1/flights/airlines?limit=1&fields=id |
GraphQL
The same airlines as the airlines query on https://api.sondahub.com/v1/flights/graphql, and one airline as airline(id: 1). Introspection is on. More on the GraphQL API.
{
airlines(limit: 3, sort: "-id") {
total
data {
id code name alliance
flights(limit: 2) { id }
}
}
}
curl https://api.sondahub.com/v1/flights/graphql -H "Content-Type: application/json" -d '{"query": "{ airlines(limit: 3, sort: \"-id\") { total data { id code name alliance flights(limit: 2) { id } } } }"}'
From an AI agent (MCP)
The MCP server reaches the same rows with list_records, get_record, create_record, update_record and delete_record, and as the resource sondahub://flights/airlines.
curl https://api.sondahub.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_records","arguments":{"api":"flights","collection":"airlines","limit":3}}}'
More in the Flights API
airports (50) · flights (2,500) · bookings (3,500)
The live streams, and the whole API on one page: Flights API. Other worlds: fake e-commerce API, fake IoT API, fake banking API, fake social media API, fake helpdesk API, fake user directory API.