Digitransit APIs require registration. More information
Topics:

Cancelled trip times

If you are not yet familiar with GraphQL and GraphiQL it is highly recommended to review those pages at first.

Glossary

Term Explanation
Trip time A specific departure with specific direction for a specific route.
For example: bus 102 leaving from Otaniemi on 2017-11-21 at 10:00.
Feed IDs (feeds) Cancelled trip times are filtered by provided feed feedIds (e.g. ["HSL"]).
Route IDs (routes) Cancelled trip times are filtered by provided route gtfsIds (e.g. ["HSL:1098"]).
Trip pattern codes (patterns) Cancelled trip times are filtered by provided trip pattern codes (e.g. ["HSL:1098:1:01"]).
Trip IDs (trips) Cancelled trip times are filtered by provided trip gtfsIds (e.g. ["HSL:1098_20190405_Ma_2_1455"]).
Min date (minDate) Only cancelled trip times scheduled to run on minDate or after are returned. Format: "2019-12-23" or "20191223".
Max date (maxDate) Only cancelled trip times scheduled to run on maxDate or before are returned. Format: "2019-12-23" or "20191223".
Min departure time (minDepartureTime) Only cancelled trip times that have first stop departure time at minDepartureTime or after are returned. Format: seconds since midnight of minDate.
Max departure time (maxDepartureTime) Only cancelled trip times that have first stop departure time at maxDepartureTime or before are returned. Format: seconds since midnight of maxDate.
Min arrival time (minArrivalTime) Only cancelled trip times that have last stop arrival time at minArrivalTime or after are returned. Format: seconds since midnight of minDate.
Max arrival time (maxArrivalTime) Only cancelled trip times that have last stop arrival time at maxArrivalTime or before are returned. Format: seconds since midnight of maxDate.

What are cancelled trip times?

Cancelled trip times are trip times for which the whole departure has been cancelled.

Note: Cancelled trip times do not include a reason why the departure has been cancelled.

Query examples

Note: For more details about the query type alerts you can use the Documentation Explorer provided in GraphiQL.

Query all cancelled trip times for feed HSL

  1. Click this link to run the query below in GraphiQL.
{
  cancelledTripTimes(
    feeds: ["HSL"]
  ) {
    scheduledDeparture
    serviceDay
    trip {
      gtfsId
      tripHeadsign
      routeShortName
      directionId
      pattern {
        code
        name
      }
      route {
        gtfsId
        longName
      }
    }
    realtimeState
    headsign
  }
}
  1. Press play in GraphiQL to execute the query.

Query all cancelled trip times for route HSL:1098

  1. Click this link to run the query below in GraphiQL.

Note: You may need to change the routes parameter to see proper results.

{
  cancelledTripTimes(
    routes: ["HSL:1098"]
  ) {
    scheduledDeparture
    serviceDay
    trip {
      gtfsId
      tripHeadsign
      routeShortName
      directionId
      pattern {
        code
        name
      }
      route {
        gtfsId
        longName
      }
    }
    realtimeState
    headsign
  }
}
  1. Press play in GraphiQL to execute the query.

Query all cancelled trip times for pattern HSL:1098:1:01

  1. Click this link to run the query below in GraphiQL.

Note: You may need to change the patterns parameter to see proper results.

{
  cancelledTripTimes(
    patterns: ["HSL:1098:1:01"]
  ) {
    scheduledDeparture
    serviceDay
    trip {
      gtfsId
      tripHeadsign
      routeShortName
      directionId
      pattern {
        code
        name
      }
      route {
        gtfsId
        longName
      }
    }
    realtimeState
    headsign
  }
}
  1. Press play in GraphiQL to execute the query.

Query all cancelled trip times for trip HSL:1098_20190405_Ma_2_1455

  1. Click this link to run the query below in GraphiQL.

Note: You may need to change the trips parameter to see proper results.

{
  cancelledTripTimes(
    trips: ["HSL:1098_20190405_Ma_2_1455"]
  ) {
    scheduledDeparture
    serviceDay
    trip {
      gtfsId
      tripHeadsign
      routeShortName
      directionId
      pattern {
        code
        name
      }
      route {
        gtfsId
        longName
      }
    }
    realtimeState
    headsign
  }
}
  1. Press play in GraphiQL to execute the query.

Query cancelled trip times for feed HSL on 2019-04-08 and 2019-04-09

  1. Click this link to run the query below in GraphiQL.

Note: You may need to change the minDate and maxDate parameters to see proper results.

{
  cancelledTripTimes(
    feeds: ["HSL"]
    minDate: "2019-04-08"
    maxDate: "2019-04-09"
  ) {
    scheduledDeparture
    serviceDay
    trip {
      gtfsId
      tripHeadsign
      routeShortName
      directionId
      pattern {
        code
        name
      }
      route {
        gtfsId
        longName
      }
    }
    realtimeState
    headsign
  }
}
  1. Press play in GraphiQL to execute the query.

Query cancelled trip times for feed HSL between 2019-04-08 14:55 and 2019-04-09 15:06 according to departure time of the first stop

  1. Click this link to run the query below in GraphiQL.

Note: You may need to change the minDate, maxDate, minDepartureTime and maxDepartureTime parameters to see proper results.

{
  cancelledTripTimes(
    feeds: ["HSL"]
    minDate: "2019-04-08"
    maxDate: "2019-04-09"
    minDepartureTime: 53700
    maxDepartureTime: 54360
  ) {
    scheduledDeparture
    serviceDay
    trip {
      gtfsId
      tripHeadsign
      routeShortName
      directionId
      pattern {
        code
        name
      }
      route {
        gtfsId
        longName
      }
    }
    realtimeState
    headsign
  }
}
  1. Press play in GraphiQL to execute the query.

Query cancelled trip times for feed HSL between 2019-04-08 14:55 and 2019-04-09 15:06 according to arrival time of the last stop

  1. Click this link to run the query below in GraphiQL.

Note: You may need to change the minDate, maxDate, minArrivalTime and maxArrivalTime parameters to see proper results.

{
  cancelledTripTimes(
    feeds: ["HSL"]
    minDate: "2019-04-08"
    maxDate: "2019-04-09"
    minArrivalTime: 53700
    maxArrivalTime: 54360
  ) {
    scheduledDeparture
    serviceDay
    trip {
      gtfsId
      tripHeadsign
      routeShortName
      directionId
      pattern {
        code
        name
      }
      route {
        gtfsId
        longName
      }
    }
    realtimeState
    headsign
  }
}
  1. Press play in GraphiQL to execute the query.
© Digitransit 2024