Skip to content

Latest commit

 

History

History
41 lines (22 loc) · 2.84 KB

readme.md

File metadata and controls

41 lines (22 loc) · 2.84 KB

v6.db.transport.rest documentation

v6.db.transport.rest is a REST API for the public transportation system in Germany.

The API is currently unavailable!

The underlying DB HAFAS API is currently not available, and it seems like it has been shut off permanently. We're considering changing db-rest to use db-vendo-client, please follow Issue #60 for updates.

You can also use db-vendo-client yourself as a replacement, it covers most of the use cases served by db-rest, but the underlying APIs seem to have a much lower rate limit.

API status

How it works

Because it wraps an API 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.

Why use this API?

Realtime Data

This API returns realtime data whenever it is upstream. 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.