No longer actively developed in favor of the onboardAPIs (PyPI) project which includes APIs for different providers.
This module interacts with the onboard APIs of the Deutsche Bahn ICE trains.
It can do various things from reading the trains' velocity to telling you the distance to and the delay at the next station.
This is an unofficial project and not supported by Deutsche Bahn AG
.
Note, that this module will only work correctly while you are on a train and connected to its WiFi-Hotspot.
- Available on PyPI
$ python -m pip install iceportal_apis
import iceportal_apis as ipa
train = ipa.Train()
while True:
# Request new data from the api
# train.refresh() # obsolete, because onboardapis handles refreshing
# Process data (uses onboardapis under the hood)
print(train.get_train_type().name)
next_station = train.get_next_station()
. . .
This software is distributed under the MIT License, please see
LICENSE
for detailed information.
The Status API is available at https://iceportal.de/api1/rs/status
The Trip API is available at https://iceportal.de/api1/rs/tripInfo/trip
The Connecting trains API can be found at https://iceportal.de/api1/rs/tripInfo/connection/{eva_number}
These are other APIs I discovered but didn't investigate in:
4.1. https://iceportal.de/api1/rs/pois/map/{lat_s}/{lon_s}/{lat_e}/{lon_e}
4.2. https://iceportal.de/api1/rs/configs
4.3. https://iceportal.de/api1/rs/configs/cities