Get realtime buses for a (line, stop) pair
bus_get_line_realtimeRetrieve real-time bus arrivals for a specific line and waiting stop, including ETA of the nearest bus and positions of all buses on the line.
Instructions
Canonical "when will my bus arrive" tool. Returns every bus currently on the line, with the nearest one carrying an ETA to the waiting stop.
Important: the upstream predicts an ETA for only the nearest bus heading to your stop. Buses farther up the route are returned (with position/speed/capacity) but their eta field is null. That's not a bug.
Args:
city_id (string, required)
line_id (string, required): from bus_search
target_order (string, required): the waiting stop's order on the line. Source: bus_get_line_detail.stations[i].order, or bus_get_nearby_stops.stops[].lines[].targetOrder.
station_id (string, required): sId of the waiting stop
lat / lng (string, required): WGS-84 — the user's location is best; if unavailable, use the waiting stop's wgsLat/wgsLng (from line_detail.stations[i]).
response_format ('markdown' | 'json')
Returns (json): { "line": { "lineId":"...", "name":"71", "direction":0, "endSn":"..." }, "targetOrder": 2, "realData": true, "buses": [ { "busId":"...", "licence":"...", "order":2, "lat":..., "lng":..., "speed":5.7, "capacity":0, "distanceToWaitStn":90, "eta":{"travelTime":25,"arrivalTime":1779070466055,"displayTime":"10:14"} }, { "busId":"...", "order":3, "lat":..., "lng":..., "speed":3, "capacity":0, "eta":null }, ... ], "note": "..." }
Field notes:
The 'line' sub-object intentionally omits startSn — upstream does not return it on this endpoint. Read it from bus_get_line_detail if needed.
eta.travelTime is seconds remaining
eta.arrivalTime is a ms timestamp
eta.displayTime is a "HH:MM" hint from upstream
capacity: 0=light, 1=moderate, 2=crowded
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city_id | Yes | ||
| line_id | Yes | ||
| target_order | Yes | Order index of the waiting stop on the line. Get it from bus_get_line_detail.stations[].order or bus_get_nearby_stops.stops[].lines[].targetOrder. | |
| station_id | Yes | sId of the waiting stop | |
| lat | Yes | WGS-84 latitude. If the user's location is unknown, fall back to the waiting stop's lat (from line_detail.stations[].wgsLat). | |
| lng | Yes | WGS-84 longitude. Fallback to the stop's wgsLng if unknown. | |
| response_format | No | Output format: 'markdown' for human-readable text, 'json' for full structured data | markdown |