Realtime data
The realtime GTFS Regional data consists of data feeds describing disturbances, deviations, delays, and even realtime GPS vehicle positions, separated per region or operator. It should be combined with static data available in the GTFS Regional API.
In order to retrieve the data you need an API key. Technical details for fetching the data can be found in the API’s OpenAPI specification. Trafiklabs GTFS documentation can help you to get started with GTFS files.
Where to download
The dataset can be accessed through the following URLs:
- https://opendata.samtrafiken.se/gtfs-rt/{operator}/ServiceAlerts.pb?key={apikey}
- https://opendata.samtrafiken.se/gtfs-rt/{operator}/TripUpdates.pb?key={apikey}
- https://opendata.samtrafiken.se/gtfs-rt/{operator}/VehiclePositions.pb?key={apikey}
Replace {operator}
with the abbreviation of the operator you want to download. These abbreviations can be found in the
OpenAPI specification, but are also listed on the
static data documentation page. Replace {apikey}
with your
own API key. If you don´t have a key yet, read
here on how to get one.
API key levels
Level | Maximum calls per minute | Maximum calls per month |
---|---|---|
Bronze | 50 | 30 000 |
Silver | 250 | 2 000 000 |
Gold | 500 | 22 500 0000 |
Available real-time data
ServiceAlerts
Service alerts allow you to get information about disruptions on the transit network. This can be anything from planned roadworks (a certain stop might not get served for a few days) to electricity outages on a rail network. ServiceAlerts are broad and general information. Trafiklab’s serviceAlerts are updated every 15 seconds.
Delays and cancellations of individual trips are usually communicated using Trip updates. See the table on the GTFS Regional overview page to find out which operators are supported (Realtime data column).
TripUpdates
Trip updates contain real-time departure and arrival times for individual trips. This means you can get the current, estimated delay for each vehicle on each stop. Trafiklab’s tripUpdates are updated every 15 seconds. See the table on the GTFS Regional overview page to find out which operators are supported (Real-time data column).
VehiclePositions
The vehiclepositions.pb feed contains the GPS positions for all operators. Depending on the operator, Trafiklab’s vehiclepositions are updated every 2 seconds. The availability of this data is indicated in a separate column in the GTFS Regional availability table.
Using real-time data
You can read more about how to use real-time data in our GTFS format documentation: