Static data
The static GTFS Sverige 2 dataset contains files describing all planned public transport data for Sweden.
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 found at https://api.resrobot.se/gtfs/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
Level | Maximum calls per minute | Maximum calls per month |
---|---|---|
Bronze | 1 | 50 |
Temporary upgrade | 2 | 200 |
GTFS Extensions
GTFS Sverige 2 uses some of the GTFS Extensions.
Extended Route Types
Extended route types allow for more specific transport modes to be used. GTFS Sverige does not use the standard one digit GTFS route types, but only uses 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 |
---|---|---|
101 | High Speed Rail Service | X2000 |
102 | Long Distance Rail Service | Mälartåg |
105 | Sleeper Rail Service | Night train (Nattåg) |
106 | Regional Rail Service | Commuter trains (Pendeltåg) |
401 | Metro Service | Tunnelbanan Stockholm |
700 | Bus Service | |
702 | Express Bus Service | |
900 | Tram Service | Trams in Göteborg |
1000 | Water Transport Service | SL Pendelbåt, Stockholm-Helsinki |
1501 | Communal Taxi Service | Buses with advance order conditions (Förbeställningstrafik) |
A complete list of all route types can be found at https://developers.google.com/transit/gtfs/reference/extended-route-types .
Trip-to-trip transfers
GTFS Sverige 2 includes trip-to-trip transfers, which are detailed transfer rules that provide additional details on which transfers are possible, and how long they take.
Trip to trip transfers make
use of the from_trip_id
and to_trip_id
columns in the transfers.txt file.
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
.