sondahub

sondahub / Flights API / Airports

Fake airports API

50 airports from the Flights API, a fake flight booking API. Airports by IATA code.

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/airports
One record
https://api.sondahub.com/v1/flights/airports/{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/airports.json
MCP
https://api.sondahub.com/mcp · list_records
The first three airports
curl "https://api.sondahub.com/v1/flights/airports?limit=3"

Sample records

Records 1 to 3 of 50, exactly as GET /v1/flights/airports/{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",
    "iata": "MIA",
    "name": "Miami International",
    "city": "Miami",
    "country": "US",
    "timezone": "America/New_York",
    "lat": 25.7617,
    "lon": -80.1918,
    "terminals": 5
  },
  {
    "id": 2,
    "created_at": "2023-12-06T12:00:00Z",
    "updated_at": "2023-12-06T12:00:00Z",
    "iata": "JFK",
    "name": "John F. Kennedy International",
    "city": "New York",
    "country": "US",
    "timezone": "America/New_York",
    "lat": 40.7128,
    "lon": -74.006,
    "terminals": 3
  },
  {
    "id": 3,
    "created_at": "2023-12-06T12:00:00Z",
    "updated_at": "2023-12-06T12:00:00Z",
    "iata": "LAX",
    "name": "Los Angeles International",
    "city": "Los Angeles",
    "country": "US",
    "timezone": "America/Los_Angeles",
    "lat": 34.0522,
    "lon": -118.2437,
    "terminals": 5
  }
]

Fields

FieldTypeNotes
idread-onlyintAssigned by the server. Seed records keep their ids across restarts; records you create continue after the seed.
created_atread-onlydatetimeWhen the record was created (ISO 8601, UTC).
updated_atread-onlydatetimeWhen the record last changed.
iatarequiredstring
namerequiredstring
citystring
countrystring
timezonestring
latfloat
lonfloat
terminalsint

Endpoints

GET/v1/flights/airportsA page, with every filter, sort, search, field and expand option.
POST/v1/flights/airportsCreate one: 201 with the record, its id, a Location header and the session token that keeps it; 422 names each field that is wrong.
GET/v1/flights/airports/{id}One record, with an ETag; If-None-Match earns a 304.
PATCH/v1/flights/airports/{id}Change the fields you send.
PUT/v1/flights/airports/{id}Replace the record; required fields must all be there.
DELETE/v1/flights/airports/{id}Answers 200 with what was removed (a real server’s 204 lives at /v1/utils/status/204); gone for the session.

Try it

List with a filter
curl "https://api.sondahub.com/v1/flights/airports?lat_gte=10&limit=3"
One record
curl https://api.sondahub.com/v1/flights/airports/1
Create
curl -i -X POST https://api.sondahub.com/v1/flights/airports \
  -H "Content-Type: application/json" \
  -d '{"iata":"MIA","name":"A name","country":"US"}'
Read it back: newest first (send the session token)
curl "https://api.sondahub.com/v1/flights/airports?sort=-id&limit=3" \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
Change one field
curl -X PATCH https://api.sondahub.com/v1/flights/airports/1 \
  -H "Content-Type: application/json" \
  -d '{"lat":42.5}'
Delete the one you created
curl -X DELETE https://api.sondahub.com/v1/flights/airports/51 \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"

Query recipes

Every list option works on airports; these are ready to paste. All the options.

WhatRequest
Page 2, 50 at a time (of 50)/v1/flights/airports?page=2&limit=50
Lat between two values, largest first/v1/flights/airports?lat_gte=1&lat_lte=500&sort=-lat
Newest first by created at/v1/flights/airports?sort=-created_at&limit=5
Iata contains “mia”/v1/flights/airports?iata_like=mia
Full-text search/v1/flights/airports?q=mia
Only some fields/v1/flights/airports?fields=id,iata&limit=5
Just the count/v1/flights/airports?limit=1&fields=id

GraphQL

The same airports as the airports query on https://api.sondahub.com/v1/flights/graphql, and one airport as airport(id: 1). Introspection is on. More on the GraphQL API.

{
  airports(limit: 3, sort: "-id") {
    total
    data {
      id iata name city
    }
  }
}
Run it
curl https://api.sondahub.com/v1/flights/graphql -H "Content-Type: application/json" -d '{"query": "{ airports(limit: 3, sort: \"-id\") { total data { id iata name city } } }"}'

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/airports.

tools/call
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":"airports","limit":3}}}'

More in the Flights API

airlines (6) · 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.