Trafikverket releases open APIs for train information on a trial basis
October 26, 2012
During 2012, Samtrafiken, the Viktoria Institute and Trafikverket have run a project to develop an open API for train information in Sweden. We are now launching, on a trial basis, a couple of APIs with real-time information for all train traffic in Sweden running on Trafikverket’s infrastructure.
Trafikverket has long provided information about train traffic in Sweden through Läget i Trafiken on trafikverket.se. As a large number of other services have requested the information, APIs are now being opened on Trafiklab on a trial basis to make the same information available to external developers.
Two new APIs
The new APIs being released on a trial basis deliver information from the same underlying system that currently supplies Trafikverket’s own website: http://trafikinfo.trafikverket.se/ with information.
One of the APIs delivers more of the “raw data” from this system, and the other API is designed to make things easier for you if you want to quickly build a service or integrate the information into an existing service. One of the APIs, TrainExport http://www.trafiklab.se/api/trafikverket-trainexport-api delivers more of the “raw data” from this system, and the other API, TrainInfo, is designed to make things easier for you if you want to quickly build a service or integrate the information into an existing service. Access to the APIs is free of charge, and you get keys for the APIs through Trafiklab in the same way as for SL’s and Samtrafiken’s APIs.
The new APIs will be evaluated during the autumn, and we would like to know what you think of the APIs and of Trafikverket opening up this information. If you have immediate comments or have found errors, please contact us via the Feedback tab on Trafiklab. Later in the autumn we will also send out a survey to the users who have requested an API key, and contact some users for a possible interview about how the APIs are perceived.
The work of making the information available is supported by Vinnova.