If you are not yet familiar with GraphQL and GraphiQL it is highly recommended to review those pages at first.
Disruption info is information about the current and upcoming disruptions in public transport.
Note: For more details about the query type alerts you can use the Documentation Explorer provided in GraphiQL.
Response language can be changed by using the request header Accept-Language
. Here is more information.
{
alerts {
alertDescriptionText
}
}
{
alerts {
alertHeaderText
alertDescriptionText
alertUrl
effectiveStartDate
effectiveEndDate
entities {
__typename
... on Route {
gtfsId
}
}
}
}
Example response:
{
"data": {
"alerts": [
{
"alertHeaderText": "Line 6, Diversion route, 17:00 - 18:00",
"alertDescriptionText": "Line 6, Diversion route: Turns around in Kolmikulma., Reason: Technical failure, Estimated duration: 17:00 - 18:00",
"alertUrl": "https://www.hsl.fi/en",
"effectiveStartDate": 1725458400,
"effectiveEndDate": 1725462000,
"entities": [
{
"__typename": "Route",
"gtfsId": "HSL:1006"
},
{
"__typename": "Route",
"gtfsId": "HSL:1006H"
}
]
},
]
}
}
alertUrl
can contain an URL to a website that provides more details of the disruptionField alertSeverityLevel
describes severity of the alert
{
alerts {
alertDescriptionText
alertSeverityLevel
alertUrl
}
}
The following query should fetch all disruptions that have caused detours
{
alerts(effect: [MODIFIED_SERVICE], severityLevel: [WARNING]) {
feed
alertSeverityLevel
alertEffect
alertCause
alertDescriptionText
alertHeaderText
}
}
Argument feeds
can be used to query alerts only from specific feeds
{
alerts(feeds: ["HSL"]) {
feed
alertDescriptionText
entities {
... on Route {
gtfsId
}
... on Stop {
gtfsId
}
}
effectiveStartDate
effectiveEndDate
}
}