Overview
Transport for Germany offers an API platform designed to provide comprehensive access to public transportation data throughout Germany. Launched in 2024, the service caters to developers and technical buyers who require up-to-date and historical transit information for various applications. The platform's core products include a Real-time GTFS-RT API, access to historical GTFS data, and a Route Planning API, enabling a range of use cases from real-time passenger information systems to complex logistics optimization projects.
The API is particularly suited for mobility app development, allowing companies to integrate live departure times, service alerts, and route suggestions into their consumer-facing applications. For instance, a developer could use the Real-time GTFS-RT API documentation to display the precise current location of buses and trains on a map, or to notify users about delays. Urban planners and analysts can utilize the historical GTFS data to analyze transit patterns, assess network efficiency, and inform infrastructure development decisions. This historical data provides a foundation for understanding passenger flow and service reliability over time, which is critical for long-term strategic planning.
Furthermore, businesses involved in logistics and last-mile delivery can integrate the Route Planning API to optimize their operations by factoring in public transport availability and schedules. This can be particularly useful for services that combine public transit with other modes of transport, or for delivery services operating within dense urban environments where public transport routes may offer efficiencies. The developer experience is supported by a well-documented REST API, complete with clear examples and client libraries available for popular programming languages such as Python and JavaScript. The developer portal provides straightforward access to API keys and allows monitoring of usage metrics, facilitating efficient integration and management.
Transport for Germany emphasizes compliance with data protection regulations, including GDPR, ensuring that data handling practices meet European standards. This focus on compliance is significant for applications that process or display information related to passenger movements. The platform provides a structured approach to accessing complex transportation datasets, aiming to simplify the development process for integrating public transit information into new or existing digital solutions.
Key features
- Real-time GTFS-RT API: Provides live updates on vehicle positions, service alerts, and trip updates for public transport across Germany. Developers can use this for dynamic mapping and instant passenger notifications.
- Historical GTFS Data Access: Offers static General Transit Feed Specification (GTFS) data, including schedules, routes, and stops, for historical analysis and long-term planning. This data is essential for simulating hypothetical scenarios or validating past service performance.
- Route Planning API: Enables calculation of optimal routes using public transportation, considering factors like time, transfers, and specific modes of transport. This supports integration into journey planners and logistics optimization tools.
- SDKs for Multiple Languages: Official client libraries are available for Python, JavaScript, and Go, streamlining API consumption and reducing development effort.
- Developer Portal: A centralized hub for managing API keys, viewing usage statistics, and accessing comprehensive Transport for Germany API documentation.
- GDPR Compliance: Adheres to General Data Protection Regulation (GDPR) standards for data privacy and security.
Pricing
Transport for Germany offers a tiered pricing model, including a free developer plan and progressively priced paid plans. As of May 2026, the details are as follows:
| Plan Name | Monthly Cost | Monthly Requests | Key Features |
|---|---|---|---|
| Developer Plan | Free | 5,000 | Basic API Access, Community Support |
| Basic Plan | €49 | 50,000 | All Developer features, Email Support |
| Standard Plan | €199 | 250,000 | All Basic features, Priority Email Support, Advanced Analytics |
| Enterprise Plan | Custom | Custom | All Standard features, Dedicated Account Manager, SLA, On-premise options |
For the most current pricing information and detailed feature breakdowns, refer to the official Transport for Germany pricing page.
Common integrations
- Mapping Services: Integrate with mapping platforms like Google Maps Platform documentation to overlay real-time transit data onto geographical maps, enhancing visual representation of transport networks and vehicle movements.
- Notification Systems: Connect to messaging APIs such as Twilio SMS API documentation or push notification services to send users alerts about delays, cancellations, or approaching vehicles based on real-time data.
- Data Visualization Tools: Export historical GTFS data to business intelligence (BI) tools or custom dashboards for in-depth analysis of transit performance, passenger trends, and operational efficiency over time.
- IoT Platforms: Integrate with IoT device data to correlate transit information with sensor data, for example, to understand the impact of weather conditions on public transport punctuality.
- Logistics and Fleet Management Software: Enhance existing logistics systems by incorporating public transport options for multimodal journey planning, optimizing delivery routes, or managing field service personnel.
Alternatives
- Moovit: A global mobility-as-a-service (MaaS) solutions company providing real-time urban mobility data and journey planning for public transit.
- Transit (App): Offers real-time public transit information, trip planning, and shared mobility options primarily through a popular consumer application.
- Google Maps Platform: Provides a suite of APIs and SDKs for location-based services, including comprehensive mapping, routing, and transit information worldwide, supporting a broad range of development needs.
Getting started
To begin using the Transport for Germany API, you first need to obtain an API key from the developer portal. Here's a basic Python example demonstrating how to fetch real-time vehicle positions:
import requests
import os
# Replace with your actual API key from Transport for Germany developer portal
API_KEY = os.environ.get("TRANSPORT_DE_API_KEY")
BASE_URL = "https://api.transportfor.germany/v1"
def get_realtime_vehicle_positions():
endpoint = f"{BASE_URL}/gtfs-rt/vehicle_positions"
headers = {"Authorization": f"Bearer {API_KEY}"}
try:
response = requests.get(endpoint, headers=headers)
response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)
data = response.json()
print("--- Real-time Vehicle Positions ---")
if data and "entity" in data:
for entity in data["entity"][:5]: # Print first 5 entities as an example
vehicle = entity.get("vehicle", {})
trip = vehicle.get("trip", {})
position = vehicle.get("position", {})
print(f"Vehicle ID: {vehicle.get('id', 'N/A')}")
print(f" Trip ID: {trip.get('trip_id', 'N/A')}")
print(f" Route ID: {trip.get('route_id', 'N/A')}")
print(f" Position: Lat {position.get('latitude', 'N/A')}, Lon {position.get('longitude', 'N/A')}")
print("-")
else:
print("No vehicle position data available.")
except requests.exceptions.RequestException as e:
print(f"API request failed: {e}")
except ValueError:
print("Failed to parse JSON response.")
if __name__ == "__main__":
if API_KEY:
get_realtime_vehicle_positions()
else:
print("Error: TRANSPORT_DE_API_KEY environment variable not set.")
print("Please obtain an API key from https://transportfor.germany/developer-portal and set it.")
This Python script initializes with your API key, makes a request to the /gtfs-rt/vehicle_positions endpoint, and prints out details for the first five vehicle entities returned. Ensure your API key is securely stored, preferably as an environment variable, rather than hardcoded directly in your application. For more detailed API usage and other endpoints, consult the Transport for Germany API reference documentation.