Static 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 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 on
the overview page for this API. 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 | 10 | 50 |
Silver | 10 | 250 |
Gold | 20 | 2500 |
Static data specification
OpenAPI specification for GTFS Regional Static data
Using GTFS Files
Obs: Detta innehåll finns inte tillgängligt på svenska. Därför ser du engelska versionen. Om du …
GTFS Extensions
GTFS Regional uses some of the GTFS Extensions. These extensions are not part of the specification, but are additions to offer additional details.
Extended route types
Extended route types allow for more specific transport modes to be used. GTFS Regional does not use the standard one digit GTFS route types, but uses only extended route types.
The following list shows the most used transport modes. This is a non-extensive list, only meant to give an idea of the types you should support. You should still be able to handle the other types in a graceful way, as new traffic may make use of them without prior warning.
Code | Name | Example |
---|---|---|
100 | Railway Service | |
401 | Metro Service | |
700 | Bus Service | |
717 | Share Taxi Service | Advance order traffic (Förbeställningstrafik) |
900 | Tram Service | |
1000 | Water Transport Service | Ferry, pendelbåt |
Trip-to-trip transfers
Trip to trip transfers make
use of the from_trip_id
and to_trip_id
columns in the transfers.txt file.
From Googles documentation:
The
from_trip_id
andto_trip_id
fields can contain atrip_id
, as specified bytrips.txt
. Iffrom_trip_id
is specified, the transfer will only apply to the arriving trip with the given trip id, at the givenfrom_stop_id
. Ifto_trip_id
is specified, the transfer will only apply to the departing trip with the given trip id, at the givento_stop_id
.
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
androute_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.