API reference
Every operation of the API, from its OpenAPI contract.
The base address is https://api.triptopology.com. All operations need an
API key. The OpenAPI 3.1 document
defines every response field. Find the schema names below under components.schemas.
See problem codes for handling errors and
rate limits and quotas for usage headers.
- Search stations and airports
- One station or airport and its stops
- Search supported journey cities
- One city and its places
- Search service operators
- One operator with modes and countries served
- Direct recurring services between two endpoints
- Places directly reachable from an endpoint
- Journey options on a date
Search stations and airports
GET /v1/places
Search by exact ID or by name. Name matching ignores case, normalizes punctuation and folds common Latin accents. Order by match rank, descending service count, then ID. Filters combine with AND.
| Parameter | In | Required | Value |
|---|---|---|---|
q | query | no | Search term, up to 100 characters after trimming. Match an ID or search by name. (string) |
kind | query | no | Filter by transport place kind. (station, airport; Station or airport. An airport can have ground stops.) |
country | query | no | Filter by two uppercase country letters, such as CH. For operators this means a country served. (string) |
bbox | query | no | Inclusive bounds as west,south,east,north in decimal degrees. Longitude is within -180 to 180, latitude within -90 to 90. South must not exceed north. West greater than east crosses the antimeridian. (string) |
limit | query | no | Maximum number of entries to return on this page. (integer; 1 to 200; default 50) |
cursor | query | no | Opaque next_cursor from the previous page of the same query. Keep the path and filters unchanged. (string) |
Responses
| Status | Meaning | Schema |
|---|---|---|
| 200 | Matching stations and airports. | PlaceListResponse |
| 304 | ETag matched If-None-Match. No response body. An admitted request still counts toward usage. | |
| 400 | invalid_parameter. Read detail and correct the missing, malformed, unknown, repeated or out-of-range input. | Error |
| 401 | unauthorized if the bearer header is missing or unusable; invalid_api_key if the key is malformed, unknown, expired or revoked. Correct the credentials before retrying. | Error |
| 409 | cursor_expired. The cursor belongs to a different network. Restart the same query without a cursor. | Error |
| 429 | Only when quota enforcement is on. The per-key minute limit (rate_limit_exceeded) or the account monthly quota (monthly_quota_exceeded) is exhausted. | Error |
| 503 | The network is not loaded (network_unavailable), keys cannot be checked (auth_unavailable), or the meter cannot check usage with quota enforcement on (usage_unavailable). Honor Retry-After and use bounded backoff. | Error |
| Other | RFC 9457 problem details | Error |
One station or airport and its stops
GET /v1/places/{id}
Look up a station or airport by canonical place ID. This path does not resolve names.
| Parameter | In | Required | Value |
|---|---|---|---|
id | path | yes | Canonical place ID, such as BSL or ch:1:sloid:10. (string) |
Responses
| Status | Meaning | Schema |
|---|---|---|
| 200 | The requested transport place and its stored stops. | PlaceResponse |
| 304 | ETag matched If-None-Match. No response body. An admitted request still counts toward usage. | |
| 400 | invalid_parameter. Read detail and correct the missing, malformed, unknown, repeated or out-of-range input. | Error |
| 401 | unauthorized if the bearer header is missing or unusable; invalid_api_key if the key is malformed, unknown, expired or revoked. Correct the credentials before retrying. | Error |
| 404 | not_found. The resource or requested endpoint was not found. No nearby place is substituted. | Error |
| 429 | Only when quota enforcement is on. The per-key minute limit (rate_limit_exceeded) or the account monthly quota (monthly_quota_exceeded) is exhausted. | Error |
| 503 | The network is not loaded (network_unavailable), keys cannot be checked (auth_unavailable), or the meter cannot check usage with quota enforcement on (usage_unavailable). Honor Retry-After and use bounded backoff. | Error |
| Other | RFC 9457 problem details | Error |
Search supported journey cities
GET /v1/cities
Search supported cities by exact ID or by name. Name matching ignores case, normalizes punctuation and folds common Latin accents. Order by match rank, descending GeoNames population, then ID. Filters combine with AND.
| Parameter | In | Required | Value |
|---|---|---|---|
q | query | no | Search term, up to 100 characters after trimming. Match an ID or search by name. (string) |
country | query | no | Filter by two uppercase country letters, such as CH. For operators this means a country served. (string) |
min_population | query | no | Minimum GeoNames city population, inclusive. (integer; 0 to ) |
limit | query | no | Maximum number of entries to return on this page. (integer; 1 to 200; default 50) |
cursor | query | no | Opaque next_cursor from the previous page of the same query. Keep the path and filters unchanged. (string) |
Responses
| Status | Meaning | Schema |
|---|---|---|
| 200 | Matching cities in the routing network. | CityListResponse |
| 304 | ETag matched If-None-Match. No response body. An admitted request still counts toward usage. | |
| 400 | invalid_parameter. Read detail and correct the missing, malformed, unknown, repeated or out-of-range input. | Error |
| 401 | unauthorized if the bearer header is missing or unusable; invalid_api_key if the key is malformed, unknown, expired or revoked. Correct the credentials before retrying. | Error |
| 409 | cursor_expired. The cursor belongs to a different network. Restart the same query without a cursor. | Error |
| 429 | Only when quota enforcement is on. The per-key minute limit (rate_limit_exceeded) or the account monthly quota (monthly_quota_exceeded) is exhausted. | Error |
| 503 | The network is not loaded (network_unavailable), keys cannot be checked (auth_unavailable), or the meter cannot check usage with quota enforcement on (usage_unavailable). Honor Retry-After and use bounded backoff. | Error |
| Other | RFC 9457 problem details | Error |
One city and its places
GET /v1/cities/{id}
Look up a network city by its GeoNames ID. The associated places are not transfers or guaranteed access routes.
| Parameter | In | Required | Value |
|---|---|---|---|
id | path | yes | Canonical GeoNames city ID, such as geonames:2661604. (string) |
Responses
| Status | Meaning | Schema |
|---|---|---|
| 200 | The requested city and its associated places. | CityResponse |
| 304 | ETag matched If-None-Match. No response body. An admitted request still counts toward usage. | |
| 400 | invalid_parameter. Read detail and correct the missing, malformed, unknown, repeated or out-of-range input. | Error |
| 401 | unauthorized if the bearer header is missing or unusable; invalid_api_key if the key is malformed, unknown, expired or revoked. Correct the credentials before retrying. | Error |
| 404 | not_found. The resource or requested endpoint was not found. No nearby place is substituted. | Error |
| 429 | Only when quota enforcement is on. The per-key minute limit (rate_limit_exceeded) or the account monthly quota (monthly_quota_exceeded) is exhausted. | Error |
| 503 | The network is not loaded (network_unavailable), keys cannot be checked (auth_unavailable), or the meter cannot check usage with quota enforcement on (usage_unavailable). Honor Retry-After and use bounded backoff. | Error |
| Other | RFC 9457 problem details | Error |
Search service operators
GET /v1/operators
Search airlines and reviewed ground operators and networks. Ordered by ID. Filter by country served, not by operator domicile.
| Parameter | In | Required | Value |
|---|---|---|---|
q | query | no | Match an exact ID or airline code, or search by full or short operator name. (string) |
country | query | no | Filter by two uppercase country letters, such as CH. For operators this means a country served. (string) |
limit | query | no | Maximum number of entries to return on this page. (integer; 1 to 200; default 50) |
cursor | query | no | Opaque next_cursor from the previous page of the same query. Keep the path and filters unchanged. (string) |
Responses
| Status | Meaning | Schema |
|---|---|---|
| 200 | Matching operators in the catalogue. | OperatorListResponse |
| 304 | ETag matched If-None-Match. No response body. An admitted request still counts toward usage. | |
| 400 | invalid_parameter. Read detail and correct the missing, malformed, unknown, repeated or out-of-range input. | Error |
| 401 | unauthorized if the bearer header is missing or unusable; invalid_api_key if the key is malformed, unknown, expired or revoked. Correct the credentials before retrying. | Error |
| 409 | cursor_expired. The cursor belongs to a different network. Restart the same query without a cursor. | Error |
| 429 | Only when quota enforcement is on. The per-key minute limit (rate_limit_exceeded) or the account monthly quota (monthly_quota_exceeded) is exhausted. | Error |
| 503 | The network is not loaded (network_unavailable), keys cannot be checked (auth_unavailable), or the meter cannot check usage with quota enforcement on (usage_unavailable). Honor Retry-After and use bounded backoff. | Error |
| Other | RFC 9457 problem details | Error |
One operator with modes and countries served
GET /v1/operators/{id}
Look up a catalogue entry using the ID returned in an operator search or operator reference. A name-only reference has no detail resource.
| Parameter | In | Required | Value |
|---|---|---|---|
id | path | yes | Canonical operator ID, such as air:W4 or ground:ch:sbb. (string) |
Responses
| Status | Meaning | Schema |
|---|---|---|
| 200 | The requested operator. | OperatorResponse |
| 304 | ETag matched If-None-Match. No response body. An admitted request still counts toward usage. | |
| 400 | invalid_parameter. Read detail and correct the missing, malformed, unknown, repeated or out-of-range input. | Error |
| 401 | unauthorized if the bearer header is missing or unusable; invalid_api_key if the key is malformed, unknown, expired or revoked. Correct the credentials before retrying. | Error |
| 404 | not_found. The resource or requested endpoint was not found. No nearby place is substituted. | Error |
| 429 | Only when quota enforcement is on. The per-key minute limit (rate_limit_exceeded) or the account monthly quota (monthly_quota_exceeded) is exhausted. | Error |
| 503 | The network is not loaded (network_unavailable), keys cannot be checked (auth_unavailable), or the meter cannot check usage with quota enforcement on (usage_unavailable). Honor Retry-After and use bounded backoff. | Error |
| Other | RFC 9457 problem details | Error |
Direct recurring services between two endpoints
GET /v1/connections
Each city resolves to its ordered main places, with shared airports and local member queries using the other listed places where available. Returns directed, date-free service patterns, not dated departures. Identical patterns collapse; differing times, periods or other public fields remain separate. Ground services include every allowed downstream alighting place on the same ride, even with intermediate stops. Ordered by origin place ID, destination place ID, then pattern content.
| Parameter | In | Required | Value |
|---|---|---|---|
from | query | yes | Origin city ID, place ID or unambiguous exact name. For a name, city matches take precedence over place matches. (string) |
to | query | yes | Destination city ID, place ID or unambiguous exact name. For a name, city matches take precedence over place matches. (string) |
limit | query | no | Maximum number of entries to return on this page. (integer; 1 to 200; default 50) |
cursor | query | no | Opaque next_cursor from the previous page of the same query. Keep the path and filters unchanged. (string) |
Responses
| Status | Meaning | Schema |
|---|---|---|
| 200 | Matching direct recurring service patterns. | ConnectionListResponse |
| 304 | ETag matched If-None-Match. No response body. An admitted request still counts toward usage. | |
| 400 | invalid_parameter. Read detail and correct the missing, malformed, unknown, repeated or out-of-range input. | Error |
| 401 | unauthorized if the bearer header is missing or unusable; invalid_api_key if the key is malformed, unknown, expired or revoked. Correct the credentials before retrying. | Error |
| 404 | not_found. The resource or requested endpoint was not found. No nearby place is substituted. | Error |
| 409 | cursor_expired if the network changed; restart without a cursor. For ambiguous_endpoint pick an ID from candidates and retry. | Error |
| 429 | Only when quota enforcement is on. The per-key minute limit (rate_limit_exceeded) or the account monthly quota (monthly_quota_exceeded) is exhausted. | Error |
| 503 | The network is not loaded (network_unavailable), keys cannot be checked (auth_unavailable), or the meter cannot check usage with quota enforcement on (usage_unavailable). Honor Retry-After and use bounded backoff. | Error |
| Other | RFC 9457 problem details | Error |
Places directly reachable from an endpoint
GET /v1/destinations
A city resolves to its ordered main places. Returns one entry per directly reachable place, not per city. Each entry summarizes the modes, operators and distinct service patterns to that place. No date filter. Ordered by destination place ID.
| Parameter | In | Required | Value |
|---|---|---|---|
from | query | yes | Origin city ID, place ID or unambiguous exact name. For a name, city matches take precedence over place matches. (string) |
limit | query | no | Maximum number of entries to return on this page. (integer; 1 to 200; default 50) |
cursor | query | no | Opaque next_cursor from the previous page of the same query. Keep the path and filters unchanged. (string) |
Responses
| Status | Meaning | Schema |
|---|---|---|
| 200 | Places directly reachable from the resolved origin. | DestinationListResponse |
| 304 | ETag matched If-None-Match. No response body. An admitted request still counts toward usage. | |
| 400 | invalid_parameter. Read detail and correct the missing, malformed, unknown, repeated or out-of-range input. | Error |
| 401 | unauthorized if the bearer header is missing or unusable; invalid_api_key if the key is malformed, unknown, expired or revoked. Correct the credentials before retrying. | Error |
| 404 | not_found. The resource or requested endpoint was not found. No nearby place is substituted. | Error |
| 409 | cursor_expired if the network changed; restart without a cursor. For ambiguous_endpoint pick an ID from candidates and retry. | Error |
| 429 | Only when quota enforcement is on. The per-key minute limit (rate_limit_exceeded) or the account monthly quota (monthly_quota_exceeded) is exhausted. | Error |
| 503 | The network is not loaded (network_unavailable), keys cannot be checked (auth_unavailable), or the meter cannot check usage with quota enforcement on (usage_unavailable). Honor Retry-After and use bounded backoff. | Error |
| Other | RFC 9457 problem details | Error |
Journey options on a date
GET /v1/journeys
Search recurring schedules on an origin-local date. The window bounds the required journey start, including initial allowances, not necessarily the first ride departure. Options trade off later starts against earlier finishes. The search compares absolute times across zones. A city resolves to its ordered main places. Preferred places break otherwise equal routing ties. Verify schedule and availability before booking. Paging preserves the same window.
| Parameter | In | Required | Value |
|---|---|---|---|
from | query | yes | Origin city ID, place ID or unambiguous exact name. For a name, city matches take precedence over place matches. (string) |
to | query | yes | Destination city ID, place ID or unambiguous exact name. For a name, city matches take precedence over place matches. (string) |
date | query | yes | Origin-local date in YYYY-MM-DD. The router applies each ride's recurrence and known validity at boarding. (string) |
depart_after | query | no | Earliest required journey start in origin-local HH:MM. This includes any initial walk or airport allowance. (string; default 00:00) |
depart_before | query | no | Latest required journey start in origin-local HH:MM. Use 24:00 for the next midnight. Must not precede depart_after. (string; default 24:00) |
max_hours | query | no | Maximum elapsed time from journey start to end, in whole hours, including transfers and access allowances. (integer; 1 to 72; default 30) |
modes | query | no | Use all to include flights, or ground to exclude them. This is not a per-mode filter. (all, ground; default all) |
limit | query | no | Maximum number of entries to return on this page. (integer; 1 to 20; default 8) |
cursor | query | no | Opaque next_cursor from the previous page of the same query. Keep the path and filters unchanged. (string) |
Responses
| Status | Meaning | Schema |
|---|---|---|
| 200 | Page of dated journey options, in start-time order. | JourneyResponse |
| 304 | ETag matched If-None-Match. No response body. An admitted request still counts toward usage. | |
| 400 | invalid_parameter. Read detail and correct the missing, malformed, unknown, repeated or out-of-range input. | Error |
| 401 | unauthorized if the bearer header is missing or unusable; invalid_api_key if the key is malformed, unknown, expired or revoked. Correct the credentials before retrying. | Error |
| 404 | not_found. The resource or requested endpoint was not found. No nearby place is substituted. | Error |
| 409 | cursor_expired if the network changed; restart without a cursor. For ambiguous_endpoint pick an ID from candidates and retry. | Error |
| 429 | Only when quota enforcement is on. The per-key minute limit (rate_limit_exceeded) or the account monthly quota (monthly_quota_exceeded) is exhausted. | Error |
| 500 | internal_error. Journey search could not complete. Retry once; if it persists, report the query. | Error |
| 503 | The network is not loaded (network_unavailable), keys cannot be checked (auth_unavailable), the meter cannot check usage with quota enforcement on (usage_unavailable), or all journey search slots are occupied (journey_search_busy). Honor Retry-After and use bounded backoff. | Error |
| Other | RFC 9457 problem details | Error |