Berlin Transport

Transport API · Works in Berlin, Germany · BVG public transit · Free API key required

TL;DR

The Berlin Transport (BVG) API provides real-time public transit data for Berlin, Germany. Access departure times, route plans, station information, and service status for U-Bahn, S-Bahn, buses, trams, and ferries. Get live departures from any station, plan journeys between locations, and look up line routes. JSON format with free API key registration. Vital for Berlin travel apps and navigation tools.

Quick start: https://v6.bvg.transport.rest/stops/900000003201/departures?accessId=YOUR_API_KEY

How to Use This API

1. Get Station Departures

https://v6.bvg.transport.rest/stops/900000003201/departures?accessId=YOUR_API_KEY

2. JavaScript — Real-Time Departure Board

fetch('https://v6.bvg.transport.rest/stops/900000003201/departures?accessId=YOUR_KEY')
  .then(r => r.json())
  .then(data => {
    data.departures.slice(0, 5).forEach(d => {
      const time = new Date(d.when).toLocaleTimeString();
      console.log(`${d.line.name} → ${d.direction}: ${time} (${d.delay} min delay)`);
    });
  });

3. Python — Journey Planning

import requests

params = {
    'from': '900000003201',  # Alexanderplatz
    'to': '900000009102',    # Zoo
    'accessId': 'YOUR_KEY'
}
data = requests.get(
    'https://v6.bvg.transport.rest/journeys', params=params
).json()

for leg in data['journeys'][0]['legs']:
    print(f"{leg['line']['name']} from {leg['origin']['name']} "
          f"to {leg['destination']['name']}")
Alexanderplatz departures: https://v6.bvg.transport.rest/stops/900000003201/departures

Frequently Asked Questions

What transport modes are covered?
U-Bahn (subway), S-Bahn (commuter rail), buses (MetroBus, ExpressBus, night buses), trams, and ferries within Berlin.
How do I get an API key?
Register at the BVG developer portal or use the transport.rest API which wraps BVG data with a simpler interface and free access.
What station IDs should I use?
Use the /stops endpoint to search for stations. Example: Alexanderplatz is 900000003201, Zoologischer Garten is 900000009102.
What data is included in responses?
Departure time (scheduled + real-time), delay, line name, direction, platform/platform changes, and vehicle type. Journey responses include transfers and walking sections.
Are disruptions and service changes included?
Yes, the API includes real-time disruption data, line status (running, suspended, diverted), and schedule changes.
What is the update frequency?
Real-time departure data updates every 30-60 seconds. Schedule changes are reflected as soon as they are published by BVG.

API Details

API URL
https://v6.bvg.transport.rest
Documentation
v6.bvg.transport.rest/docs
Category
Transport
Authentication
Free API Key
Geographic Coverage
Berlin, Germany (DE)

What You Can Build