db-bahn

timkrase's avatarfrom timkrase

Query Deutsche Bahn train connections and prices.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 4, 2026⬇️1downloads

When & Why to Use This Skill

The DB Bahn Claude skill enables seamless integration with Deutsche Bahn's rail network data, allowing users to query real-time train connections, ticket prices, and live station schedules. By utilizing the dbrest CLI, this tool simplifies travel logistics and provides up-to-date information for rail transit across Germany and neighboring European countries.

Use Cases

  • Travel Planning: Effortlessly find the fastest or most convenient train routes between German cities by querying station IDs and journey times.
  • Budget Optimization: Access real-time pricing for long-distance ICE and IC trains to compare costs and book the most economical travel options.
  • Commuter Assistance: Check live departure and arrival boards for specific stations to stay informed about delays, cancellations, or platform changes.
  • Cross-Border Transit: Plan international rail trips to countries like Switzerland (CH) and Austria (AT) using the extensive Deutsche Bahn network database.
namedb-bahn
descriptionQuery Deutsche Bahn train connections and prices.
homepagehttps://github.com/timkrase/homebrew-tap
metadata{"clawdis":{"emoji":"🚂","requires":{"bins":["dbrest"]},"install":[{"id":"brew","kind":"brew","formula":"timkrase/tap/dbrest","bins":["dbrest"],"label":"Install dbrest (brew)"}]}}

DB Bahn Skill 🚂

Query train connections and prices via the Deutsche Bahn API.

CLI: dbrest

Binary: dbrest (Homebrew: timkrase/tap/dbrest)

Find stations

dbrest locations "station name"

Output: Tab-separated list with ID, Name, Type.

Search connections

dbrest journeys --from <ID> --to <ID> [--departure ISO8601] [--results N]

Important: --from and --to require station IDs (IBNR), not names!

Workflow:

# 1. Find station IDs
dbrest locations "Köln Hbf"        # → 8000207
dbrest locations "München Hbf"     # → 8000261

# 2. Search journeys
dbrest journeys --from 8000207 --to 8000261 --results 5

With prices (JSON)

dbrest --json journeys --from 8000207 --to 8000261 --results 5

Prices are at journeys[].price.amount and journeys[].price.currency.

Live departures

dbrest departures --stop <ID> --results 10

Live arrivals

dbrest arrivals --stop <ID> --results 10

Notes

  • Prices only for long-distance trains — S-Bahn/regional trains often have no price
  • International stations (CH, AT, etc.) work ✅
  • Global flags before command: dbrest --json journeys ...