aixbus is a set of php scripts that perform requests to the ASEAG realtime bus service and return comprehensive JSON.
Simply put:
- it takes simple input parameters
- performs the requests to the
ivu.aseag.de
API - parses the response
- returns a pretty JSON 😍
NOTE: The ivu.aseag.de
is undocumented and may be not intended for public use. This code was put together for educational purposes. The rights to use the API should be requested to ASEAG directly.
- aixbus was tested on a server running php
7.0
- although untested, it may work with earlier php versions.
- the server needs to be able to perform HTTP requests for
file_get_contents
to work properly.
Returns a list of the closest stops for given coordinates with nested live departure information for each stop.
lat
lon
- (Optional)
returnCount
: Limits the number of closest stops to the given location - (Optional)
nestedDeparturesCount
: Limits the number of nested stops to the given location
Tip: lat
and lon
use .
as decimal separator.
[
{
"id": 218500,
"name": "Imgenbroich Bushof",
"geoLocation": {
"lat": 50.579083,
"lon": 6.2605
},
"distance": 67028.993657647,
"departures": [
{
"eta": 1487932320,
"local_time": "11:32:00",
"line": "82",
"destination": "Simmerath",
"live_info": false,
"tripId": 24000027042001,
"indicator": "H3"
},
...
]
},
...
]
Returns all the remaining stops for a single given tripId
.
This is
- live information of a single physical vehicle
- not all the stops that a line service covers
tripId
[
{
"eta": 1487936520000,
"stop": {
"id": 218500,
"name": "Imgenbroich Bushof",
"indicator": "H.4"
}
},
{
"eta": 1487936580000,
"stop": {
"id": 100999,
"name": "ASA-Haltestelle \/ FGI-Haltestelle",
"indicator": "H.4"
}
}
]
aixbus is available under the MIT license. See the LICENSE file for more info.