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 🙏

© 2026 – Pkg Stats / Ryan Hefner

dbahn-search

v1.1.1

Published

CLI tool to search Deutsche Bahn train journeys with BahnCard and Deutschlandticket support

Readme

dbahn-search

CLI tool for searching Deutsche Bahn train journeys. Built on db-vendo-client, the current library for DB's Vendo/Movas API.

Install

npm install -g dbahn-search

Or run directly with npx:

npx dbahn-search "Berlin Hbf" "Hamburg Hbf"

Usage

dbahn-search <from> <to> [datetime] [options]

Examples

# Search for trains departing now
dbahn-search "Berlin Hbf" "Hamburg Hbf"

# Specific date and time
dbahn-search "Berlin Hbf" "München Hbf" "2026-04-20 10:00"

# Time only (uses today's date)
dbahn-search "Frankfurt Hbf" "Köln Hbf" "14:30"

# Find cheapest journeys across the day
dbahn-search "Berlin Hbf" "München Hbf" "2026-04-20" --bestprice

# With BahnCard 50 discount
dbahn-search "Berlin Hbf" "Hamburg Hbf" --bahncard 50

# With Deutschlandticket
dbahn-search "Berlin Hbf" "Dresden Hbf" --deutschlandticket

# Combine discounts
dbahn-search "Berlin Hbf" "München Hbf" "2026-04-20" --bahncard 50 --deutschlandticket --bestprice

# Limit transfers
dbahn-search "Marburg (Lahn)" "Berlin Hbf" --transfers 1

# JSON output (for scripting)
dbahn-search "Berlin Hbf" "Hamburg Hbf" --json

Find the cheapest day

# Cheapest day in the next 7 days
dbahn-search "Berlin Hbf" "München Hbf" --cheapest

# Cheapest day in a specific range
dbahn-search "Berlin Hbf" "München Hbf" --cheapest 2026-04-14 2026-04-28

# Cheapest day in a full month
dbahn-search "Berlin Hbf" "Hamburg Hbf" --cheapest 2026-05

# Combine with BahnCard and Deutschlandticket
dbahn-search "Berlin Hbf" "München Hbf" --cheapest --bahncard 50 --deutschlandticket

Options

| Flag | Description | |------|-------------| | --results N | Number of results (default: 5) | | --bestprice | Find cheapest journeys across the day | | --cheapest [start] [end] | Find cheapest day in a date range | | --first-class | Search first class prices | | --transfers N | Maximum number of transfers | | --bahncard N | Apply BahnCard discount (25, 50, or 100) | | --deutschlandticket | Show prices with Deutschlandticket | | --json | Output raw JSON | | -h, --help | Show help |

Output

Each result shows departure/arrival times, duration, transfers, train types, price, and a direct booking link to bahn.de:

Berlin Hbf -> Hamburg Hbf  ·  Sat, 20 Apr 2026
────────────────────────────────────────────────────────────

 #1  10:02 -> 11:45  (1h 43m)  ·  direct  ·  ICE 1007
     Price: 23.90 EUR
     https://www.bahn.de/buchung/fahrplan/suche#...

 #2  11:02 -> 12:45  (1h 43m)  ·  direct  ·  ICE 1009
     Price: 27.90 EUR
     https://www.bahn.de/buchung/fahrplan/suche#...

How it works

dbahn-search queries Deutsche Bahn's current APIs via db-vendo-client. Station names are resolved using both the DB Navigator API and bahn.de's location API (for generating accurate booking links).

Prices shown are Sparpreis/Super Sparpreis fares when available. For exact fares and booking, follow the provided bahn.de links.

Support

If you find this useful, consider buying me a coffee.

License

MIT