{"componentChunkName":"component---src-templates-developers-js","path":"/en/developers/apis/1-routing-api/canceled-trips/","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/canceled-trips/"},"frontmatter":{"title":"Canceled trips","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>Trip on service date</td>\n<td>A specific departure with specific direction for a specific route.<br/>For example: tram 15 leaving from Keilaniemi on 2024-12-18 at 13:13.</td>\n</tr>\n<tr>\n<td>Graphql Cursor Connection</td>\n<td><a href=\"https://relay.dev/graphql/connections.htm\">Special GraphQL query structure</a> that introduces parameters and fields that can be used in pagination</td>\n</tr>\n</tbody>\n</table>\n<h2 id=\"what-are-canceled-trips\" style=\"position:relative;\"><a href=\"#what-are-canceled-trips\" aria-label=\"what are canceled trips 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>What are canceled trips?</h2>\n<p>Canceled trips are trip times for which the whole departure has been canceled (i.e. not departures where only some stops are skipped). There are two types of trip cancelations: real-time and planned cancellations. Our data feeds only support real-time cancellations for now. If there is a known planned cancellation, it's possible that the whole trip is missing from the data feed and the canceled trips query doesn't therefore return it.</p>\n<p><strong>Note:</strong> Canceled trips do not include a reason why the departure has been canceled unless it's specified in an alert.</p>\n<h2 id=\"pagination\" style=\"position:relative;\"><a href=\"#pagination\" aria-label=\"pagination 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>Pagination</h2>\n<p>Usually, there are only a few canceled trips. However, it's highly recommended to use pagination to fetch canceled trips because in theory all trips can be canceled due to a strike, for example, which quickly increases the number of returned trips to tens of thousands which can really slow down the query (potentially even to the extent that the query is impossible to execute due to a timeout).</p>\n<p>The query for canceled trips uses <a href=\"https://relay.dev/graphql/connections.htm\">Relay Graphql Cursor Connection structure</a>. It introduces <code class=\"language-text\">first</code> and <code class=\"language-text\">last</code> arguments for controlling how many trips are returned from the query. <code class=\"language-text\">before</code> and <code class=\"language-text\">after</code> parameters can be used to specify a cursor for where to continue the pagination. <code class=\"language-text\">first</code> can be used alone without any other fields or together with <code class=\"language-text\">after</code>. <code class=\"language-text\">last</code> should be used with <code class=\"language-text\">before</code> parameter. Usually, it's enough to use the <code class=\"language-text\">first</code> and <code class=\"language-text\">after</code> for pagination and the other pagination direction is not as useful in this context. It's possible to fetch <code class=\"language-text\">pageInfo</code> which tells if there are more pages available and provides the necessary cursor(s) to continue the pagination.</p>\n<p>The returned trips are sorted by departure time and date (earliest comes first).</p>\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 type <strong>alerts</strong> you can use the <strong>Documentation Explorer</strong> provided in GraphiQL.</p>\n<h3 id=\"query-the-first-100-canceled-trips\" style=\"position:relative;\"><a href=\"#query-the-first-100-canceled-trips\" aria-label=\"query the first 100 canceled trips 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 the first 100 canceled trips</h3>\n<ol>\n<li>Click <a href=\"https://api.digitransit.fi/graphiql/hsl?query=%257B%250A%2520%2520canceledTrips%28first%253A%2520100%29%2520%257B%250A%2520%2520%2520%2520pageInfo%2520%257B%250A%2520%2520%2520%2520%2520%2520hasNextPage%250A%2520%2520%2520%2520%2520%2520endCursor%250A%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520edges%2520%257B%250A%2520%2520%2520%2520%2520%2520node%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520serviceDate%250A%2520%2520%2520%2520%2520%2520%2520%2520trip%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520gtfsId%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520alerts%2520%28types%253AROUTE%29%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520alertHeaderText%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520alertDescriptionText%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520start%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520stopLocation%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520...%2520on%2520Stop%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520name%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520schedule%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520time%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520...%2520on%2520ArrivalDepartureTime%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520departure%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520realTime%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520departure%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520delay%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520time%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520end%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520stopLocation%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520...%2520on%2520Stop%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520name%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520schedule%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520time%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520...%2520on%2520ArrivalDepartureTime%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520arrival%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520realTime%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520arrival%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520delay%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520time%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%257D%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\">canceledTrips</span><span class=\"token punctuation\">(</span><span class=\"token attr-name\">first</span><span class=\"token punctuation\">:</span> <span class=\"token number\">100</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token object\">pageInfo</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">hasNextPage</span>\n      <span class=\"token property\">endCursor</span>\n    <span class=\"token punctuation\">}</span>\n    <span class=\"token object\">edges</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token object\">node</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token property\">serviceDate</span>\n        <span class=\"token object\">trip</span> <span class=\"token punctuation\">{</span>\n          <span class=\"token property\">gtfsId</span>\n          <span class=\"token property-query\">alerts</span> <span class=\"token punctuation\">(</span><span class=\"token attr-name\">types</span><span class=\"token punctuation\">:</span><span class=\"token constant\">ROUTE</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token property\">alertHeaderText</span>\n            <span class=\"token property\">alertDescriptionText</span>\n          <span class=\"token punctuation\">}</span>\n        <span class=\"token punctuation\">}</span>\n        <span class=\"token object\">start</span> <span class=\"token punctuation\">{</span>\n          <span class=\"token object\">stopLocation</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token operator\">...</span> <span class=\"token keyword\">on</span> <span class=\"token class-name\">Stop</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 object\">schedule</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token object\">time</span> <span class=\"token punctuation\">{</span>\n              <span class=\"token operator\">...</span> <span class=\"token keyword\">on</span> <span class=\"token class-name\">ArrivalDepartureTime</span> <span class=\"token punctuation\">{</span>\n                <span class=\"token property\">departure</span>\n              <span class=\"token punctuation\">}</span>\n            <span class=\"token punctuation\">}</span>\n          <span class=\"token punctuation\">}</span>\n          <span class=\"token object\">realTime</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token object\">departure</span> <span class=\"token punctuation\">{</span>\n              <span class=\"token property\">delay</span>\n              <span class=\"token property\">time</span>\n            <span class=\"token punctuation\">}</span>\n          <span class=\"token punctuation\">}</span>\n        <span class=\"token punctuation\">}</span>\n        <span class=\"token object\">end</span> <span class=\"token punctuation\">{</span>\n          <span class=\"token object\">stopLocation</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token operator\">...</span> <span class=\"token keyword\">on</span> <span class=\"token class-name\">Stop</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 object\">schedule</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token object\">time</span> <span class=\"token punctuation\">{</span>\n              <span class=\"token operator\">...</span> <span class=\"token keyword\">on</span> <span class=\"token class-name\">ArrivalDepartureTime</span> <span class=\"token punctuation\">{</span>\n                <span class=\"token property\">arrival</span>\n              <span class=\"token punctuation\">}</span>\n            <span class=\"token punctuation\">}</span>\n          <span class=\"token punctuation\">}</span>\n          <span class=\"token object\">realTime</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token object\">arrival</span> <span class=\"token punctuation\">{</span>\n              <span class=\"token property\">delay</span>\n              <span class=\"token property\">time</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>\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-the-next-100-canceled-trips\" style=\"position:relative;\"><a href=\"#query-the-next-100-canceled-trips\" aria-label=\"query the next 100 canceled trips 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 the next 100 canceled trips</h3>\n<ol>\n<li>Click <a href=\"https://api.digitransit.fi/graphiql/hsl?query=%257B%250A%2520%2520canceledTrips%28first%253A%25205%252C%2520after%253A%2520%2522c2ltcGxlLWN1cnNvcjQ%253D%2522%29%2520%257B%250A%2520%2520%2520%2520pageInfo%2520%257B%250A%2520%2520%2520%2520%2520%2520hasNextPage%250A%2520%2520%2520%2520%2520%2520endCursor%250A%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520edges%2520%257B%250A%2520%2520%2520%2520%2520%2520node%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520serviceDate%250A%2520%2520%2520%2520%2520%2520%2520%2520trip%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520gtfsId%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520alerts%2520%28types%253AROUTE%29%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520alertHeaderText%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520alertDescriptionText%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520start%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520stopLocation%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520...%2520on%2520Stop%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520name%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520schedule%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520time%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520...%2520on%2520ArrivalDepartureTime%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520departure%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520realTime%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520departure%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520delay%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520time%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520end%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520stopLocation%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520...%2520on%2520Stop%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520name%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520schedule%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520time%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520...%2520on%2520ArrivalDepartureTime%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520arrival%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520realTime%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520arrival%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520delay%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520time%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%257D%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\">canceledTrips</span><span class=\"token punctuation\">(</span><span class=\"token attr-name\">first</span><span class=\"token punctuation\">:</span> <span class=\"token number\">100</span><span class=\"token punctuation\">,</span> <span class=\"token attr-name\">after</span><span class=\"token punctuation\">:</span> &lt;<span class=\"token property\">endCursor</span> <span class=\"token property\">from</span> <span class=\"token property\">a</span> <span class=\"token property\">previous</span> <span class=\"token keyword\">query</span>><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token object\">pageInfo</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token property\">hasNextPage</span>\n      <span class=\"token property\">endCursor</span>\n    <span class=\"token punctuation\">}</span>\n    <span class=\"token object\">edges</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token object\">node</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token property\">serviceDate</span>\n        <span class=\"token object\">trip</span> <span class=\"token punctuation\">{</span>\n          <span class=\"token property\">gtfsId</span>\n          <span class=\"token property-query\">alerts</span> <span class=\"token punctuation\">(</span><span class=\"token attr-name\">types</span><span class=\"token punctuation\">:</span><span class=\"token constant\">ROUTE</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token property\">alertHeaderText</span>\n            <span class=\"token property\">alertDescriptionText</span>\n          <span class=\"token punctuation\">}</span>\n        <span class=\"token punctuation\">}</span>\n        <span class=\"token object\">start</span> <span class=\"token punctuation\">{</span>\n          <span class=\"token object\">stopLocation</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token operator\">...</span> <span class=\"token keyword\">on</span> <span class=\"token class-name\">Stop</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 object\">schedule</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token object\">time</span> <span class=\"token punctuation\">{</span>\n              <span class=\"token operator\">...</span> <span class=\"token keyword\">on</span> <span class=\"token class-name\">ArrivalDepartureTime</span> <span class=\"token punctuation\">{</span>\n                <span class=\"token property\">departure</span>\n              <span class=\"token punctuation\">}</span>\n            <span class=\"token punctuation\">}</span>\n          <span class=\"token punctuation\">}</span>\n          <span class=\"token object\">realTime</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token object\">departure</span> <span class=\"token punctuation\">{</span>\n              <span class=\"token property\">delay</span>\n              <span class=\"token property\">time</span>\n            <span class=\"token punctuation\">}</span>\n          <span class=\"token punctuation\">}</span>\n        <span class=\"token punctuation\">}</span>\n        <span class=\"token object\">end</span> <span class=\"token punctuation\">{</span>\n          <span class=\"token object\">stopLocation</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token operator\">...</span> <span class=\"token keyword\">on</span> <span class=\"token class-name\">Stop</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 object\">schedule</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token object\">time</span> <span class=\"token punctuation\">{</span>\n              <span class=\"token operator\">...</span> <span class=\"token keyword\">on</span> <span class=\"token class-name\">ArrivalDepartureTime</span> <span class=\"token punctuation\">{</span>\n                <span class=\"token property\">arrival</span>\n              <span class=\"token punctuation\">}</span>\n            <span class=\"token punctuation\">}</span>\n          <span class=\"token punctuation\">}</span>\n          <span class=\"token object\">realTime</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token object\">arrival</span> <span class=\"token punctuation\">{</span>\n              <span class=\"token property\">delay</span>\n              <span class=\"token property\">time</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>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<ol start=\"2\">\n<li>Fill in the <code class=\"language-text\">after</code> parameter's value from a previous query's <code class=\"language-text\">endCursor</code>.</li>\n<li>Press play in GraphiQL to execute the query.</li>\n</ol>","tableOfContents":"<ul>\n<li><a href=\"/en/developers/apis/1-routing-api/canceled-trips/#glossary\">Glossary</a></li>\n<li><a href=\"/en/developers/apis/1-routing-api/canceled-trips/#what-are-canceled-trips\">What are canceled trips?</a></li>\n<li><a href=\"/en/developers/apis/1-routing-api/canceled-trips/#pagination\">Pagination</a></li>\n<li>\n<p><a href=\"/en/developers/apis/1-routing-api/canceled-trips/#query-examples\">Query examples</a></p>\n<ul>\n<li><a href=\"/en/developers/apis/1-routing-api/canceled-trips/#query-the-first-100-canceled-trips\">Query the first 100 canceled trips</a></li>\n<li><a href=\"/en/developers/apis/1-routing-api/canceled-trips/#query-the-next-100-canceled-trips\">Query the next 100 canceled trips</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 Trip on service date A specific departure with specific…"}},"pageContext":{"slug":"/en/developers/apis/1-routing-api/canceled-trips/"}},"staticQueryHashes":["3675773199","4050193485"]}