npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

db-vendo-client

v6.10.6

Published

Client for bahn.de public transport APIs.

Readme

db-vendo-client

A client for the new "vendo"/"movas" Deutsche Bahn APIs, a drop-in replacement for hafas-client.

npm version ISC-licensed support Jannis via GitHub Sponsors

The following FPTF/hafas-client endpoints are supported (depending on the chosen profile, see below):

  • journeys(), refreshJourney() including tickets and bestprice option
  • locations(), nearby(),
  • departures(), arrivals() boards
  • trip()

What doesn't work:

  • journeys() details like stop/station groups, some line details ...
  • loadFactor and other details in boards
  • certain stop details like products for locations() and geopositions for boards – this can be remedied with enrichStations in the config (turned on by default), enriching stop info with db-hafas-stations.
  • some query options/filters (e.g. routingMode for journeys, direction for boards)
  • all other endpoints (tripsByName(), radar(), journeysFromTrip(), reachableFrom(), remarks(), lines(), station())

Depending on the configured profile, db-vendo-client will use multiple different DB APIs that offer varying functionality, so choose wisely:

| Profile | db | dbnav | dbweb | dbris | | ------------- | ------------- | ------------- | ------------- | ------------- | | no API key required | ✅ | ✅ | ✅ | ❌ | | all above endpoints supported | ✅ | ✅ | except stop() | only boards | | duration for boards | always 1h | always 1h | always 1h | up to 12h | | remarks | for boards only most important remarks | for boards only most important remarks | all remarks on boards and journeys | all remarks | | cancelled trips | contained with cancelled flag | contained with cancelled flag | contained with cancelled flag | contained with cancelled flag | | tickets | only for refreshJourney(), mutually exclusive with polylines | only for refreshJourney(), mutually exclusive with polylines | only for refreshJourney(), mutually exclusive with polylines | ❌ | | polylines | only for refreshJourney()/trip(), mutually exclusive with tickets | only for refreshJourney()/trip(), mutually exclusive with tickets | only for refreshJourney()/trip(), mutually exclusive with tickets | ❌ | | trip ids used | HAFAS trip ids | HAFAS trip ids | HAFAS trip ids | RIS trip ids | | line.id/fahrtNr used | actual fahrtNr for journeys, unreliable/route id for boards and trip() | actual fahrtNr for journeys, unreliable/route id for boards and trip() | unreliable/route id | ✅ | | adminCode/operator | only for journeys | only for journeys | only operator | ✅ | | stopovers | not in boards | not in boards | ✅ | ✅ | | assumed backend API stability | less stable | more stable | less stable | more stable | | quotas | 60 requests per minute (IPv4), current backend possibly shut off soon | 60 requests per minute (IPv4), possibly aggressive blocking | aggressive blocking (IPv4/IPv6) | depends on API key |

[!IMPORTANT] If you think that for your project, quotas may become an issue, consider alternative ways to obtain the data you need., e.g. motis-fptf-client (a drop-in replacement for db-vendo-client/hafas-client) in conjunction with https://transitous.org (please consider the usage policy there) or a self-hosted MOTIS instance.

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

Also consult the documentation.

Background

After DB has switched to the new "vendo"/"movas" platform for bahn.de and DB Navigator, the old HAFAS API (see hafas-client) seems now to have been shut off. 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 dbweb, the DB Navigator API for the dbnav profile, and a combination of the DB Navigator API and the regio-guide RIS API for the db profile. See some notes about the various new APIs at DB.

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

Usage

Use it as a dependency, e.g. just replacing hafas-client:

npm i db-vendo-client

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 (using the dbnav profile):

docker run \
    -e USER_AGENT=my-awesome-program \
    -e DB_PROFILE=dbnav \
    -p 3000:3000 \
    ghcr.io/public-transport/db-vendo-client

You may want to generate a client for your programming language for this REST API using the OpenAPI schema (open in Swagger Editor). Note that this is to be seen more as a starting point for implementation, e.g. some profile-specific details like tickets are missing from this API definition.

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

[!IMPORTANT] Depending on your use case, it is very important that you employ caching, either with a simple HTTP proxy cache in front of the REST API or by using cached-hafas-client (where, of course, you can just drop in a db-vendo-client instead of a hafas-client instance). Also see db-rest, which does this and some more plumbing.

Browser usage

db-vendo-client is mostly browser compatible, however none of the endpoints enables CORS, so it is impossible to use db-vendo-client in normal browser environments. It was tested with vite + capacitorjs and should also work with cordova or react native and similar projects.

Limitations: Does not work with enrichStations option enabled or with the dbris profile.

Related Projects

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.