A free, publicly accessible map showing the live GPS positions of all SL public transport vehicles across Stockholm County. No login required.
GPS positions for all SL transport modes, fetched from Trafiklab every 2 seconds.
Metro, tram and commuter rail lines drawn on the map. Vehicles snap to their tracks.
Click any station marker to see real-time next departures, updated every 30 seconds.
Plan trips between any two stops with real-time departure times and transfer details.
Switch between dark and light map styles. Your preference is remembered.
Fully responsive — works on desktop, tablet and mobile without any app install.
The server fetches vehicle positions from Trafiklab every 2 seconds and caches them in memory. All connected browsers are served from this single cache — meaning API call volume is fixed regardless of how many visitors are watching simultaneously.
SL's GPS vehicle positions are published as a GTFS Realtime protobuf feed, updated every 2 seconds. Fetched server-side using a Gold tier API key.
A Python/Flask server parses the protobuf feed, enriches vehicles with line info from the GTFS static dataset, and caches the result in memory.
Nginx sits in front of Flask, caching the /api/vehicles response for 2 seconds to absorb traffic spikes while keeping data fresh.
The frontend polls every second and animates vehicle markers smoothly between positions using requestAnimationFrame. Rail vehicles snap to their track geometry.
All transport data is provided by Trafiklab (Samtrafiken), the open data platform for Swedish public transport.
| Source | What it provides | Update rate |
|---|---|---|
| GTFS Regional Realtime | Live vehicle GPS positions for all SL modes | Every 2s |
| GTFS Regional Static | Route geometry, stop locations, line names | Monthly |
| SL Transport API | Real-time departure boards per station | Every 30s |
| SL Journey Planner v2 | Trip planning between stops | On demand |
| Component | Technology |
|---|---|
| Backend | Python · Flask · Gunicorn |
| Frontend | Vanilla JavaScript · Leaflet.js |
| Map tiles | CartoDB Basemaps (dark & light) |
| Reverse proxy | Nginx · Traefik |
| Infrastructure | Docker · Docker Compose · Self-hosted |
| Analytics | Plausible CE (self-hosted, privacy-friendly) |
This site uses self-hosted Plausible Analytics — a privacy-friendly analytics tool that does not use cookies, does not collect personal data, and does not share data with third parties. No advertising. No login required.
Questions, feedback or suggestions? Reach out at stockholmtransit.live@gmail.com