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 and destination 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"
        },
        ...
    ]
}
NameTypeDescription
last_updatedintThe time that this endpoint was last updated
vehicle_idstringThe fleet ID of the vehicle
last_gps_fixintThe last time the vehicle broadcasted its location
latitudefloatThe most recently broadcasted latitude of the vehicle
longitudefloatThe most recently broadcasted longitude of the vehicle
speedintThe speed (in miles per hour) of the vehicle
headingintThe heading (in degrees, 0-360) of the vehicle
service_namestringThe service that the vehicle is currently operating on
destinationstringThe destination displayed on the vehicle's destination board
journey_idintThe vehicle's current journeyId as used by the MyBusTracker API
reference_stop_idintThe stop used to get the vehicle's service_name, destination and journey_id - useful when requesting data from the MyBusTracker API