Developing with Trafiklab

Best practices

Combining data and APIs

Most of our APIs and datasets are based on different databases and systems, which results in different ids. However, some datasets can be combined. Datasets that can be combined GTFS Regional and GTFS Regional Realtime GTFS Regional and GTFS Regional Realtime are backed by the same system. They are meant to be used together. GTFS Sverige 2 and the ResRobot APIs GTFS Sverige 2 uses the same stop-id’s as the ResRobot APIs.

Example solutions

Want to see what you can do with open data? We have some example solutions, showing you, among other things, how you can set up your own voice assistant to tell you when the next train leaves, or how to build a timetable from GTFS. These examples can form the basis of your next awesome project!

Our SDKs and libraries

If you’re using PHP, you’re lucky! We developed open-source SDKs which offer those 3 features, both for the ResRobot and SL APIs. They are interchangeable, meaning your code doesn’t need any modification to change the data source. They are also updated when APIs are updated, meaning you don’t get breaking changes in your code. The SDKs can be found at GitHub: ResRobot: SL: Installation is as easy as composer require trafiklab/resrobot-php-sdk or composer require trafiklab/sl-php-sdk.

The right data for your project

Departure boards A departure board contains simple yet extremely useful public transport data. Departure and arrival … Obtaining stop ids ResRobot and GTFS Sverige 2 ResRobot and GTFS Sverige 2 use the same ids for stops. You can … Route-planning Route-planning can be intimidating. A route-planner needs a lot of data and processing time in order … Creating a map with travel times When creating a map with travel times from one stop to different places, also known as an isochrone map, you need to make hundreds till even tens of thousands of API calls.

Using GTFS Files

What is GTFS? The General Transit Feed Specification is a file format which originally was developed by Google in 2006. It combines all the data in one compact file. This means you can download a single file to get timetable information for the entirety of Sweden. The GTFS Standard consists of 2 parts: static and real-time data. In the following sections, we will help you to get started with both.