GTFS Sweden 3 is a high quality GTFS feed containing most of the public transport data of Sweden. This dataset contains high quality detailed data, both static and real-time, in the GTFS format. This dataset is an aggregated dataset of all the different datasets in the GTFS Regional API. There is a single GTFS feed for static data. The realtime feeds are, for performance reasons, split up by specific regions or operators.

What does this dataset contain?

At the moment this dataset does not contain all of the public transport data of Sweden. If that is what you are looking for we recommend GTFS Sverige 2, which is less detailed but does contain all of the public transport data of Sweden.

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 Sweden 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✔️
SJsj✔️
Sjöstadstrafiken (Stockholm Stad)sjostadstrafiken✔️
Snälltågetsnalltaget✔️
Stavsnäs båttaxibattaxi✔️
Strömma Turism & Sjöfart ABstromma✔️
TJF Smalspårettjf✔️
Trosabussentrosa✔️
Tåg i Bergslagentib✔️
Tågabtagab✔️
Uddevalla Turism ABuddevalla✔️
VR (previously MTRX)vr✔️
Vy Nattågvy-nattag✔️
Vy Norrtågvy-norrtag✔️
Vy Tåg Värmlandstrafikvy-varmlandstrafik✔️
Vy Tåg X-tågetvy-xtaget✔️
Vygruppen Norgevy-norge✔️
Y-Bussybuss✔️

Breaking changes

These datasets have the stable status. This means that we will communicate when fields are added, or changed. When breaking changes are made, you will get three months or more to update your implementations.

Static data

The static GTFS Sweden 3 dataset contains files describing all planned public transport data. It can be combined with optional realtime data available in the GTFS Sweden Realtime data API. The data in this dataset is updated on a daily basis, typically between 05:00 and 06: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-sweden/sweden.zip?key={apikey}.

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

GTFS Extensions

The extensions are the same as in the GTFS Regional API.

Notes and known issues

See the documentation for the GTFS Regional API.

Realtime data

The realtime GTFS Sweden data consists of data feeds describing disturbances, deviations, delays, and even realtime GPS vehicle positions, separated per region or operator just like the GTFS Regional API (for performance reasons). It should be combined with static data available in the GTFS Sweden 3 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 on 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. ServiceAlerts for GTFS Sweden 3 are updated every 15 seconds.

Read more about service alerts in the general service alerts documention

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. TripUpdates for GTFS Sweden 3 are updated every 15 seconds.

Read more about trip updates in the general tripupdates documention, and check the realtime data column in the availability table above for availability per operator

VehiclePositions

The vehiclepositions.pb feed contains the GPS positions for all operators. Depending on the operator, Trafiklab’s vehiclepositions are typically updated every 2 seconds. Read more about trip updates in the general vehicle positions documention, and check the vehicle positions column in the availability table above for availability per operator

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 file can be fetched by taking the URL to the normal GTFS zip file, and adding _extra in the filename. For example, the file “sweden.zip” becomes “sweden_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-sweden/sweden_extra.zip?key={apikey}.

Replace {apikey} with your own API key.

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.

The TransportAuthority-number part of the Gid might not always be correct as a consequence of the aggregation process. We will update this documentation with further instructions in the future.

Licence

Data from the GTFS Sweden 3 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.