-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Justintunsday edited this page Sep 14, 2026
·
5 revisions
chelaile-api-server 把车来了(Chelaile)实时公交能力封装成一套只读 HTTP JSON API:
线路站点、实时到站、附近站点、关键词搜索、线路轨迹、公交+地铁换乘规划。无需登录、无需账号。
- 在线服务(已验证):Cloudflare Workers https://ts-api.tundrey.com | Vercel https://chelaile-api-server.vercel.app
- 源码仓库:https://github.com/Justintunsday/chelaile-api-server
- 完整参考文档:https://chelaile-api-docs.tundrey.com/API.html(GitHub Pages 源站:https://justintunsday.github.io/chelaile-api-server/API.html)
- 静态数据(jsDelivr):https://cdn.jsdelivr.net/gh/Justintunsday/chelaile-api-server@main/data/cities.json
# 健康检查
curl "https://ts-api.tundrey.com/v1/health"
# 搜索上海的 71 路
curl "https://ts-api.tundrey.com/v1/search?city_id=034&keyword=71"
# 71 路还有多久到西藏中路
curl "https://ts-api.tundrey.com/v1/lines/realtime?city_id=034&line_id=21283603183&target_order=2&station_id=021-15232&lat=31.2304&lng=121.4737"浏览器直接打开上面的 URL 也能看到 JSON 结果。
| 端点 | 用途 |
|---|---|
GET /v1/health |
存活探针 |
GET /v1/cities |
支持的城市(默认热门 12 个,hot_only=false 全量 480) |
GET /v1/cities/config |
城市刷新间隔与展示策略 |
GET /v1/reverse-geocode |
WGS-84 坐标 → 中文地址 |
GET /v1/my-location |
按 IP 估算位置(城市级) |
GET /v1/search |
关键词混合搜索:线路 + 站点 + POI |
GET /v1/search/more |
某一分类分页"查看更多" |
GET /v1/stops/nearby |
附近站点与实时到站 |
GET /v1/stops/detail |
站点经过的全部线路 + 实时车辆 + 附近地铁 |
GET /v1/lines/detail |
线路完整站点表 + 当前车辆(不含地铁线路) |
GET /v1/lines/route |
线路轨迹坐标(画地图用) |
GET /v1/lines/realtime |
"我的公交还有多久到站"实时 ETA |
GET /v1/lines/buses |
即将到站的最近车辆 |
GET /v1/lines/timetable |
逐班时刻表(少数线路有) |
GET /v1/lines/refresh |
批量刷新多个 (线路, 站点) |
GET /v1/transit/plan |
公交 + 地铁换乘规划 |
所有端点都在 /v1 下、全部使用 GET、返回 JSON(UTF-8)。GET / 会返回端点索引。
查"我的公交还有多久到"
GET /v1/stops/nearby?city_id=034&lat=<WGS纬度>&lng=<WGS经度>&limit=5- 从返回的
stops[].lines[]里取lineId、targetOrder、targetStationId GET /v1/lines/realtime?city_id=034&line_id=...&target_order=...&station_id=...&lat=...&lng=...- 读最近一辆车的
buses[].eta.travelTime(秒)或eta.displayTime(HH:MM)
查"从这里怎么坐车过去"
-
GET /v1/search?city_id=034&keyword=<目的地名>,取pois[0].lat/lng(注意是 GCJ-02) GET /v1/transit/plan?city_id=034&origin_name=...&origin_lat=...&origin_lng=...&dest_name=...&dest_lat=...&dest_lng=...&strategy=0
- Quick-Start:直接调用在线服务 / 本地运行 / 部署
- API-Reference:全部端点的参数、示例与返回结构
- Coordinates-and-Fields:WGS-84 与 GCJ-02、ETA/拥挤度/各种 ID 的含义
- Deployment:环境变量、数据托管、平台部署
- FAQ:502/504、地铁线路、冷启动等
- MCP:在原 MCP 客户端(Claude 等)中使用