Skip to content

Instantly share code, notes, and snippets.

@DRSchlaubi
Last active October 19, 2025 23:09
Show Gist options
  • Select an option

  • Save DRSchlaubi/ea442c7c93e142b167479eb930e7c8bd to your computer and use it in GitHub Desktop.

Select an option

Save DRSchlaubi/ea442c7c93e142b167479eb930e7c8bd to your computer and use it in GitHub Desktop.
Deutsche Bahn unofficial APIs

Deutsche Bahn APIs

This is a list of public Deutsche Bahn AG APIs, which anyone can use.

RIS::Stations

Documentation: https://developers.deutschebahn.com/db-api-marketplace/apis/product/ris-stations/api/ris-stations

Available under the following URLs (instead of apis.deutschebahn.com):

RIS::Boards

Documentation: https://developers.deutschebahn.com/db-api-marketplace/apis/product/ris-boards-netz

Frontend available under: http://ris-abfahrtstafel.noncd.db.de/

Available under the following URLs (instead of apis.deutschebahn.com):

RIS::Journeys

Documentation: https://developers.deutschebahn.com/db-api-marketplace/apis/product/ris-journeys-netz

Available endpoints:

RIS::Routing

Documentation: sadly they're currently now docs I can share

Napkin Docs
 POST /multimodal

  {"origin":{"evaNumber":"<eva>","type":"STOP_PLACE"},"destination":{"evaNumber":"<eva>","type":"STOP_PLACE"},"departureTime":"2025-10-19T22:52:54.249Z","navigationContext":"","maxChanges":5,"matchIDs":true,"provider":"HAFAS","persona":"OCCASIONAL_TRAVELLER"}

Available under URLs:

RIS::Transports

Documentation: sadly they're currently now docs I can share

Napkin Docs
POST https://wifi-landingpage.dbregio.de/api/transports/occupancies

{
  "journeys": [
     {"journeyID": "<ris journey id>", "departureID": "<departureId>" // only request for this departure; optional
  ]
}

Available under the following urls:

DB Regio CSRF protection

Endpoints under the Vwifi-landingpage.dbregio.de Domain use an easily bypassable CSRF protection, the followings steps are required:

  1. Requesting CSRF token A CSRF token can be requested by requesting https://wifi-landingpage.dbregio.de/, which will contains 2 pieces of data:
  • A cookies called __Host-csrf
  • An HTML meta tag called csrf-token
  1. Authorizing the request

In order to authorize the request you have to send both the cookie (identical to how you received it) and the value of the meta tag as the value of the Csrf-Token header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment