Skip to content

rvibek/rejseplanen-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rejseplanen Live Tracker

Python 3.8+ License: MIT

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.

Features

  • 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

Quick Start

# 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

Usage

  1. 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
  2. Optional line filter - Enter specific line (e.g., "B" for S-train line B)

  3. View results showing:

    • Vehicle position and ID
    • Route progress percentage
    • Current station with visual indicator
    • Passed and upcoming stations
    • Delay information

Example Output

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.

API Architecture

This tool orchestrates three distinct Rejseplanen APIs:

  1. Vehicle API (performLocating=1) - Real-time positions and metadata
  2. Station API (performLocating=2) - Station coordinates and names
  3. Route Geometry API (performLocating=16) - Complete route paths

See API_DOCUMENTATION.md for detailed endpoint documentation.

Transport Codes Discovered

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

Project Structure

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

Development Versions

  • 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

Requirements

  • Python 3.8+
  • requests library
  • Internet connection (API calls to rejseplanen.dk)

Disclaimer

This is an unofficial project for educational purposes. All data belongs to Rejseplanen/DSB. Use responsibly and respect rate limits.

Author

Vibek Raj Maurya - rvibek.com.np

Developed using AI-assisted "vibe coding" with the kimi k2.5 model in Opencode.

License

MIT License 2026 - See LICENSE file for details.

About

Python CLI tool to track public transport around Copenhagen in real-time via reverse-engineered rejseplanen.dk APIs. Features S-trains, Metro, buses with route visualization & station mapping.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages