Skip to content
Documentation

Interline Routing Platform

Last updated

The Interline Routing Platform combines two complementary routing engines behind one API and one key.

  • Transit routing comes from the Transitland Routing API, built on the platform's continuously updated archive of GTFS feeds.
  • Street routing (auto, bicycle, and pedestrian) comes from Valhalla, an open-source engine running against OpenStreetMap data.

Together they cover a whole journey: walking, cycling, or driving to a stop, riding transit, and walking to a destination.

Transit itinerary legs include Onestop IDs that resolve through the REST and GraphQL APIs, and the SHA1 of the feed version the schedule came from. See Journeys and itineraries. For departures from a single stop, use the REST API stop departures endpoint.

Endpoints

EndpointWhat it does
Transit routingTransit and walking itineraries, OpenTripPlanner-compatible
Street routingTurn-by-turn directions for auto, bicycle, and pedestrian
Optimized routeVisit several locations in the most efficient order
MatrixTimes and distances between many origins and destinations
IsochroneAreas reachable within a time or distance limit
Map matchingSnap a GPS trace to the road network as a route
Trace attributesRoad attributes along a matched trace
LocateWhat the network looks like near a coordinate
ExpansionWhich edges a search explored, as GeoJSON
CentroidWhere routes from several locations converge

API access

All Interline Routing Platform endpoints are hosted under:

https://transit.land/api/v2/routing/

Authentication uses the same API key mechanism as other Transitland APIs. Pass your key as the apikey query parameter or the apikey HTTP header; api_key, api_token, and access_token are accepted equivalently.

Street routing endpoints accept the same request object either way: POST sends it as a JSON body, and GET sends it url-encoded in a json query parameter.

For GET requests, encode spaces in the json parameter as %20 , or send JSON without spaces. The API does not decode + as a space and rejects the request as unparseable. curl --data-urlencode encodes spaces as %20 .

How the routing works

Two graphs back these endpoints: a street graph built from OpenStreetMap and rebuilt about daily, and a transit graph built from Transitland's GTFS archive and updated within minutes of a new feed version. Because the graphs are separate, transit routing is its own endpoint and its coverage differs from street routing.

Street routing endpoints take a costing parameter that selects the travel model (auto, bicycle, pedestrian, truck, and others). Costing options are set per request.

See Routing graph and costing models for the costing table, and Journeys and itineraries for transit routing results.

Machine-readable schema

The platform publishes an OpenAPI 3.0 description covering both engines:

https://transit.land/api/v2/routing/openapi.json
The schema document itself is served without an API key, so you can fetch it and point tooling at it before signing up. The endpoints it describes still require a key.

Every endpoint page in this section is generated from that document. API clients, code generators, and coding agents can use the URL directly.

The street routing endpoints are also described on their own, for tools that want them alone:

https://transit.land/api/v2/routing/valhalla/openapi.json