This application is a small web api for the public-transport-enabler.
Don't forget to init and update git submodules for the public-transport-enabler library.
cd public-transport-web-api
git submodule init
git submodule update --remote --merge
./mvnw spring-boot:run
Test URL for your Browser: http://localhost:8080/publictransportapi/rest/connection?from=6906508&to=6930811&product=T
The basic url of the following endpoints are publictransportapi/rest, so for example the provider endpoint URL is, publictransportapi/rest/provider.
With this endpoint you can get all existing provider which can be used as optional parameter, default provider is Nahverkehr Baden-Württemberg (Nvbw)
Example: /provider
With this endpoint you can get the station ids which you need to use later.
Parameter:
- q -- Name of station you want to search
- (optional) providerName -- Name of the provider, for example: Nvbw
- (optional) locationType -- type of the locations, default: ANY, possible values. ANY, STATION, STREET, POI
Example: /station/suggest?q=Technisches+Rathaus
Lists all trips from one station to another with departure time and line number.
Please note that only direct connections will be listed
Parameter:
- from -- Station id from departure station
- to -- Station id from the arrival station
- product -- Product you want to use ( T = Tram, B = Bus)
- (optional) timeOffset -- Minutes e.g. you need to walk to the station.
- (optional) providerName -- Name of the provider, for example: Nvbw
Example: /connection?from=6906508&to=6930811&product=T
Lists all departure trains of the given station
Parameter:
- from -- Station id from departure station
- (optional) providerName -- Name of the provider, for example: Nvbw
- (optional) limit -- Limit the result set, default 10
Example: /departure?from=6906508
Get next departure time for your trip. Lightwight for easy processing with the ESP8266
Please note that only direct connections will be listed
Parameter:
- from -- Station id from departure station
- to -- Station id from the arrival station
- product -- Product you want to use ( T = Tram, B = Bus)
- (optional) timeOffset -- Minutes e.g. you need to walk to the station.
- (optional) providerName -- Name of the provider, for example: Nvbw
Example: /connection/esp?from=6906508&to=6930811&product=T&timeOffset=5
Lists all trips from one station to another with with all data the public-transport-enabler libary delivers.
Parameter:
- from -- Station id from departure station
- to -- Station id from the arrival station
- product -- Product you want to use ( T = Tram, B = Bus)
- (optional) timeOffset -- Minutes e.g. you need to walk to the station.
- (optional) providerName -- Name of the provider, for example: Nvbw
Example: /connection/raw?from=6906508&to=6930811&product=T
Lists all departure trains of the given connection in the format for FHEM. http://forum.fhem.de/index.php/topic,48255.0.html
Parameter:
- from -- Station id from departure station
- to -- Station id from the arrival station
- product -- Product you want to use ( T = Tram, B = Bus)
- (optional) timeOffset -- Minutes e.g. you need to walk to the station.
- (optional) providerName -- Name of the provider, for example: Nvbw
- (optional) limit -- Limit the result set, default 10
Example: /connection/FHEM?from=6906508&to=6930811&product=T
Lists all departure trains of the given station in the format for FHEM. http://forum.fhem.de/index.php/topic,48255.0.html
Parameter:
- from -- Station id from departure station
- (optional) providerName -- Name of the provider, for example: Nvbw
- (optional) limit -- Limit the result set, default 10
Example: /departure/FHEM?from=6906508&limit=6