Query Deutsche Bahn train connections and prices.
Query train connections and prices via the Deutsche Bahn API.
Binary: dbrest (Homebrew: timkrase/tap/dbrest)
dbrest locations "station name"
Output: Tab-separated list with ID, Name, Type.
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
dbrest --json journeys --from 8000207 --to 8000261 --results 5
Prices are at journeys[].price.amount and journeys[].price.currency.
dbrest departures --stop <ID> --results 10
dbrest arrivals --stop <ID> --results 10
dbrest --json journeys ...