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.

Trafiklab 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

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 forLess suited for
Quickly getting the next departures from a stopAnalysing public transport information
Digital signageApplications requiring a certain uptime (SLA)
Onboard signageData 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.

LevelMaximum calls per minuteMaximum calls per monthExample usage
Bronze25100.000Departure boards for 2 stops
Bronze +25500.000Departure boards for 10 stops
Silver1505.000.000Departure boards for 100 stops, mobile apps
Gold1.20050.000.000Departure boards for 2.000 stops updated every other minute, mobile apps
Platinum3.000125.000.000Departure boards for 5.000 stops updated every other minute, mobile apps
If you want to analyze data, if your service will have more than a million active users, or if you have strict requirements regarding uptime we recommend using GTFS and hosting your own API based on that data. One GTFS file contains all information you possibly can get out of this API, meaning it’s easier to download this file if you need large amounts of data for analysis.

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.

https://creativecommons.org/licenses/by/4.0/legalcode.txt