SDK Reference
mta.bus.vehicles() — live bus positions by route
Reference for mta.bus in mta-js. Retrieve live bus vehicle positions, GPS coordinates, heading, next stop, and occupancy for any MTA route.
GET
Get bus arrivals
TheDocumentation Index
Fetch the complete documentation index at: https://mtaapi.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
mta.bus namespace provides access to real-time bus data sourced from the MTA’s Bus Time API. Use mta.bus.arrivals to get the next predicted buses at a specific stop, and mta.bus.vehicles to see where every active bus on a route is right now, including its coordinates, bearing, next stop, and passenger occupancy status.
mta.bus.arrivals(params)
Returns upcoming bus arrival predictions for a single stop. Pass an optional route to limit results to one route serving that stop.
Parameters
The MTA bus stop ID to query (for example,
'308214'). Look up stop IDs with mta.stops.near or from the MTA’s published stop data.Optional route filter (for example,
'M23'). When omitted, all routes serving the stop are returned.Maximum number of upcoming arrivals to return. Must be between
1 and 100.When
true, the response includes the raw upstream feed payload alongside the normalized arrivals. Useful for debugging or accessing fields not yet surfaced by the normalized API.Code example
mta.bus.vehicles(params)
mta.bus.vehicles(params)
Returns active bus vehicles. Pass route to scope to a single route, or vehicleId to look up a specific vehicle. Data is refreshed approximately every 30 seconds and reflects the most recent position reported by each vehicle’s onboard GPS unit.
Parameters
Optional bus route ID to filter on (for example,
'B63' for the Brooklyn route along Fifth Avenue, or 'M15' for the Manhattan crosstown route on First and Second Avenue). Route IDs are case-sensitive and match MTA’s published route identifiers.Optional MTA vehicle ID to look up a single vehicle (for example,
'MTA_8741').Maximum number of vehicles to return. Must be between
1 and 100.When
true, the response includes the raw upstream feed payload alongside the normalized vehicle list.TypeScript signature
Response fields
The route ID that was queried, echoed back in the response.
An array of active vehicles on the route. Returns an empty array if no vehicles are currently in service.
Code example
Example response
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Minimum string length:
1Minimum string length:
1Required range:
1 <= x <= 100Response
200 - application/json
Response for status 200
Available options:
subway, bus, lirr, metro-north Available options:
north, south, east, west, unknown, uptown, downtown Previous
AlertsReference for mta.alerts in mta-js. Retrieve current MTA service alerts—delays, planned work, and route suspensions—for subway or bus.
Next
Get bus arrivals