Search lines, stations, and POIs
bus_searchSearch bus lines, stations, and points of interest in a city with a keyword. Returns matching routes, stops, and destinations in a single call.
Instructions
Search inside a city by keyword. Returns matching lines, stations, and POIs in one call.
Use this as the primary entry point when the user gives a line number, station name, or destination name without IDs.
Keyword tip: plain "71", "71路", "地铁2号线", "陆家嘴" all work — the upstream is reasonably forgiving. If a short numeric returns empty, try appending "路".
Coordinate systems:
'pois' coords are GCJ-02 (use directly with bus_plan_transit)
'stations' coords are WGS-84 (use with bus_get_nearby_stops / bus_get_line_realtime) Both are also marked with a 'gpsType' field.
Args:
city_id (string, required): e.g. '034'
keyword (string, required)
response_format ('markdown' | 'json')
Returns (json): { "highlightKey": "71路", "lines": [ { "name": "71", "lineNo": "r95817", "isSubway": false, "directions": [ { "direction": 0, "lineId": "21283603183", "startSn": "延安东路外滩", "endSn": "申昆路枢纽站" }, { "direction": 1, "lineId": "21283603182", "startSn": "申昆路枢纽站", "endSn": "延安东路外滩" } ], // Compat top-level fields mirror directions[0] (or first available). "lineId": "21283603183", "direction": 0, "startSn": "延安东路外滩", "endSn": "申昆路枢纽站" }, ... ], "stations": [{ "sId":"...", "sn":"西藏中路", "lat":31.231006, "lng":121.474316, "gpsType":"wgs", "physicalStId":"...", "namesakeStId":"...", "isSubway":false }, ...], "pois": [{ "name":"71路", "address":"...", "tag":"公交线路", "district":"黄浦区", "lat":31.233021, "lng":121.49073, "gpsType":"gcj" }, ...] }
Line folding: each entry in 'lines' is one logical line (e.g. "71路"). The two travel directions live in 'directions[]'. Pick the lineId matching your desired direction.
Subway hint: when 'isSubway' is true, the entry carries a 'hint' field — bus_get_line_detail will return empty for these lineIds. Use bus_get_stop_detail (metros field) or bus_plan_transit instead.
Follow-ups:
directions[i].lineId → bus_get_line_detail (full stop list, first/last/price) — non-subway only
stations[*].physicalStId + namesakeStId → bus_get_stop_detail (NOTE: a few stations lack physicalStId — typically metro-only entries with subwayV2=1. For those, use bus_get_nearby_stops to resolve the bus platform IDs nearby.)
pois[*].lat/lng (GCJ) → bus_plan_transit as origin/destination
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city_id | Yes | City ID, e.g. '034' | |
| keyword | Yes | Search keyword. Examples: '71', '71路', '地铁2号线', '陆家嘴', '人民广场'. Plain line numbers like '71' work fine. | |
| response_format | No | Output format: 'markdown' for human-readable text, 'json' for full structured data | markdown |