sondahub

sondahub / Flights API

Flights: a fake flight booking API

Airports, airlines, two and a half thousand scheduled flights and their bookings — the live-board one.

Fifty real airports, six invented airlines, flights over a two-week window around the seed’s "today" (2026-09-01), and three and a half thousand bookings with passengers and seats. The live stream runs a departures board: flights boarding, departing, delayed and landing. POST a booking and the hub picks a seat. 6,056 records in all, free over REST, GraphQL, OData, gRPC-Web, SOAP, JSON-RPC, Socket.IO, WebSocket and SSE — no key, no signup.

Connect

Base URL
https://api.sondahub.com/v1/flights
OpenAPI 3
https://api.sondahub.com/v1/flights/openapi.json
GraphQL
https://api.sondahub.com/v1/flights/graphql
OData
https://api.sondahub.com/odata/flights/
gRPC-Web
https://api.sondahub.com/grpc/sondahub.flights.v1.FlightsService
.proto
https://api.sondahub.com/v1/flights/flights.proto
SOAP WSDL
https://api.sondahub.com/soap/flights?wsdl
JSON-RPC
https://api.sondahub.com/jsonrpc — flights.getAirport
XML-RPC
https://api.sondahub.com/xmlrpc
WebSocket
wss://api.sondahub.com/v1/flights/ws
SSE
https://api.sondahub.com/v1/flights/events
Socket.IO
https://api.sondahub.com/flights — transports: ['websocket']
The data
airports.json, airlines.json, flights.json, bookings.json

In Sonda: Import → From a URL with the OpenAPI address and the whole API lands as a project, one request per operation with example bodies. No keys, no headers to add. More on each protocol.

Writes stick for whoever carries them. POST, PUT, PATCH and DELETE are validated, run through the real rules and answered as a real server would, and the answer carries X-Sondahub-Session: send that token back and the next request sees your write. The server keeps nothing — without the token the world is the seed again. The examples on this page share one session until you reload. More on sessions.
The API describes itself
curl https://api.sondahub.com/v1/flights

Lists and filters

Every list answers { "data": [...], "meta": { "page", "limit", "total", "pages" } } with X-Total-Count and Link headers (next, prev, first, last). These options work on every collection and every nested route:

OptionMeaningExample
page, limitPaging, 1-based; limit 1–200, default 20. offset works too.?page=3&limit=50
sortComma list of fields, - for descending. Default id here.?sort=-lat,id
field=valueEquals. Booleans as true/false, null for missing.?id=1
_ne _gt _gte _lt _lteNot equal and comparisons, on numbers, dates and strings.?lat_gte=10&lat_lt=100
_likeContains, case-insensitive.?iata_like=an
_inAny of a comma list.?id_in=1,2,3
_nulltrue: missing; false: present.?city_null=true
a.b=valueInside a JSON field, dotted.?passenger.first_name=…
qSearch across the text fields.?q=alpine
fieldsOnly these fields back.?fields=id,iata
expandEmbed related records.?expand=…
paging=cursor, cursorCursor paging: meta gains has_more, next_cursor and prev_cursor. starting_after / ending_before take an id, Stripe-style.?paging=cursor&limit=50
formatThe same answer as CSV, XML, YAML, NDJSON or MessagePack — or ask with Accept.?format=csv

A name that is not a field answers 400 and lists the fields. Writes answer 422 with one line per problem, 404 for a missing id, 405 with an Allow header for a verb a route does not take. Any request also takes chaos, a rate limit, an Idempotency-Key and problem+json errors, and any write a signed webhook.

airports

Airports by IATA code. 50 records — the file, or the airports API page with sample records.

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"

airlines

Carriers. 6 records — the file, or the airlines API page with sample records.

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.
coderequiredstring
namerequiredstring
alliancestring
fleet_sizeint

Relations: flights → the flights whose airline_id is this airline. Use ?expand=flights to embed them, or the nested routes.

Endpoints

GET/v1/flights/airlinesA page, with every filter, sort, search, field and expand option.
POST/v1/flights/airlinesCreate 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/airlines/{id}One record, with an ETag; If-None-Match earns a 304.
PATCH/v1/flights/airlines/{id}Change the fields you send.
PUT/v1/flights/airlines/{id}Replace the record; required fields must all be there.
DELETE/v1/flights/airlines/{id}Answers 200 with what was removed (a real server’s 204 lives at /v1/utils/status/204); gone for the session.
GET/v1/flights/airlines/{id}/flightsIts flights, as a page with all the list options.

Try it

List with a filter
curl "https://api.sondahub.com/v1/flights/airlines?fleet_size_gte=1&limit=3"
One record
curl https://api.sondahub.com/v1/flights/airlines/1
Its flights
curl "https://api.sondahub.com/v1/flights/airlines/1/flights?limit=5"
Create
curl -i -X POST https://api.sondahub.com/v1/flights/airlines \
  -H "Content-Type: application/json" \
  -d '{"code":"SH","name":"A name"}'
Read it back: newest first (send the session token)
curl "https://api.sondahub.com/v1/flights/airlines?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/airlines/1 \
  -H "Content-Type: application/json" \
  -d '{"fleet_size":2}'
Delete the one you created
curl -X DELETE https://api.sondahub.com/v1/flights/airlines/7 \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"

flights

A scheduled flight. Times are ISO with the airport’s UTC offset applied, so a departure reads like the board. Filter by route with ?origin=MIA&destination=EZE, by day with ?departure_date=2026-09-02. 2,500 records — the file, or the flights API page with sample records.

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.
numberrequiredstring
airline_idrequiredint → airlines
originrequiredstringIATA code.
destinationrequiredstring
origin_airport_idint → airports
destination_airport_idint → airports
departure_datedateLocal date at the origin.
scheduled_departurerequireddatetime
scheduled_arrivaldatetime
estimated_departuredatetime
actual_departuredatetime
statusenumscheduled boarding departed in_air landed delayed cancelled diverted
delay_minutesintmin 0
gatestring
terminalstring
aircraftstring
duration_minutesint
distance_kmint
seats_totalint
seats_availableread-onlyint
base_farefloatUSD, economy.

Relations: airline → one airline through airline_id; origin_airport → one airport through origin_airport_id; destination_airport → one airport through destination_airport_id; bookings → the bookings whose flight_id is this flight. Use ?expand=airline,origin_airport,destination_airport,bookings to embed them, or the nested routes.

Endpoints

GET/v1/flights/flightsA page, with every filter, sort, search, field and expand option.
POST/v1/flights/flightsCreate 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/flights/{id}One record, with an ETag; If-None-Match earns a 304.
PATCH/v1/flights/flights/{id}Change the fields you send.
PUT/v1/flights/flights/{id}Replace the record; required fields must all be there.
DELETE/v1/flights/flights/{id}Answers 200 with what was removed (a real server’s 204 lives at /v1/utils/status/204); gone for the session.
GET/v1/flights/flights/{id}/airlineThe airline this record points at.
GET/v1/flights/flights/{id}/origin_airportThe airport this record points at.
GET/v1/flights/flights/{id}/destination_airportThe airport this record points at.
GET/v1/flights/flights/{id}/bookingsIts bookings, as a page with all the list options.

Try it

List with a filter
curl "https://api.sondahub.com/v1/flights/flights?status=boarding&delay_minutes_gte=1&expand=airline&limit=3"
One record
curl https://api.sondahub.com/v1/flights/flights/1?expand=airline
Its bookings
curl "https://api.sondahub.com/v1/flights/flights/1/bookings?limit=5"
Create
curl -i -X POST https://api.sondahub.com/v1/flights/flights \
  -H "Content-Type: application/json" \
  -d '{"number":"SH 1042","airline_id":1,"origin":"MIA","destination":"EZE","scheduled_departure":"2026-09-30T12:00:00Z","status":"scheduled","gate":"D14","aircraft":"A321neo"}'
Read it back: newest first (send the session token)
curl "https://api.sondahub.com/v1/flights/flights?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/flights/1 \
  -H "Content-Type: application/json" \
  -d '{"status":"boarding"}'
Delete the one you created
curl -X DELETE https://api.sondahub.com/v1/flights/flights/2501 \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"

bookings

A seat on a flight. POST {"flight_id","passenger":{...},"cabin"} and the hub assigns a seat and a record locator. Cancel with PATCH {"status":"cancelled"}. 3,500 records — the file, or the bookings API page with sample records.

POST needs passenger.first_name and last_name, refuses cancelled or departed flights and sold-out ones (409), picks a free seat in the cabin when you give none, prices the fare from the flight, and mints a six-character locator. Cancelling gives the seat back.
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.
locatorread-onlystringSix-character record locator, unique.
flight_idrequiredint → flights
passengerrequiredjson { first_name, last_name, email, document? }
seatstringAssigned by the hub on POST when omitted.
cabinenumeconomy premium business first
statusenumconfirmed checked_in boarded cancelled no_show
farefloatmin 0
currencystring
bagsintmin 0, max 5
frequent_flyerstring
special_requestsjson string[]
booked_atdatetime
checked_in_atdatetime

Relations: flight → one flight through flight_id. Use ?expand=flight to embed them, or the nested routes.

Endpoints

GET/v1/flights/bookingsA page, with every filter, sort, search, field and expand option.
POST/v1/flights/bookingsCreate 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/bookings/{id}One record, with an ETag; If-None-Match earns a 304.
PATCH/v1/flights/bookings/{id}Change the fields you send.
PUT/v1/flights/bookings/{id}Replace the record; required fields must all be there.
DELETE/v1/flights/bookings/{id}Answers 200 with what was removed (a real server’s 204 lives at /v1/utils/status/204); gone for the session.
GET/v1/flights/bookings/{id}/flightThe flight this record points at.

Try it

List with a filter
curl "https://api.sondahub.com/v1/flights/bookings?cabin=premium&fare_gte=10&expand=flight&limit=3"
One record
curl https://api.sondahub.com/v1/flights/bookings/1?expand=flight
Create
curl -i -X POST https://api.sondahub.com/v1/flights/bookings \
  -H "Content-Type: application/json" \
  -d '{"flight_id":1,"passenger":{"first_name":"Ada","last_name":"Lovelace","email":"[email protected]"},"seat":"14C","cabin":"economy","status":"confirmed"}'
Read it back: newest first (send the session token)
curl "https://api.sondahub.com/v1/flights/bookings?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/bookings/1 \
  -H "Content-Type: application/json" \
  -d '{"cabin":"premium"}'
Delete the one you created
curl -X DELETE https://api.sondahub.com/v1/flights/bookings/3501 \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"

WebSocket and SSE

The same stream two ways: the world's own activity, one tick a second, generated for your connection alone. Both push JSON text messages; SSE names each one with event: and numbers it with id:. ?topics=a,b narrows either.

TopicWhat arrivesHow often
boardThe departures board: a flight boarding, departing, delayed, landing or cancelled.3 s
bookingsA seat being booked or checked in on a seed flight.6 s
WebSocket
wss://api.sondahub.com/v1/flights/ws?topics=board

> {"type":"hello","api":"flights","topics":[…],"subscribed":[…]}
> {"type":"event","topic":"board","api":"flights","ts":"…","data":{…}}
< {"type":"subscribe","topics":["board"]}   # narrow to some topics
< {"type":"ping"}                            # → {"type":"pong"}
< anything else                             # → echoed back as {"type":"echo"}
Server-Sent Events
curl -N "https://api.sondahub.com/v1/flights/events?topics=board"

retry: 3000
id: 1
event: board
data: {"type":"event","topic":"board",…}

Socket.IO

The namespace /flights on the Socket.IO server at https://api.sondahub.com (path /socket.io/, WebSocket transport): every call over an acknowledgement — getAirport, listAirports and the rest — answered { ok, data } or { ok, error }, and the topics above pushed as events of the same names. Writes keep for the connection, and a session event carries them to the next one. More on the Socket.IO server.

socket.io-client
const s = io('https://api.sondahub.com/flights', { transports: ['websocket'] })
s.on('board', (e) => console.log(e))
const { data } = await s.emitWithAck('getAirport', { id: 1 })

GraphQL

One endpoint, https://api.sondahub.com/v1/flights/graphql: POST {"query", "variables"} or GET ?query=. Introspection is on, so Sonda's GraphQL mode loads the schema; the SDL is a click away. Every collection is a paged query with the same filter, sort and q options as REST (operators as suffixes: price_lt), a by-id query, relation fields both ways, and create, update, replace and delete mutations — simulated like every write, with the note in extensions.

A query
curl https://api.sondahub.com/v1/flights/graphql -H "Content-Type: application/json" -d '{"query": "{ flights(limit: 3, sort: \"-id\", filter: { status: scheduled }) { total data { id number airline_id origin airline { code } bookings(limit: 2) { id } } } }"}'
{
  flights(limit: 3, sort: "-id", filter: { status: scheduled }) {
    total
    data {
      id number airline_id origin
      airline { code }
      bookings(limit: 2) { id }
    }
  }
}

OData

The API is also an OData 4.0 service at https://api.sondahub.com/odata/flights/: its $metadata, an entity set per collection with the relations as navigation properties, the whole $filter language, nested $expand, $count, $search, paging, writes with ETags and $batch. Power BI and Excel read it as an OData feed. More on OData.

airports, OData
curl -G https://api.sondahub.com/odata/flights/airports \
  --data-urlencode "\$top=3" \
  --data-urlencode "\$count=true"

gRPC-Web and Connect

The API is also the protobuf service sondahub.flights.v1.FlightsService, generated from the same registry as REST, so the wire and the docs cannot disagree. The .proto file is one click away; feed it to protoc, buf or your codegen. Calls go to https://api.sondahub.com/grpc/sondahub.flights.v1.FlightsService/{Method} over gRPC-Web (binary or text) or Connect (JSON or binary; GET for reads). Writes keep to the session like every other write. More on gRPC-Web.

MethodWhat
ListAirportsA page of airports: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20).
GetAirportOne airport by id.
CreateAirportCreate a airport (simulated, kept in your session token). id and the timestamps are set by the server.
UpdateAirportChange the fields set in airport (simulated).
DeleteAirportDelete one (simulated); answers what was removed.
ListAirlinesA page of airlines: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20).
ListFlightsA page of flights: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20).
ListBookingsA page of bookings: page, limit, sort, q and filter (field → value, with the REST operator suffixes: price_lt → 20).
Watch
server stream
The API's live activity as a server stream, each topic at its own pace: board (every 3 s), bookings (every 6 s). max_events ends the stream (default 10, at most 120).

Every collection has List, Get, Create, Update and Delete; the table shows them for airports and the lists for the rest.

GetAirport, Connect over GET
curl "https://api.sondahub.com/grpc/sondahub.flights.v1.FlightsService/GetAirport?encoding=json&message=%7B%22id%22%3A1%7D"
ListAirports, Connect JSON
curl -X POST https://api.sondahub.com/grpc/sondahub.flights.v1.FlightsService/ListAirports \
  -H "Content-Type: application/json" \
  -d '{"limit": 3, "sort": "-id"}'

SOAP, JSON-RPC and XML-RPC

The same five calls per collection, the older ways. SOAP: the service described by its WSDL, document/literal over SOAP 1.1 and 1.2, operations like GetAirport, and a twin behind WS-Security at https://api.sondahub.com/soap/secure/flights. JSON-RPC 2.0 at https://api.sondahub.com/jsonrpc and XML-RPC at https://api.sondahub.com/xmlrpc, methods like flights.getAirport. Writes keep to the session like every other write. More on SOAP · more on JSON-RPC and XML-RPC.

flights.getAirport, JSON-RPC
curl https://api.sondahub.com/jsonrpc \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "flights.getAirport", "params": [1]}'
GetAirport, SOAP 1.1
curl https://api.sondahub.com/soap/flights \
  -H "Content-Type: text/xml; charset=utf-8" \
  -H 'SOAPAction: "https://sondahub.com/soap/flights/GetAirport"' \
  -d '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s="https://sondahub.com/soap/flights">
  <soap:Body>
    <s:GetAirport><s:id>1</s:id></s:GetAirport>
  </soap:Body>
</soap:Envelope>'