Find a file
2024-12-17 16:04:41 +00:00
.github build workflow 2024-12-17 16:04:41 +00:00
docs drawbacks dbnav api 2024-12-16 21:35:23 +00:00
format fix bad rename 2024-12-17 14:56:51 +00:00
lib refreshJourney with tickets, loyaltyCard/firstClass rest support, accept-lang 2024-12-11 23:51:58 +00:00
p/db dbnav boards wip 2024-12-16 21:33:10 +00:00
parse boards: correctly handle missing rt info 2024-12-12 12:10:09 +00:00
test boards: correctly handle missing rt info 2024-12-12 12:10:09 +00:00
.dockerignore fix docker build 2024-12-17 15:39:56 +00:00
.editorconfig Node 6+, cleanup 2016-12-14 00:22:02 +01:00
.eslintrc.json linting: add rules based on @stylistic/eslint-plugin 2024-02-10 16:49:38 +01:00
.gitignore fix docker build 2024-12-17 15:39:56 +00:00
api.js refreshJourney with tickets, loyaltyCard/firstClass rest support, accept-lang 2024-12-11 23:51:58 +00:00
contributing.md contributing.md: link to testing docs 📝 2023-12-07 00:54:56 +01:00
Dockerfile fix docker build 2024-12-17 15:39:56 +00:00
index.js refreshJourney with tickets, loyaltyCard/firstClass rest support, accept-lang 2024-12-11 23:51:58 +00:00
license.md readme: link to Travel-Status-DE-HAFAS 📝 2024-01-18 15:27:29 +01:00
package-lock.json fix docker build 2024-12-17 15:39:56 +00:00
package.json remove hafas-client dep 2024-12-16 12:02:47 +00:00
readme.md docs, dumps 2024-12-16 20:22:36 +00:00
retry.js apply linting rules 2024-02-10 16:50:12 +01:00
throttle.js apply linting rules 2024-02-10 16:50:12 +01:00

db-vendo-client

A client for the new "vendo" bahn.de APIs, a drop-in replacement for hafas-client.

ISC-licensed support Jannis via GitHub Sponsors

This is a very early version. What works:

  • journeys(), refreshJourney() including prices
  • locations(), nearby()
  • departures(), arrivals() boards

What doesn't work (yet, see TODO's scattered around the code):

  • journeys() details like scheduledDays, stop/station groups, some line details ...
  • journeys() uses different tripIds compared to departure and arrival boards...
  • certain stop details like products for locations() and geopositions and remarks for boards
  • some query options/filters (e.g. direction for boards)
  • all other endpoints

Feel free to report anything that you stumble upon via Issues or create a PR :)

Also consult the relevant documentation of hafas-client (but beware of the limited functionality of db-vendo-client).

Background

After DB has switched to the new "vendo" platform for bahn.de and DB Navigator, the old HAFAS API (see hafas-client) seems to become less and less reliable (server unreachable, missing prices, etc.) This project aims to enable easy switching to the new APIs. However, not all information will be available from the new APIs.

Actually, db-vendo-client is a wrapper around multiple different APIs, currently the bahn.de API for route planning and the regio-guide RIS API for boards. See some notes about the various new APIs at DB.

Strictly speaking, permission is necessary to use this library with the DB APIs.

Usage

See an example in api.js. It shows how you can use db-vendo-client together with hafas-rest-api in order to run a FPTF API server. The Dockerfile serves this API.

There are community-maintained TypeScript typings available as @types/hafas-client.

  • hafas-client including further related projects
  • hafas-rest-api expose a hafas-client or db-vendo-client instance as a REST API
  • db-rest for the legacy DB HAFAS endpoint
  • *.transport.rest  Public APIs wrapping some HAFAS endpoints.

Contributing

If you have a question, found a bug or want to propose a feature, please open an Issue.

This project needs help! Check the list of "help wanted" Issues.

If you're contributing code, please read the contribution guidelines.