- EXIT STATUS
- BUGS AND LIMITATIONS
db-iris - Interface to the DeutscheBahn online departure monitor
db-iris [-rx] [-d date] [-o output-flags] [-t time] [-v|-V via] [other options ...] station
db-iris is an interface to the DeutscheBahn departure monitor available at https://iris.noncd.db.de/wbt/js/index.html.
It requests all departures at station and lists them on stdout, similar to the big departure screens installed at most main stations. station can be a DS100 station code (such as "EE"), a normal station name (such as "Essen Hbf" or "Dortmund Universität"), or an IBNR / european station number (such as 8000098). If no exact match is found, db-iris will try to find station names similar to station.
An exclamation mark (
!) next to a destination indicates that at least one stop on the train's route has been canceled. Use -oc to see the canceled stops. An exclamation mark next to a platform indicates that it is not the scheduled one.
- -c, --class classlist
Comma-separated list of train classes to filter by. Using this option causes all trains whose class is not in classlist to be discarded.
Valid classes are:
D Non-DB train. Usually local transport F "Fernverkehr", long-distance transport N "Nahverkehr", local and regional transport S S-Bahn, rather slow local/regional transport
- -d, --date date
Request results for date, which is either a date string in in dd.mm. or dd.mm.YYYY format, or
tomorrow. Note that typically only slight (a few hours max) deviations from the current time are supported by the IRIS backend, larger ones will not return data.
- -l, --lookahead int
Do not return results which are more than int minutes in the future. Defaults to 240 (4 hours).
Note that this is only an upper limit, not a guarantee to get every train with a departure in less than int minutes. This guarantee holds only for int below 120. However, any non-negative number is accepted for this option.
- -o, --output outputtypes
For each result, output outputtypes in addition to the normal time, delay, line and destination information. outputtypes is a comma-separated list, this option may be repeated. Each output type has both a short and long form, so both
Valid output types are:
- a / additional
If a train's route deviates from its schedule: Print a list of additional (unscheduled) stops it will serve.
- c / canceled
If a train's route deviates from its schedule: Print a list of canceled stops (scheduled stops which will not be served).
- d / delay
If a train is delayed, show the most recent reason for this delay.
- D / delays
List all delay reasons entered into the IRIS for each train, even if the particular train is on time by now.
- f / fullroute
Show the entire route (both before and after station).
- m / messages
List all messages (delay and qos) entered into the IRIS with timestamps.
- q / qos
List all quality of service messages entered into the IRIS. These contain information like "Missing carriage" or "Broken air conditioning".
Note that some qos messages may supersede older ones. superseded messages are omitted, use the m / messages type to see those as well.
- r / route
Show up to three stops between station and the train's destination.
- R / replacements
For cancelled trains: Print their replacement train(s), if present. For unplanned trains: Print the train(s) they replace, if present.
- t / times
Show both scheduled and expected arrival and departure times.
- -p, --platforms platforms
Only show arrivals/departures at platforms (comma-separated list, option may be repeated). This applies to actual departures, not schedules.
- -r, --realtime
Show estimated instead of scheduled time where available. Cannot be combined with
- -t, --time time
Request results for time in HH:MM or HH:MM:SS format. Note that only slight deviations (a few hours max) from the current time are supported by the IRIS backend, larger ones will not return data.
- -T, --type typelist
Comma-separated list of train types to filter by. Using this option causes all arrivals/departures whose type is not in typelist to be discarded.
The following valid values are known:
local transport: IRE Inter-Regio Express (rare) RB Regionalbahn (slower than RE) RE Regional-Express S S-Bahn regional/interregional transport: D "Schnellzug" (generic fast train, rare) EC Eurocity IC Intercity IR Inter-Regio (rare in Germany, mostly used in Switzerland) ICE Intercity-Express THA Thalys
Depending on the city and country, other types may be used as well. Examples include "ABR" / "NWB" (private trains included in the local transport tariff system), "HKX" (private train not included in any DB tariffs) and "SBB" (unknown swiss train class)
- -v, --via viastation
Only show trains serving viastation after station. In this case, viastation must match the station as contained in the train's route (see -of), DS100 codes are not supported.
- -V, --track-via viastation
Only show trains serving viastation after station. Show result timestamps as "HH:MM -> HH:MM +x", where the first time is the scheduled departure (without delay) at station and the second the scheduled arrival (also without delay) at viastation. If a delay is known, it will be indicated by +x.
Note that here, viastation must be a regular station name or DS100 code.
Caveat: Some trains may change their identity along the route. track-via is not able to handle those and will miss trains changing their identifier between station and viastation
Sometimes, Deutsche Bahn splits up major stations in their IRIS interface. For instance, "Köln Messe/Deutz" actually consists of "Köln Messe/Deutz" (KKDZ), "Köln Messe/Deutz Gl. 9-10" (KKDZB) and "Köln Messe/Deutz (tief)" (KKDT).
By default, db-iris will show departures for all of these stations when queried for any of them. When this option is set, only the departures for the station part specified on the commandline are shown.
Show version information.
- 0: Normal operation
- 1: Invalid arguments or unknown station
- 2: Cannot get departures from backend (network issues?)
- 3: Invalid date/time specified
There are no known bugs at the moment.
Copyright (C) 2013-2019 by Daniel Friesel <email@example.com>
The station data used by this script is provided by DB Station&Service AG, Europaplatz 1, 10557 Berlin, Germany and available under a CC-BY 4.0 license on https://data.deutschebahn.com/dataset/data-haltestellen.
This program is licensed under the same terms as Perl itself.