Transport for Germany API
Overview
The Deutsche Bahn (DB) Fahrplan API provides train schedule data for Germany's national railway network, including departure and arrival times, station information, and journey details. A free API key can be obtained via the DB developer portal. It is the go-to data source for building German rail travel applications.
Beginner Tip
Get a free API key by registering at developer.deutschebahn.com, then include it as the Authorization: Bearer header in requests. Start with the /location endpoint to look up station IDs before querying timetables.
Available Data
Example Response
{
"route": "Line 1",
"origin": "Station A",
"destination": "Station B",
"departure": "08:30",
"arrival": "09:15",
"status": "On Time",
"delays_min": 0
} Field Reference
id EVA number — the unique station identifier used in DB systems name Official name of the railway station lon Longitude of the station location lat Latitude of the station location products Bitmask indicating which train products serve this station Implementation Example
const url = "http://data.deutschebahn.com/dataset/api-fahrplan";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"X-API-Key": "YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Partially tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →AIS Hub
AIS Hub aggregates real-time Automatic Identification System data from a global network of shore-based receivers to track marine vessels.
AZ511
AZ511 is the official Arizona Department of Transportation traffic data API providing real-time road conditions, incidents, and camera information for Arizona highways.
Bay Area Rapid Transit
⭐ Beginner's PickThe BART API provides real-time train arrival predictions, station information, and service advisories for the Bay Area Rapid Transit system in the San Francisco Bay Area.
BlaBlaCar
BlaBlaCar provides programmatic access to search car sharing trips via REST API.
Boston MBTA Transit
⭐ Beginner's PickThe Boston MBTA Transit API gives you real-time data for the Massachusetts Bay Transportation Authority, including train, bus, and ferry arrivals.