Trafiklab realtime APIs
betaTrafiklab realtime APIs is a collection of APIs which provide information for public transport in entire Sweden. They are developed internally based on our own GTFS Sweden 3 data, offering the same data in a way that is more suited for direct consumption. They make realtime data more accessible compared to GTFS and NeTEx/SIRI, meaning you can use them for applications which can’t handle complex GTFS or NeTEx datasets. Examples are mobile apps or digital signage.
Trafiklab APIs vs Resrobot
These APIs are a direct replacement for Resrobot 2.1 timetables and stop lookup. Compared to Resrobot, they contain more detailed data, such as platforms and realtime data. They offer significantly better performance as well, which translates into higher quota for end users while reducing the costs for Trafiklab.
Usage
Trafiklabs realtime APIs can be used for
- looking up departures and arrivals, using the Trafiklab Timetables endpoint.
- looking up the ids of stops, using the Trafiklab Stop Lookup endpoint.
For route planning, you can use the Resrobot APIs.
Use cases
Trafiklabs APIs answers to specific questions, such as “when are the next departures from stop X”. The response is quick and easy to use, and can be used directly without having to process it first. This makes it a good fit for for example smartphone applications where travellers need an answer on their queries, and for digital displays without much processing power. It is however a poor choice for analytics where a lot of data from a lot of vehicles is needed, since a lot of API calls would be required to transfer large amounts of data.
Well suited for | Less suited for |
---|---|
Quickly getting the next departures from a stop | Analysing public transport information |
Digital signage | Applications requiring a certain uptime (SLA) |
Onboard signage | Data visualisation |
Mobile applications | |
Websites and widgets |
API key levels
There is only one API key required to access all features in Trafiklab APIs, the different key levels are specified in the table below. If you don´t have a key yet, read here on how to get one.
Level | Maximum calls per minute | Maximum calls per month | Example usage |
---|---|---|---|
Bronze | 25 | 100.000 | Departure boards for 2 stops |
Bronze + | 25 | 500.000 | Departure boards for 10 stops |
Silver | 150 | 5.000.000 | Departure boards for 100 stops, mobile apps |
Gold | 1.200 | 50.000.000 | Departure boards for 2.000 stops updated every other minute, mobile apps |
Platinum | 3.000 | 125.000.000 | Departure boards for 5.000 stops updated every other minute, mobile apps |
GTFS regional is a set of GTFS feeds of high quality, with realtime data and even realtime GPS …
GTFS Sverige 2 is a GTFS dataset which covers all public transport in Sweden. GTFS Sverige 2 is our …
License
These Trafiklab APIs are available under the CC-BY 4.0 license. You should mention the data is provided by Trafiklab.se.
You are free to:
- Share — copy and redistribute the material in any medium or format for any purpose, even commercially.
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
- The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
- Attribution — You must give appropriate credit , provide a link to the license, and indicate if changes were made . You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation .
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.