Cities, places and recurring schedules
Choose the right endpoint, interpret local times, and page through results.
A city is not a station
A city is a named locality in the routing network. A place is an airport or a station.
A station or airport can group multiple boarding stops, such as a rail platform and a bus
stop. A place can serve several cities, or none. For example, Nice Côte d’Azur Airport
NCE is in France and the network associates it with both Nice and Monaco. An association
does not add a scheduled service or a free transfer between the airport and the city.
Use /v1/cities?q=... to find a network city and /v1/cities/{id} to list its member places.
For example, the Cologne record includes Köln Hbf, Köln Messe/Deutz and Cologne Bonn Airport.
Its optional principal_place marks the primary place, not the full list of places associated
with the city. See meta.from.place_ids or meta.to.place_ids for the places used in a route query.
Use /v1/places?q=... to find a station or airport and /v1/places/{id} to inspect its stops.
| What you have | How to use it |
|---|---|
City ID, such as geonames:2886242 |
Use in /v1/cities/{id} or as a route endpoint. |
Place ID, such as FRA or de:05315:11201 |
Use in /v1/places/{id} or as a route endpoint. Airports use IATA codes; station IDs are strings and can contain colons. |
Stop ID, such as stoparea:17987 at FRA |
Use the stop’s parent place ID for route endpoints. |
Name, such as Tokyo |
Search with q, or pass an unambiguous exact name in from or to. Detail paths take IDs only. |
For route endpoints the API tries canonical IDs first, then exact city names, then exact
place names. Name matching ignores case, normalizes punctuation and folds common Latin accents. q is a search filter, not an endpoint
resolver. Prefer the returned IDs once you have them. If a name returns
ambiguous_endpoint, let the caller choose from
candidates. The API never substitutes a nearby place.
Direct service or dated journey?
/v1/connections?from=...&to=...lists recurring patterns for one ride, with no change. For ground service you can ride through intermediate stops. The API respects boarding and alighting restrictions. City endpoints expand to every member place./v1/destinations?from=...summarizes those direct patterns by destination place, not by city. It doesn’t search for connections that require a change./v1/journeys?from=...&to=...&date=...searches combinations of rides and checks transfer times. A city endpoint starts or ends at one of its stations when the option uses scheduled ground access. An associated airport is not a substitute station. If airport access isn’t known, a flight option may begin or end there. Read the first and last legs to see the actual endpoints.
schedule.runs_on refers to the local boarding day, even if the vehicle started its trip
the night before. Direct connection patterns also give inclusive schedule.valid_from
and schedule.valid_to when known. An omitted bound is not a guarantee of service on
every date. Display schedule.summary for a readable list of the running days.
A connection’s departure_time and arrival_time are wall clocks in their stated IANA
zones, not UTC. Apply arrival_day_offset to the boarding date to find the arrival date
in the arrival clock’s zone. A dated journey gives timestamps with UTC offsets, so compare
those instants rather than subtracting the clocks as strings. See
transfer assumptions.
Operator names and IDs
A ride can list several operators, for example when a through train changes operator
along the way. Use an operator’s id to look it up under /v1/operators/{id}.
A name-only ground operator has no catalogue entry. An airline can have an ID and code but
no display name. An empty operators array means the operator is unknown, not that the
service has none.
Operator names and IDs
A ride can list several operators, for example when a through train changes operator
along the way. Use an operator’s id to look it up under /v1/operators/{id}.
A name-only ground operator has no catalogue entry. An airline can have an ID and code but
no display name. An empty operators array means the operator is unknown, not that the
service has none.
Read pages, not just the first result
Success responses use {data, meta}. A detail request returns one object; a list returns
an array. An empty array means no matches in the answering network for that query and page,
not that the service doesn’t exist. A 404 instead means the requested resource or endpoint
didn’t resolve.
Most lists default to 50 entries per page and accept up to 200. Journeys default to 8 and
accept up to 20. meta.total counts all matches for non-journey lists; journey searches
don’t report a total. Continue with meta.next_cursor or follow the URL in the
Link header with rel="next". Keep the path and filters the same; only the page size
can change. Never decode or construct a cursor. No cursor means there are no more pages.
If you get cursor_expired, discard the partial list and
restart without a cursor so results don’t mix two network versions.