Realtime data

Obs: Detta innehåll finns inte tillgängligt på svenska. Därför ser du engelska versionen. Om du tycker att denna sida borde översättas till svenska, kan du skriva till oss på support.trafiklab.se.

Om du vill se webbsidan på engelska, klicka här.

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.

Availability of regional data differs per operator. See the overview page to see which data is provided by the operator(s) you are interested in.

Where to download

The dataset can be accessed through the following URLs:

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.

Available real-time data

ServiceAlerts

Service alerts allow you to get information about disruptions on the transit network. This can 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. 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).

ServiceAlerts can remain unchanged for relatively long periods (for example a couple of hours). You can prevent unnecessary downloads by making use of Conditional HTTP requests.

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. See the table on the GTFS Regional overview page to find out which operators are supported (Real-time data column).

In some cases it isn’t possible to link certain delays to a specific trip. In this case, they may be linked to a route instead.

VehiclePositions

The vehiclepositions.pb feed contains the GPS positions for all operators. Depending on the operator, these positions are updated every 1 to 3 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: