{"componentChunkName":"component---src-templates-developers-js","path":"/en/developers/apis/1-routing-api/routes/","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/apis/1-routing-api/routes/"},"frontmatter":{"title":"Routes","redirect":null,"toc":null,"description":null,"assets":null,"technologies":null,"docker":null},"html":"<p><strong>If you are not yet familiar with <a href=\"../0-graphql\">GraphQL</a> and <a href=\"../1-graphiql\">GraphiQL</a> it is highly recommended to review those pages at first.</strong></p>\n<h2 id=\"glossary\" style=\"position:relative;\"><a href=\"#glossary\" aria-label=\"glossary 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>Glossary</h2>\n<table>\n<thead>\n<tr>\n<th>Term</th>\n<th>Explanation</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Route</td>\n<td>A public transport service shown to customers under a single name, usually from point A to B and back. For example: trams 1 and 1A, buses 18 and 102T, or train A.<br/>Commonly used synonym: line</td>\n</tr>\n<tr>\n<td>Pattern</td>\n<td>A sequence of stops as used by a specific direction (i.e. inbound or outbound journey) and variant of a route.<br/>For example, a variant of a route could be a tram entering service from the depot and joining at the middle of the route or a route might have a short term diversion without changing the route name (longer diversions are usually marked as different routes).</td>\n</tr>\n<tr>\n<td>Trip</td>\n<td>A specific occurance of a pattern, usually identified by the route and exact departure time from the first stop.<br/>For example: tram 15 leaving from Keilaniemi on 2024-12-18 at 13:13, or more generally leaving from Keilaniemi at 13:13 on specified days.</td>\n</tr>\n</tbody>\n</table>\n<h2 id=\"query-examples\" style=\"position:relative;\"><a href=\"#query-examples\" aria-label=\"query examples 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>Query examples</h2>\n<p><strong>Note:</strong> For more details about the query types <strong>routes</strong> and <strong>pattern</strong> and their parameters you can use the <strong>Documentation Explorer</strong> provided in GraphiQL.</p>\n<p><strong>Note:</strong> If the examples provided with an id or other parameter do not return what is expected then the value in question may not be in use any more and you should try again with an existing value.</p>\n<h3 id=\"query-all-routes-where-name-starts-with-10\" style=\"position:relative;\"><a href=\"#query-all-routes-where-name-starts-with-10\" aria-label=\"query all routes where name starts with 10 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>Query all routes where name starts with \"10\"</h3>\n<ol>\n<li>Click <a href=\"https://api.digitransit.fi/graphiql/hsl/v2/gtfs/v1?query=%7B%0A%20%20routes(name%3A%20%2210%22)%20%7B%0A%20%20%20%20gtfsId%0A%20%20%20%20shortName%0A%20%20%20%20longName%0A%20%20%20%20mode%0A%20%20%7D%0A%7D\">this link</a> to run the query below in GraphiQL.</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"graphql\"><pre class=\"language-graphql\"><code class=\"language-graphql\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property-query\">routes</span><span class=\"token punctuation\">(</span><span class=\"token attr-name\">name</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"10\"</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">gtfsId</span>\n    <span class=\"token property\">shortName</span>\n    <span class=\"token property\">longName</span>\n    <span class=\"token property\">mode</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<ol start=\"2\">\n<li>Press play in GraphiQL to execute the query.</li>\n</ol>\n<h3 id=\"query-all-bus-routes-where-name-starts-with-58\" style=\"position:relative;\"><a href=\"#query-all-bus-routes-where-name-starts-with-58\" aria-label=\"query all bus routes where name starts with 58 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>Query all bus routes where name starts with \"58\"</h3>\n<ol>\n<li>Click <a href=\"https://api.digitransit.fi/graphiql/hsl/v2/gtfs/v1?query=%7B%0A%20%20routes(name%3A%20%2258%22%2C%20transportModes%3A%20BUS)%20%7B%0A%20%20%20%20gtfsId%0A%20%20%20%20shortName%0A%20%20%20%20longName%0A%20%20%20%20mode%0A%20%20%7D%0A%7D%0A\">this link</a> to run the query below in GraphiQL.</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"graphql\"><pre class=\"language-graphql\"><code class=\"language-graphql\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property-query\">routes</span><span class=\"token punctuation\">(</span><span class=\"token attr-name\">name</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"58\"</span><span class=\"token punctuation\">,</span> <span class=\"token attr-name\">transportModes</span><span class=\"token punctuation\">:</span> <span class=\"token constant\">BUS</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">gtfsId</span>\n    <span class=\"token property\">shortName</span>\n    <span class=\"token property\">longName</span>\n    <span class=\"token property\">mode</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<ol start=\"2\">\n<li>Press play in GraphiQL to execute the query.</li>\n</ol>\n<h3 id=\"query-all-tram-routes-where-name-starts-with-1\" style=\"position:relative;\"><a href=\"#query-all-tram-routes-where-name-starts-with-1\" aria-label=\"query all tram routes where name starts with 1 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>Query all tram routes where name starts with \"1\"</h3>\n<ol>\n<li>Click <a href=\"https://api.digitransit.fi/graphiql/hsl/v2/gtfs/v1?query=%7B%0A%20%20routes(name%3A%20%221%22%2C%20transportModes%3A%20TRAM)%20%7B%0A%20%20%20%20gtfsId%0A%20%20%20%20shortName%0A%20%20%20%20longName%0A%20%20%20%20mode%0A%20%20%7D%0A%7D\">this link</a> to run the query below in GraphiQL.</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"graphql\"><pre class=\"language-graphql\"><code class=\"language-graphql\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property-query\">routes</span><span class=\"token punctuation\">(</span><span class=\"token attr-name\">name</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"1\"</span><span class=\"token punctuation\">,</span> <span class=\"token attr-name\">transportModes</span><span class=\"token punctuation\">:</span> <span class=\"token constant\">TRAM</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">gtfsId</span>\n    <span class=\"token property\">shortName</span>\n    <span class=\"token property\">longName</span>\n    <span class=\"token property\">mode</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<ol start=\"2\">\n<li>Press play in GraphiQL to execute the query.</li>\n</ol>\n<h3 id=\"query-patterns-of-a-route\" style=\"position:relative;\"><a href=\"#query-patterns-of-a-route\" aria-label=\"query patterns of a route 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>Query patterns of a route</h3>\n<ol>\n<li>Click <a href=\"https://api.digitransit.fi/graphiql/hsl/v2/gtfs/v1?query=%7B%0A%20%20routes(name%3A%20%2259%22%2C%20transportModes%3A%20BUS)%20%7B%0A%20%20%20%20shortName%0A%20%20%20%20longName%0A%20%20%20%20patterns%20%7B%0A%20%20%20%20%20%20code%0A%20%20%20%20%20%20directionId%0A%20%20%20%20%20%20name%0A%20%20%20%20%20%20headsign%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D\">this link</a> to run the query below in GraphiQL.</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"graphql\"><pre class=\"language-graphql\"><code class=\"language-graphql\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property-query\">routes</span><span class=\"token punctuation\">(</span><span class=\"token attr-name\">name</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"59\"</span><span class=\"token punctuation\">,</span> <span class=\"token attr-name\">transportModes</span><span class=\"token punctuation\">:</span> <span class=\"token constant\">BUS</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">shortName</span>\n    <span class=\"token property\">longName</span>\n    <span class=\"token object\">patterns</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">code</span>\n      <span class=\"token property\">directionId</span>\n      <span class=\"token property\">name</span>\n      <span class=\"token property\">headsign</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<ol start=\"2\">\n<li>Press play in GraphiQL to execute the query.</li>\n</ol>\n<p>Example response:</p>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"data\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"routes\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n      <span class=\"token punctuation\">{</span>\n        <span class=\"token property\">\"shortName\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"59\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token property\">\"longName\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Sompasaari-Kalasatama(M)-Pasila-Pajamäki\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token property\">\"patterns\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n          <span class=\"token punctuation\">{</span>\n            <span class=\"token property\">\"code\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"HSL:1059:0:01\"</span><span class=\"token punctuation\">,</span>\n            <span class=\"token property\">\"directionId\"</span><span class=\"token operator\">:</span> <span class=\"token number\">0</span><span class=\"token punctuation\">,</span>\n            <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"59 to Pajamäki (HSL:1461110)\"</span><span class=\"token punctuation\">,</span>\n            <span class=\"token property\">\"headsign\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Pajamäki\"</span>\n          <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n          <span class=\"token punctuation\">{</span>\n            <span class=\"token property\">\"code\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"HSL:1059:1:01\"</span><span class=\"token punctuation\">,</span>\n            <span class=\"token property\">\"directionId\"</span><span class=\"token operator\">:</span> <span class=\"token number\">1</span><span class=\"token punctuation\">,</span>\n            <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"59 to Polariksenkatu (HSL:1100128)\"</span><span class=\"token punctuation\">,</span>\n            <span class=\"token property\">\"headsign\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Sompasaari\"</span>\n          <span class=\"token punctuation\">}</span>\n        <span class=\"token punctuation\">]</span>\n      <span class=\"token punctuation\">}</span>\n    <span class=\"token punctuation\">]</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h3 id=\"query-stop-names-by-pattern-id\" style=\"position:relative;\"><a href=\"#query-stop-names-by-pattern-id\" aria-label=\"query stop names by pattern id 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>Query stop names by pattern ID</h3>\n<ul>\n<li>\n<p>See previous example on how to find pattern IDs for a route</p>\n<ul>\n<li>Pattern ID is value of <code class=\"language-text\">code</code> in a pattern object</li>\n</ul>\n</li>\n<li>Click <a href=\"https://api.digitransit.fi/graphiql/hsl/v2/gtfs/v1?query=%7B%0A%20%20pattern(id%3A%20%22HSL%3A1059%3A0%3A01%22)%20%7B%0A%20%20%20%20name%0A%20%20%20%20stops%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A%0A%0A\">this link</a> to run the query below in GraphiQL.</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"graphql\"><pre class=\"language-graphql\"><code class=\"language-graphql\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property-query\">pattern</span><span class=\"token punctuation\">(</span><span class=\"token attr-name\">id</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"HSL:1059:0:01\"</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">name</span>\n    <span class=\"token object\">stops</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">name</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<ol start=\"2\">\n<li>Press play in GraphiQL to execute the query.</li>\n</ol>\n<h3 id=\"query-trips-of-a-specific-pattern\" style=\"position:relative;\"><a href=\"#query-trips-of-a-specific-pattern\" aria-label=\"query trips of a specific pattern 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>Query trips of a specific pattern</h3>\n<ol>\n<li>Click <a href=\"https://api.digitransit.fi/graphiql/hsl/v2/gtfs/v1?query=%7B%0A%09pattern(id%3A%20%22HSL%3A1059%3A0%3A01%22)%20%7B%0A%20%20%20%20code%0A%20%20%20%20directionId%0A%20%20%20%20name%0A%20%20%20%20headsign%0A%20%20%20%20trips%20%7B%0A%20%20%20%20%20%20gtfsId%0A%20%20%20%20%20%20tripHeadsign%0A%20%20%20%20%20%20routeShortName%0A%20%20%20%20%20%20directionId%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D\">this link</a> to run the query below in GraphiQL.</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"graphql\"><pre class=\"language-graphql\"><code class=\"language-graphql\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property-query\">pattern</span><span class=\"token punctuation\">(</span><span class=\"token attr-name\">id</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"HSL:1059:0:01\"</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">code</span>\n    <span class=\"token property\">directionId</span>\n    <span class=\"token property\">name</span>\n    <span class=\"token property\">headsign</span>\n    <span class=\"token object\">trips</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">gtfsId</span>\n      <span class=\"token property\">tripHeadsign</span>\n      <span class=\"token property\">routeShortName</span>\n      <span class=\"token property\">directionId</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<ol start=\"2\">\n<li>Press play in GraphiQL to execute the query.</li>\n</ol>\n<h3 id=\"query-trip-with-id\" style=\"position:relative;\"><a href=\"#query-trip-with-id\" aria-label=\"query trip with id 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>Query trip with id</h3>\n<ol>\n<li>Click <a href=\"https://api.digitransit.fi/graphiql/hsl/v2/gtfs/v1?query=%257B%250A%2520%2520trip%28id%253A%2520%2522HSL%253A1020_20240314_Pe_1_0933%2522%29%2520%257B%250A%2520%2520%2520%2520tripHeadsign%250A%2520%2520%2520%2520occupancy%2520%257B%250A%2520%2520%2520%2520%2520%2520occupancyStatus%250A%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%250A%2520%2520%257D%250A%257D\">this link</a> to run the query below in GraphiQL.</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"graphql\"><pre class=\"language-graphql\"><code class=\"language-graphql\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property-query\">trip</span><span class=\"token punctuation\">(</span><span class=\"token attr-name\">id</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"HSL:1020_20240314_Pe_1_0933\"</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">tripHeadsign</span>\n    <span class=\"token object\">occupancy</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">occupancyStatus</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<ol start=\"2\">\n<li>Press play in GraphiQL to execute the query.</li>\n</ol>\n<p>Example response:</p>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"data\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"trip\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">\"tripHeadsign\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"Munkkivuori\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token property\">\"occupancy\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token property\">\"occupancyStatus\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"FEW_SEATS_AVAILABLE\"</span>\n      <span class=\"token punctuation\">}</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>","tableOfContents":"<ul>\n<li><a href=\"/en/developers/apis/1-routing-api/routes/#glossary\">Glossary</a></li>\n<li>\n<p><a href=\"/en/developers/apis/1-routing-api/routes/#query-examples\">Query examples</a></p>\n<ul>\n<li><a href=\"/en/developers/apis/1-routing-api/routes/#query-all-routes-where-name-starts-with-10\">Query all routes where name starts with \"10\"</a></li>\n<li><a href=\"/en/developers/apis/1-routing-api/routes/#query-all-bus-routes-where-name-starts-with-58\">Query all bus routes where name starts with \"58\"</a></li>\n<li><a href=\"/en/developers/apis/1-routing-api/routes/#query-all-tram-routes-where-name-starts-with-1\">Query all tram routes where name starts with \"1\"</a></li>\n<li><a href=\"/en/developers/apis/1-routing-api/routes/#query-patterns-of-a-route\">Query patterns of a route</a></li>\n<li><a href=\"/en/developers/apis/1-routing-api/routes/#query-stop-names-by-pattern-id\">Query stop names by pattern ID</a></li>\n<li><a href=\"/en/developers/apis/1-routing-api/routes/#query-trips-of-a-specific-pattern\">Query trips of a specific pattern</a></li>\n<li><a href=\"/en/developers/apis/1-routing-api/routes/#query-trip-with-id\">Query trip with id</a></li>\n</ul>\n</li>\n</ul>","excerpt":"If you are not yet familiar with GraphQL and GraphiQL it is highly recommended to review those pages at first. Glossary Term Explanation Route A public transport service shown to customers under a…"}},"pageContext":{"slug":"/en/developers/apis/1-routing-api/routes/"}},"staticQueryHashes":["3675773199","4050193485"]}