Skip to content
API Builders
TF

TransportationPublic API

Transport for Germany

Deutsche Bahn (DB) API

Visit documentationSnapshot 2026-10-26

Before you call it

What this listing means in practice

01

You will need an API key

Register with the provider, create a key and send it in the header or query parameter their documentation specifies. Keys usually belong in environment variables, never in client-side code.

02

Listed as HTTP only

Prefer a provider endpoint with TLS before shipping this to production. Calling over plain HTTP exposes request and response data in transit.

03

CORS not confirmed

If CORS is not enabled, call this API from a server, serverless function or build step and proxy the response to your frontend.

Documentationexternal

Start with the provider's own documentation. It is the only place where endpoints, rate limits, pricing and terms are authoritative.

http://data.deutschebahn.com/dataset/api-fahrplan

No API calls are proxied by this directory. Links go directly to the provider.

API listings describe access requirements, not endorsements. Review each provider's privacy policy, terms and rate limits.

Overview

About Transport for Germany

Transport for Germany needs an API key, like 40 other transportation APIs in the directory. If you want something to test with straight away, 47 transportation APIs need no key at all.

It is listed as HTTP only. 82 of 97 transportation APIs support HTTPS, so look at those first if this is going into production.

Documentation is on data.deutschebahn.com.

Transportation APIs in general

Transport APIs cover public transit timetables, real-time arrivals, bike shares, flights, trains and road traffic, often from city transit agencies.

What people build with them

  • Next-departure boards
  • Journey planners
  • Commute alerts

Watch out for

Real-time feeds can drop out for whole lines. Fall back to the timetable and tell users the data is scheduled, not live.

First request

Calling Transport for Germany

Check the docs for the exact header or query parameter name. Some providers use X-API-Key or ?apikey= instead of a Bearer token.

JavaScript (server)// Keep the key in an environment variable, never in frontend code
const res = await fetch("http://data.deutschebahn.com/dataset/api-fahrplan/<endpoint>", {
  headers: { Authorization: `Bearer ${process.env.TRANSPORT_FOR_GERMANY_API_KEY}` },
});
const data = await res.json();

Compare

Transport for Germany vs similar APIs

APIAuthHTTPSCORS
Transport for GermanyAPI keyNoUnknown
GTFS ScorecardNo keyYesYes
ConnectMeGuruNo keyYesYes
ChargeAlongNo keyYesYes
Can I enterNo keyYesYes
BC FerriesNo keyYesYes

FAQ

Common questions about Transport for Germany

Does Transport for Germany need an API key?

Yes. You need to register with Transport for Germany and send your key with each request, as described in its documentation.

Can I call Transport for Germany from the browser?

CORS is not confirmed, so the browser may block direct calls. Call it from your server or a serverless function and pass the result to your frontend.

Is Transport for Germany free?

We do not track pricing. Many keyed APIs have a free tier with limits. The Transport for Germany documentation lists current plans.

What are some alternatives to Transport for Germany?

Other transportation APIs in the directory include GTFS Scorecard (no key), ConnectMeGuru (no key), ChargeAlong (no key). The comparison table on this page shows how they differ on authentication, HTTPS and CORS.

Next step

Keep looking until the constraints fit.

Filter the directory by authentication, HTTPS and CORS, or start from a category and work backwards.