Routing API provides a way to plan itineraries and query public transportation related information about stops and timetables using GraphQL.
If you are not familiar with GraphQL, start by reading the GraphQL page.
It is also recommended to try building queries and exploring the schema in GraphiQL.
Real-time arrival prediction page has information about the real-time data available in the API.
Glossary page has explanations for terms commonly used in the API.
After this, you are ready to run queries for routes, stops, city bikes and bicycling routes, disruption info and do itinerary planning.
The routing API for Helsinki region is available at:https://api.digitransit.fi/routing/v1/routers/hsl/index/graphql
The routing API for the Waltti regions is available at:https://api.digitransit.fi/routing/v1/routers/waltti/index/graphql
The routing API for Finland as a whole is available at:https://api.digitransit.fi/routing/v1/routers/finland/index/graphql
When sending queries, there are some things you should be aware of:
The HTTP method must be POST
You will get a HTTP 405 error when using other methods.
Content-Type must be either "application/graphql" or "application/json"
You will get a HTTP 415 Error if this header is not present.
Term | Explanation |
---|---|
GraphQL | A query language for APIs and a runtime for fulfilling those queries with your existing data. |
GraphiQL | A simple UI for making GraphQL queries. You can use it both to run queries and to explore the GraphQL schema. |
Realtime arrival prediction | API queries can return real-time data for some vehicles. We know the vehicle's planned route and its current location. This information is used to predict when it actually arrives. |