Overview
Transport for Sweden (Trafiklab) is a developer platform providing access to public transport data across all of Sweden. It offers real-time departures, trip planning, and historical data from operators like SL (Stockholm) and Skanetrafiken. OAuth authentication is required, so you will need to register for a free developer account at trafiklab.se.
Beginner Tip
Register at trafiklab.se to get your API keys — most datasets offer a generous free tier for development. Start with the ResRobot API for nationwide trip planning as it covers all Swedish public transport.
Available Data
Example Response
{
"route": "Line 1",
"origin": "Station A",
"destination": "Station B",
"departure": "08:30",
"arrival": "09:15",
"status": "On Time",
"delays_min": 0
} Field Reference
Departure List of upcoming departures from the requested stop. Departure[].name Name of the transport line or service. Departure[].time Scheduled departure time in HH:MM:SS format. Departure[].date Scheduled departure date in YYYY-MM-DD format. Departure[].stop Name of the departure stop. Departure[].transportNumber The line number or service identifier. Implementation Example
// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://www.trafiklab.se/api";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"Authorization": "Bearer YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Partially tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →Amadeus for Developers
Amadeus for Developers is an OAuth2-protected travel API offering flight search, hotel availability, airport information, and more from one of the largest global distribution systems.
apilayer aviationstack
Aviationstack by apilayer provides real-time flight status, schedules, and global aviation data including airports and airlines.
BIC-Boxtech
BIC-Boxtech provides technical specifications for shipping containers in the global fleet, including dimensions, tare weight, and capacity details.
Grab
The Grab API allows developers to integrate Grab services — including ride-hailing, food delivery, and payments — into their own applications across Southeast Asia.
Transport for Sao Paulo, Brazil
The SPTrans Olho Vivo API provides real-time bus tracking data for São Paulo's massive municipal bus system in Brazil, one of the largest in the world.