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.

GTFS regional is a set of GTFS feeds of high quality, with realtime data and even realtime GPS positions on vehicles for some operators. This dataset contains high quality detailed data, both static and real-time, in the GTFS format. Each dataset contains data for a specific region or operator. While the combined GTFS feeds do cover all regional public transport operators, and some private companies as well, each feed uses their own ids for each stop. If you are looking for an aggregated national feed, please look at GTFS Sverige 2.

What does this dataset contain?

This dataset contains high quality detailed data, both static and real-time, in the NeTEx format. Each dataset contains data for a specific region or operator.

Data format

The data is in the GTFS format, and makes use of the GTFS Extensions. Realtime data follows the GTFS-Realtime(GTFS-RT) standard, and is stored in the protobuf format. This data is also available in the NeTEx format. For the NeTEx format, see the NeTEx regional API.

Updates

The static data in this dataset is updated on a daily basis. The real-time data receives multiple updates per minute, see realtime data for more information.

Operators covered by this dataset

The following table shows which operators are covered by this dataset.

New! Realtime and vehicle position data is available for Jönköpings Länstrafik starting June 3rd 2024.
OperatorAbbreviationStatic dataReal-time dataVehicle positionsOccupancy data
Blekingetrafiken (Blekinge län)blekinge✔️
Dalatrafik (Dalarnas län)dt✔️✔️✔️
DinTur (Västernorrlands län)dintur✔️
Gotlands kollektivtrafik (Gotlands län)gotland✔️
Hallandstrafiken (Hallands län)halland✔️
JLT (Jönköpings län)jlt✔️✔️✔️
Kalmar länstrafik (Kalmar län)klt✔️✔️✔️
Kronobergs länstrafik (Kronobergs län)krono✔️✔️✔️
Länstrafiken Jämtlandjamtland✔️
Länstrafiken Norrbottennorrbotten✔️
Länstrafiken Västerbottenvasterbotten✔️🕒🕒
Länstrafiken Örebroorebro✔️✔️✔️
Skånetrafiken (Skåne län)skane✔️✔️✔️✔️
SL (Stockholms län)sl✔️✔️✔️
Sörmlandstrafiken (Södermanlands län)sormland✔️
UL (Uppsala län)ul✔️✔️✔️
VL (Västmanlands län)vastmanland✔️✔️✔️
Värmlandstrafik & Karlstadbuss (Värmlands län)varm✔️✔️✔️
Västtrafik (Västra götalands län)vt✔️
X-Trafik (Gävleborgs län)xt✔️✔️✔️
Östgötatrafiken (Östergötlands län)otraf✔️✔️✔️✔️
BT bussbtbuss✔️
Bussbolaget Östergötlandbussost✔️
Destination Gotlanddg✔️
Flixtrainflixtrain✔️
Härjedalingenharje✔️
Inlandsbananinban✔️
Lennakattenlenna✔️
Masexpressenmasen✔️
Ressel Rederiressel✔️
Roslagens sjötrafikroslagen✔️
SJ, Tågab, Snälltågetsj✔️
Sjöstadstrafiken (Stockholm Stad)sjostadstrafiken✔️
Stavsnäs båttaxibattaxi✔️
Strömma Turism & Sjöfart ABstromma✔️
TJF Smalspårettjf✔️
Uddevalla Turism ABuddevalla✔️
Y-Bussybuss✔️

Breaking changes

Both the static and realtime data feeds are stable. While we add new data all the time, we don’t make breaking changes. Should we need to make a breaking change, we’ll inform users first, and you’ll have around 6 months time to make the necessary adjustments to your code.

Static data

The static GTFS Regional dataset contains files describing all planned public transport data. It can be combined with optional realtime data available in the GTFS Realtime data API. The data in this dataset is updated on a daily basis, typically between 03:00 and 07:00.

In order to retrieve the static 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 URL:

https://opendata.samtrafiken.se/gtfs/{operator}/{operator}.zip?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 here above. 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

LevelMaximum calls per minuteMaximum calls per month
Bronze1050
Silver10250
Gold202500

Notes and known issues

  • Since GTFS defines vehicle types on a route-level, the vehicle-type for some trips might be incorrect if those trips deviate from the route’s most common vehicle type. This can for example happen when some trips on a bus route are executed with a taxi instead of a bus.
  • Calendar.txt is only used to define validity periods, not to define service dates. Actual service dates are described in calendar_dates.txt.
  • When both route_short_name and route_long_name have a value, route_long_name should be considered the correct line name. In this case, route_short_name should only be used for systems that cannot show the long name.
  • There might be differences between GTFS Sverige 2 and GTFS Regional Static, for example in the validity period for routes which might be longer in GTFS Sverige 2. This is due to the higher detail of the GTFS Regional Static dataset.
  • GTFS Regional contains transfers between stop points within the same stop, as well as transfers between different stop areas and transfers to and from specific trips.

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.

Availability of regional data differs per operator. See the top of this 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 at the top of this 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

LevelMaximum calls per minuteMaximum calls per month
Bronze5030 000
Silver2502 000 000
Gold50022 500 000

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 GTFS Regional availability table 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. Trafiklab’s tripUpdates are updated every 15 seconds. See the GTFS Regional availability table 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, 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:


Historical data

Historical GTFS data can be accessed through the KoDa API.


Extra files

Extra files are files which provide additional information about the information in the GTFS files. They are not part of the GTFS standard, but contain the information which is needed to link the GTFS files to internal operator systems, or other data which is delivered by the operator.

The extra files can be fetched by taking the URL to a normal GTFS zip file, and adding _extra in the filename. For example, the file “otraf.zip” becomes “otraf_extra.zip”. These files use the same API key as the static data, and count against the same quota.

In order to retrieve the static 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 URL:

https://opendata.samtrafiken.se/gtfs/{operator}/{operator}_extra.zip?key={apikey}.

Replace {operator} with the abbreviation of the operator you want to download. These abbreviations can be found in the

trips_dated_vehicle_journey.txt

This file links every GTFS trip_id to their source GID in the Noptis data. This file is meant for those who want to combine or integrate their systems with internal systems of transport agencies. Note that this data is only correct for operators who deliver data to Samtrafiken in the Noptis DOI or Noptis DII format.

Licence

Data from the GTFS Regional API is available under the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication license.

Summary

The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.

Other Information

In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights.

Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law.

When using or citing the work, you should not imply endorsement by the author or the affirmer.

More information, as well as the complete license text, can be found at

the creative commons website.