Live vehicle locations
The vehicle_locations
endpoint provides real-time information on the position of all buses and trams that are currently in service.
Limitations
This endpoint uses the on-board Wi-Fi routers on each vehicle to determine the vehicle's location. If the Wi-Fi router is unavailable, no information will be given for that bus.
There can be a noticeable lag time (up to 60 seconds) between the vehicle broadcasting it's latest location and that location appearing within this endpoint.
Sometimes, the API will be unable to determine a vehicle's current service and destination, only the vehicle's fleet ID, speed and location.
service_name
anddestination
will be returned as null.
Update frequency
Every 15 seconds
Resource
GET /v1/vehicle_locations
Authorisation
API Authentication Token
Response
Status-Code: 200 OK
{
"last_updated": 1419342676,
"vehicles": [
{
"vehicle_id": "173",
"last_gps_fix": 1419342659,
"latitude": 55.949443,
"longitude": -2.867246,
"speed": 26,
"heading": 74,
"service_name": "104",
"destination": "West End"
},
{
"vehicle_id": "171",
"last_gps_fix": 1419342634,
"latitude": 55.943604,
"longitude": -3.116166,
"speed": 5,
"heading": 265,
"service_name": "104",
"destination": "Haddington"
},
...
]
}
Name | Type | Description |
---|---|---|
last_updated | int | The time that this endpoint was last updated |
vehicle_id | string | The fleet ID of the vehicle |
last_gps_fix | int | The last time the vehicle broadcasted its location |
latitude | float | The most recently broadcasted latitude of the vehicle |
longitude | float | The most recently broadcasted longitude of the vehicle |
speed | int | The speed (in miles per hour) of the vehicle |
heading | int | The heading (in degrees, 0-360) of the vehicle |
service_name | string | The service that the vehicle is currently operating on |
destination | string | The destination displayed on the vehicle's destination board |
journey_id | int | The vehicle's current journeyId as used by the MyBusTracker API |
reference_stop_id | int | The stop used to get the vehicle's service_name , destination and journey_id - useful when requesting data from the MyBusTracker API |
Updated less than a minute ago