GTFS-realtime v2

Prerequisite

  1. Obtain an API Key. To do so, you must create a new application. Go to Home > Applications
  2. Get familiar with the GTFS-real standard. Here is the official documentation
  3. Obtain STM's static GTFS file from this page. Watch carefully for the avalability period and the last update date, as the GTFS file is updated regularly.

API / Feed information

URL : https://api.stm.info/pub/od/gtfs-rt/ic/v2

Endpoints:

  • GET /tripUpdates
    • Get the bus schedule in real time
      • Mandatory HTTP header : apikey
  • GET /vehiclePositions
    • Get the bus positions in real time
      • Mandatory HTTP header : apikey

New in version 2

Bus occupancy levels

Since we launched real-time info, all STM vehicles have been equipped with passenger counters that provide real-time passenger counts for each bus in service. This is a useful tool for planning your trips outside of peak periods whenever possible, making it easier to keep your distance from other customers.

Based on this data and the potential number of bus passengers, we calculate the occupancy level in a given bus and display it as follows:

This data is returned by the /vehiclePosition request. We mapped these occupancy levels to the found in the OccupancyStatus enumeration (enum) of the GTFS-realtime standard.