v6.db.transport.rest documentation
October 21, 2025 · View on GitHub
v6.db.transport.rest is a REST API for the public transportation system in Germany.
The DB HAFAS API is currently not available, and it seems like it has been shut off permanently.
This wrapper API now uses db-vendo-client as a backend, which covers most of the use cases, notably except for /stops/reachable-from and /radar. Please also note some further limitations and caveats in the readme and documentation of db-vendo-client.
Also, the new underlying APIs seem to have a much lower rate limit than the old HAFAS API. ⚠️ Hence, please check if you can obtain the data needed for your use case in a more efficient manner, e.g. by using the available GTFS feeds.
How it works
Because it wraps APIs of Deutsche Bahn, it includes most of the long-distance and regional traffic, as well as some international trains and local buses. Essentially, it returns whatever data the DB Navigator app shows*, including realtime delays and disruptions.
When comparing results from this API to what the DB Navigator app shows there might be occasional differences due to them utilizing different, not 100% identical backends.
- Getting Started
- API documentation (run
npm run buildto generate) - OpenAPI playground with API documentation
By default, the dbnav profile of db-vendo-client will be used. On all endpoints, you can use the profile URL parameter to change to a different profile, e.g. profile=db or profile=dbweb. As per db-vendo-client's documentation, this will have an impact on returned details, parameter limits and quotas.
Why not to use this API?
Low rate limits
The underlying APIs seem to have a much lower rate limit than before, i.e. you should not use this service to send many requests in an automated manner. Instead, you may:
Use GTFS and GTFS-RT and other datasets
GTFS and GTFS-RT are file format/feed specifications for scheduled timetables and realtime updates like delays, respectively. They enable you to download datasets for entire transport associations, regions or even countries in one go, for local querying (e.g. with MOTIS and motis-fptf-client or OTP) and analysis (e.g. with gtfs-via-postgres and print-gtfs-rt-cli). For Germany, GTFS and GTFS-RT feeds are provided by DELFI e.V. Refined, publicly available feeds based on these and other sources can be obtained via Transitous or from gtfs.de. I.e. by using these you do not need to make any excessive API requests, however, the data quality and coverage of these feeds will currently in many cases still be inferior to what is provided by Deutsche Bahn.
If you're just interested in stops/autocompletion:
Use other APIs
- transitous.org even with worldwide coverage based on GTFS/RT-feeds, however, as with any other APIs, it should not be flooded with requests. To ease migration from
db-rest, it can be used in conjunction with motis-fptf-client - DB (I)RIS-based APIs, if only data on trains is needed (no buses, trams etc.)
- hafas-client with the OEBB profile should also at least contain trains in Germany
Run your own instance of this API
It may help to distribute the load by running your own instance of db-rest/db-vendo-client. Both provide Dockerfiles/Docker images for easy setup of the REST API server. db-rest additionally includes a caching layer (if configured correctly), serves the OpenAPI specification, and does some more plumbing.
Why use this API?
Realtime Data
This API returns realtime data whenever it is available upstream, as the API for DB's mobile app provides it.
Note: Different endpoints might remove realtime data like delays and cancellations at different times, i.e. after a journey's arrival.
No API Key
You can just use the API without authentication. There's a rate limit of 100 requests/minute set up.
CORS
This API has CORS enabled, so you can query it from any webpage.
Caching-friendly
This API sends ETag & Cache-Control headers, allowing clients cache responses properly.