How can i fetch the current location for all vehicles of cetain number?

77 views
Skip to first unread message

Ionascu Mihai

unread,
Mar 29, 2021, 10:23:38 AM3/29/21
to MBTA Developers
Hey guys,

I'm new to GTFS, is it possible to get the longitude/latitude for all vehicles of a certain number (not vehicle id). Looking at a certain vehicle info I can't find it's associated number.


{
    "data": {
        "attributes": {
            "bearing": 270,
            "current_status": "IN_TRANSIT_TO",
            "current_stop_sequence": 1,
            "direction_id": 1,
            "label": "1893",
            "latitude": 42.32943,
            "longitude": -71.08381,
            "occupancy_status": "FEW_SEATS_AVAILABLE",
            "speed": null,
            "updated_at": "2021-03-28T13:09:36-04:00"
        },
        "id": "y1893",
        "links": {
            "self": "/vehicles/y1893"
        },
        "relationships": {
            "route": {
                "data": {
                    "id": "66",
                    "type": "route"
                }
            },
            "stop": {
                "data": {
                    "id": "64000",
                    "type": "stop"
                }
            },
            "trip": {
                "data": {
                    "id": "47387427",
                    "type": "trip"
                }
            }
        },
        "type": "vehicle"
    },
    "jsonapi": {
        "version": "1.0"
    }
}

Developer at MBTA

unread,
Apr 1, 2021, 5:15:22 PM4/1/21
to MBTA Developers
Hi, could you clarify what you mean by the vehicle "number"? You might be looking for the `label` field (the rider-visible identifying label on a vehicle, often a number), in which case the vehicles endpoint has a `filter[label]` parameter that does what you want.

—Developer@MBTA
Reply all
Reply to author
Forward
0 new messages