A comprehensive Python CLI tool for tracking Copenhagen's public transport in real-time. Reverse-engineered from rejseplanen.dk's live map API with support for S-trains, Metro, Letbane, buses, and regional trains.
- Real-time vehicle tracking - Live positions, delays, and destinations
- Multi-transport support - S-train, Metro, Letbane, IC/RE trains, buses
- Route visualization - See complete route with passed/current/upcoming stations
- Interactive selection - Choose transport type and filter by line
- Station name mapping - Coordinates resolved to actual station names
- Progress tracking - Percentage complete along route
# Clone the repository
git clone https://github.com/rvibek/rejseplanen-tracker.git
cd rejseplanen-tracker
# Install dependencies
pip install -r requirements.txt
# Run the tracker
python3 app.py-
Select transport type (0-8):
- 1: S-train (lines A, B, Bx, C, E, F, H)
- 2: Metro (M1, M2, M3, M4)
- 3: Letbane/Light Rail
- 4: IC Trains
- 5: RE Trains
- 6: Øresund trains
- 7: Havnebus (Waterbus)
- 8: City Bus
- 0: All Transport
-
Optional line filter - Enter specific line (e.g., "B" for S-train line B)
-
View results showing:
- Vehicle position and ID
- Route progress percentage
- Current station with visual indicator
- Passed and upcoming stations
- Delay information
VEHICLE 1: B
Train ID: 84/49430/18/19/86
Position: (12509506, 55663903)
Destination: Farum St.
Delay: 1 minutes
ROUTE PROGRESS: 17.1%
Position index: 51/298
STATIONS ON ROUTE:
PASSED Rødovre St.
PASSED Hvidovre St.
CURRENT Danshøj St.
UPCOMING Valby St.
UPCOMING Carlsberg St.
This tool orchestrates three distinct Rejseplanen APIs:
- Vehicle API (
performLocating=1) - Real-time positions and metadata - Station API (
performLocating=2) - Station coordinates and names - Route Geometry API (
performLocating=16) - Complete route paths
See API_DOCUMENTATION.md for detailed endpoint documentation.
| Code | Transport Type | Notes |
|---|---|---|
| 016 | S-train | A, B, Bx, C, E, F, H lines |
| 1024, 034 | Metro | M1, M2, M3, M4 |
| 2048, 070 | Letbane | Light Rail |
| 128 | Havnebus | Copenhagen Harbor |
| 032 | City Bus | Regular buses |
| 001-099 | Trains | IC, ICL, RE, Øresund |
rejseplanen-tracker/
├── app.py # Main application (multi-API orchestration)
├── app_v09.py # Initial vehicle tracker version
├── app_v99.py # Intermediate version with station mapping
├── API_DOCUMENTATION.md # Complete API reference
├── requirements.txt # Python dependencies
├── LICENSE # MIT License
└── README.md # This file
- app_v09.py - Basic vehicle tracker (single API endpoint)
- app_v99.py - Enhanced version with station name mapping
- app.py - Final version with full route visualization
- Python 3.8+
- requests library
- Internet connection (API calls to rejseplanen.dk)
This is an unofficial project for educational purposes. All data belongs to Rejseplanen/DSB. Use responsibly and respect rate limits.
Vibek Raj Maurya - rvibek.com.np
Developed using AI-assisted "vibe coding" with the kimi k2.5 model in Opencode.
MIT License 2026 - See LICENSE file for details.