{"componentChunkName":"component---src-templates-developers-js","path":"/en/developers/architecture/x-apis/1-routing-api/","result":{"data":{"childPages":{"edges":[{"node":{"fields":{"slug":"/en/developers/"},"frontmatter":{"title":"For developers","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/architecture/"},"frontmatter":{"title":"System architecture","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/api-registration/"},"frontmatter":{"title":"API portal and registration","order":-12,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/changes/"},"frontmatter":{"title":"Changes","order":-10,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/user-interfaces/"},"frontmatter":{"title":"User interfaces","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/deprecations/"},"frontmatter":{"title":"Deprecations","order":-11,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/docker-guide/"},"frontmatter":{"title":"Docker guide","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/"},"frontmatter":{"title":"APIs","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/"},"frontmatter":{"title":"Routing API","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/2-routing-data-api/"},"frontmatter":{"title":"Routing data API","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/4-map-api/"},"frontmatter":{"title":"Map API","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/architecture/x-apis/"},"frontmatter":{"title":"API architecture","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/6-api-faq/"},"frontmatter":{"title":"FAQ","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/5-realtime-api/"},"frontmatter":{"title":"Realtime APIs","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/3-geocoding-api/"},"frontmatter":{"title":"Geocoding API","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/7-terms-of-use/"},"frontmatter":{"title":"Terms of use","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/user-interfaces/1-digitransit-ui/"},"frontmatter":{"title":"Digitransit-ui","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/0-graphql/"},"frontmatter":{"title":"GraphQL","order":10,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/3-realtime-information/"},"frontmatter":{"title":"Real-time information","order":40,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/2-glossary/"},"frontmatter":{"title":"Glossary","order":30,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/canceled-trips/"},"frontmatter":{"title":"Canceled trips","order":80,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/disruption-info/"},"frontmatter":{"title":"Disruption info","order":70,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/4-translations/"},"frontmatter":{"title":"Translation","order":50,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/routes/"},"frontmatter":{"title":"Routes","order":100,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/stops/"},"frontmatter":{"title":"Stops","order":110,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/bicycles-scooters-cars/"},"frontmatter":{"title":"Bicycles, cars and e-scooters","order":60,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/itinerary-planning/"},"frontmatter":{"title":"Itinerary planning","order":90,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/architecture/x-apis/1-routing-api/"},"frontmatter":{"title":"Routing API","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/architecture/x-apis/2-routing-data-api/"},"frontmatter":{"title":"Routing Data","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/architecture/x-apis/4-map-api/"},"frontmatter":{"title":"Map API","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/architecture/x-apis/5-realtime-api/"},"frontmatter":{"title":"Real-time APIs","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/architecture/x-apis/3-geocoding-api/"},"frontmatter":{"title":"Geocoding API","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/1-routing-api/1-graphiql/"},"frontmatter":{"title":"GraphiQL","order":20,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/4-map-api/background-map/"},"frontmatter":{"title":"Background map","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/5-realtime-api/1-getting-started/"},"frontmatter":{"title":"Getting started","order":10,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/3-geocoding-api/address-search/"},"frontmatter":{"title":"Address search","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/3-geocoding-api/autocomplete/"},"frontmatter":{"title":"Autocomplete","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/5-realtime-api/trip-updates/"},"frontmatter":{"title":"Trip updates","order":30,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/5-realtime-api/service-alerts/"},"frontmatter":{"title":"Service alerts","order":20,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/3-geocoding-api/address-lookup/"},"frontmatter":{"title":"Address lookup","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/4-map-api/pois/"},"frontmatter":{"title":"Points of interest","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/5-realtime-api/vehicle-positions/"},"frontmatter":{"title":"Vehicle positions","order":40,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/architecture/x-apis/3-geocoding-api/data-container/"},"frontmatter":{"title":"Data builder and container","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/architecture/x-apis/3-geocoding-api/api/"},"frontmatter":{"title":"API","order":null,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/5-realtime-api/vehicle-positions/high-frequency-positioning/"},"frontmatter":{"title":"High-frequency positioning","order":20,"redirect":null}}},{"node":{"fields":{"slug":"/en/developers/apis/5-realtime-api/vehicle-positions/digitransit-mqtt/"},"frontmatter":{"title":"Digitransit MQTT broker","order":10,"redirect":null}}}]},"markdownRemark":{"fields":{"slug":"/en/developers/architecture/x-apis/1-routing-api/"},"frontmatter":{"title":"Routing API","redirect":null,"toc":null,"description":{"info":"Routing API enables developers to query routes and timetable related information through a GraphQL interface.","architecture":"https://raw.githubusercontent.com/HSLdevcom/digitransit-site/master/src/pages/en/developers/architecture/x-apis/1-routing-api/architecture.xml"},"assets":[{"title":"source","url":"https://github.com/HSLdevcom/OpenTripPlanner"},{"title":"DockerHub","url":"https://hub.docker.com/r/hsldevcom/opentripplanner/"}],"technologies":[{"title":"GTFS-RT","url":"https://gtfs.org/documentation/realtime/reference/"},{"title":"GTFS","url":"https://gtfs.org/documentation/schedule/reference/"},{"title":"GBFS","url":"https://gbfs.org/"},{"title":"Java","url":null}],"docker":{"dockerfile":null,"imageName":"hsldevcom/opentripplanner:v2-prod","buildScript":null,"runContainer":"docker run --rm -p 9080:8080 -e JAVA_OPTS=-Xmx10g -v ./hsl/:/var/opentripplanner hsldevcom/opentripplanner:v2-prod --load --serve","accessContainer":"http://localhost:9080/"}},"html":"<p>Routing API is implemented using OpenTripPlanner.</p>\n<blockquote>\n<p><a href=\"https://www.opentripplanner.org/\">https://www.opentripplanner.org/</a></p>\n</blockquote>\n<p>Details on how static data is included in our OpenTripPlanner instances can be found <a href=\"../2-routing-data-api/\">here</a>.</p>\n<h2 id=\"static-and-realtime-information\" style=\"position:relative;\"><a href=\"#static-and-realtime-information\" aria-label=\"static and realtime information permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Static and realtime information</h2>\n<p>OpenTripPlanner APIs provide access to static and realtime routing and transit information.\nRouting and timetable data is based on static GTFS and it is enriched by realtime information for those departures that have realtime information available. This means that results returned by OpenTripPlanner always contain realtime information should it be\navailable.</p>\n<h2 id=\"hosting-the-api-locally\" style=\"position:relative;\"><a href=\"#hosting-the-api-locally\" aria-label=\"hosting the api locally permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Hosting the API locally</h2>\n<p>If you need to make a large amount of requests (e.g. requesting schedules from all stops) to the API, you might want to host the API locally.\nTo run OpenTripPlanner with Docker, you first need to download the required graph and configuration. The following instructions are for\nrunning OTP with HSL data, but by changing <code class=\"language-text\">hsl</code> in the instructions to any of the other available <a href=\"../../../apis/1-routing-api/#endpoints\">endpoints</a>,\nit's possible to follow the same flow. The required files are available at <code class=\"language-text\">https://api.digitransit.fi/routing-data/v3/hsl/?digitransit-subscription-key=&lt;subscription key></code>.\nThe only file that needs to be downloaded is <code class=\"language-text\">graph-hsl-&lt;commit hash>.zip</code>. That file should be unzipped and then the directory can be mounted as\na volume for running OTP with the following command:\n<code class=\"language-text\">docker run --rm -p 9080:8080 -e JAVA_OPTS=-Xmx10g -v ./hsl/:/var/opentripplanner hsldevcom/opentripplanner:v2-prod --load --serve</code></p>\n<p>The GraphQL API can be accessed from <code class=\"language-text\">http://localhost:9080/otp/gtfs/v1</code> and a local GraphiQL UI from <code class=\"language-text\">http://localhost:9080/graphiql</code>.</p>\n<p><strong>Note:</strong> The data and OTP version need to be compatible. This can be validated by running <code class=\"language-text\">docker run --rm hsldevcom/opentripplanner:v2-prod --version</code>. OTP's commit version should match the commit hash from the graph zip's name.</p>\n<p><strong>Note:</strong> Some of the real-time updaters are configured by default to fetch data from a local instance of a <code class=\"language-text\">digitransit-proxy</code> which will lead to errors. However, the use of proxy is often not necessary. This can be circumvented by removing <code class=\"language-text\">digitransit-proxy:8080/out/</code> from the URLs inside <code class=\"language-text\">updaters</code> section of the <code class=\"language-text\">router-config.json</code> file that is located in the graph directory. The server needs to be restarted after this file is edited.</p>\n<h2 id=\"api-documentation\" style=\"position:relative;\"><a href=\"#api-documentation\" aria-label=\"api documentation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>API Documentation</h2>\n<p>OpenTripPlanner has multiple APIs but currently we only expose the GTFS GraphQL API version 1. Even though the version is called 1, it's a newer version\nof the GraphQL API we had available in our <code class=\"language-text\">/routing/v1</code> API.</p>\n<h3 id=\"gtfs-graphql-api-v1\" style=\"position:relative;\"><a href=\"#gtfs-graphql-api-v1\" aria-label=\"gtfs graphql api v1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>GTFS GraphQL API v1</h3>\n<p>We expose 5 different version of this API to users with different data sets and configurations in use. There is documentation about this API in our <a href=\"../../../apis/1-routing-api/0-graphql/\">routing API documentation page</a>.</p>\n<h2 id=\"related-links\" style=\"position:relative;\"><a href=\"#related-links\" aria-label=\"related links permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Related links</h2>\n<table>\n<thead>\n<tr>\n<th>URL</th>\n<th>Project description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><a href=\"https://github.com/opentripplanner/OpenTripPlanner\">https://github.com/opentripplanner/OpenTripPlanner</a></td>\n<td>OpenTripPlanner upstream development on GitHub</td>\n</tr>\n<tr>\n<td><a href=\"https://app.gitter.im/#/room/#opentripplanner_OpenTripPlanner:gitter.im\">https://app.gitter.im/#/room/#opentripplanner_OpenTripPlanner:gitter.im</a></td>\n<td>OpenTripPlanner Gitter room</td>\n</tr>\n<tr>\n<td><a href=\"https://gtfs.org/\">https://gtfs.org/</a></td>\n<td>Home page for the GTFS data standard</td>\n</tr>\n<tr>\n<td><a href=\"https://gbfs.org/\">https://gbfs.org/</a></td>\n<td>Home page for the GBFS data standard</td>\n</tr>\n<tr>\n<td><a href=\"https://onebusaway.org/\">https://onebusaway.org/</a></td>\n<td>OneBusAway: The Open Source platform for Real Time Transit Info</td>\n</tr>\n<tr>\n<td><a href=\"https://github.com/OneBusAway?utf8=%E2%9C%93&#x26;query=gtfs\">https://github.com/OneBusAway?utf8=✓&#x26;query=gtfs</a></td>\n<td>GTFS related projects: Open-source transit app for real-time information</td>\n</tr>\n<tr>\n<td><a href=\"https://github.com/conveyal/r5\">https://github.com/conveyal/r5</a></td>\n<td>Conveyal R5 development on GitHub: Rapid Realistic Routing on Real-world and Reimagined networks</td>\n</tr>\n<tr>\n<td><a href=\"https://blog.conveyal.com/\">https://blog.conveyal.com/</a></td>\n<td>Conveyal blog</td>\n</tr>\n</tbody>\n</table>","tableOfContents":"<ul>\n<li><a href=\"/en/developers/architecture/x-apis/1-routing-api/#static-and-realtime-information\">Static and realtime information</a></li>\n<li><a href=\"/en/developers/architecture/x-apis/1-routing-api/#hosting-the-api-locally\">Hosting the API locally</a></li>\n<li>\n<p><a href=\"/en/developers/architecture/x-apis/1-routing-api/#api-documentation\">API Documentation</a></p>\n<ul>\n<li><a href=\"/en/developers/architecture/x-apis/1-routing-api/#gtfs-graphql-api-v1\">GTFS GraphQL API v1</a></li>\n</ul>\n</li>\n<li><a href=\"/en/developers/architecture/x-apis/1-routing-api/#related-links\">Related links</a></li>\n</ul>","excerpt":"Routing API is implemented using OpenTripPlanner. https://www.opentripplanner.org/ Details on how static data is included in our OpenTripPlanner instances can be found here. Static and realtime…"}},"pageContext":{"slug":"/en/developers/architecture/x-apis/1-routing-api/"}},"staticQueryHashes":["3675773199","4050193485"]}