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.
{
alerts {
alertDescriptionText
}
}
{
alerts {
alertHeaderText
alertHeaderTextTranslations {
text
language
}
alertDescriptionText
alertDescriptionTextTranslations {
text
language
}
alertUrl
effectiveStartDate
effectiveEndDate
agency {
gtfsId
}
route {
gtfsId
}
patterns {
code
}
trip {
gtfsId
}
stop {
gtfsId
}
}
}
Example response:
{
"data": {
"alerts": [
{
"alertHeaderText": null,
"alertHeaderTextTranslations": [],
"alertDescriptionText": "Seutuliikenteen linja 561 Aviapoliksesta, klo 14:37 peruttu. Syy: tekninen vika.",
"alertDescriptionTextTranslations": [
{
"text": "Seutuliikenteen linja 561 Aviapoliksesta, klo 14:37 peruttu. Syy: tekninen vika.",
"language": "fi"
},
{
"text": "Regiontrafik, linje 561 från Aviapolis, kl. 14:37 inställd. Orsak: tekniska problem.",
"language": "sv"
},
{
"text": "Regional traffic, line 561 from Aviapolis, 14:37 cancelled. Cause: technical problems.",
"language": "en"
}
],
"alertUrl": null,
"effectiveStartDate": 1470309600,
"effectiveEndDate": 1470314220,
"agency": null,
"route": {
"gtfsId": "HSL:4561"
},
"patterns": [],
"trip": {
"gtfsId": "HSL:4561_20160801_To_2_1437"
},
"stop": null
}
]
}
}
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
alertUrlTranslations {
text
language
}
}
}
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: ["stpt"]) {
feed
alertDescriptionText
alertDescriptionTextTranslations {
text
language
}
route {
gtfsId
}
trip {
gtfsId
}
stop {
gtfsId
}
effectiveStartDate
effectiveEndDate
}
}