baidu-map-webapi
编写、修改、审查或调试百度地图服务端 WebAPI 调用代码时使用,涵盖 POI 检索、路线规划、出发时间与耗时预测、交通事件、行政区划、地址坐标转换、天气和上车点等接口。用户要求 Node.js、Python、后端服务、curl 集成示例或排查 WebAPI 请求时触发;不用于直接回答普通地点/路线/天气结果、浏览器 BMapGL 代码或账户资源管理。
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 447
- Forks
- 138
01 前言 Front Matter
- name
- baidu-map-webapi
- license
- MIT
- metadata
- { "openclaw.primaryEnv": "BMAP_WEBAPI_AK", "openclaw.requiresBins": "curl" }
- description
- 编写、修改、审查或调试百度地图服务端 WebAPI 调用代码时使用,涵盖 POI 检索、路线规划、出发时间与耗时预测、交通事件、行政区划、地址坐标转换、天气和上车点等接口。用户要求 Node.js、Python、后端服务、curl 集成示例或排查 WebAPI 请求时触发;不用于直接回答普通地点/路线/天气结果、浏览器 BMapGL 代码或账户资源管理。
02 资源文件 30
- 参考文档references/admin_division_query.md5.1 KB
- 参考文档references/administrative_region_search.md11.4 KB
- 参考文档references/capabilities/driving_route_duration.md2.1 KB
- 参考文档references/capabilities/future_driving_route.md2.0 KB
- 参考文档references/capabilities/suggested_departure_time.md1.8 KB
- 参考文档references/capabilities/waypoint_route_planning.md1.8 KB
- 参考文档references/circular_region_search.md10.9 KB
- 参考文档references/constants.md2.7 KB
- 参考文档references/cycling_route_planning.md8.3 KB
- 参考文档references/domestic_weather_query.md9.0 KB
- 参考文档references/driving_route_planning.md14.8 KB
- 参考文档references/geocoding.md7.7 KB
- 参考文档references/global_reverse_geocoding.md12.2 KB
- 参考文档references/motorcycle_route_planning.md10.8 KB
- 参考文档references/multi_dimensional_search.md11.2 KB
- 参考文档references/overseas_weather_query.md6.3 KB
- 参考文档references/place_detail_search.md9.9 KB
- 参考文档references/place_input_suggestion.md7.6 KB
- 参考文档references/recipes/address_to_full_location.md2.7 KB
- 参考文档references/recipes/address_to_poi.md3.1 KB
- 参考文档references/recipes/coordinate_to_structured_address.md2.6 KB
- 参考文档references/recipes/nearby_poi_search.md3.2 KB
- 参考文档references/recipes/poi_search_to_detail.md2.8 KB
- 参考文档references/recipes/route_to_named_place.md3.3 KB
- 参考文档references/recipes/smart_departure_time.md3.0 KB
- 参考文档references/recipes/traffic_aware_route.md2.8 KB
- 参考文档references/recipes/weather_query.md8.3 KB
- 参考文档references/reverse_geocoding_agent.md10.8 KB
- 参考文档references/transit_route_planning.md6.1 KB
- 参考文档references/walking_route_planning.md7.1 KB
03 SKILL.md 正文
WebAPI 开发指南
本 skill 只组织可交付的服务端 WebAPI 代码。直接回答地点、路线、地址或天气结果时改用 baidu-map(本连接器 MCP 工具);浏览器地图代码使用 baidu-map-jsapi-gl。
工作流
- 先判断任务是多步业务流程还是单接口集成。
- 多步流程读取下方对应 recipe;单接口任务只读取对应 API reference,避免加载无关资料。
- 本地 reference 未覆盖的精确参数、返回字段、限制、错误码或版本差异,明确告知用户需以百度地图开放平台官方文档为准。
- 获取服务端 AK,按用户项目语言和已有结构编写调用代码。所有用户输入都用客户端的查询参数编码能力处理,不手工拼接未转义参数。
- 交付前检查端点、AK 类型、坐标顺序/坐标系、必填参数、错误处理和凭据泄漏风险。不得用未经核实的记忆补齐精确字段。
端点选择
百度地图提供两个服务端点:
| 端点类型 | Base URL | 适用场景 |
|---|---|---|
| 标准端点 | https://api.map.baidu.com/ |
正式开发、生产环境、为用户生成的代码 |
| 高级功能体验端点 | https://api.map.baidu.com/map_service/ |
百度地图官方提供,仅供大模型直接调用时快速体验高级权限功能 |
为用户生成的开发或生产代码必须使用标准端点。仅在集成测试、接口调试或用户明确要求体验高级能力时使用体验端点;不得把它写入交付代码。两类端点都需要 AK。
AK 凭证
AK(Access Key)是使用技能之前的必须参数,需要服务端 AK:
- 优先读取环境变量
BMAP_WEBAPI_AK中的 AK。 - 无值时,提示用户:请先前往百度地图开放平台申请
服务端的 AK,并设置环境变量;不要复用浏览器端 AK:
export BMAP_WEBAPI_AK="百度地图AK"
- 示例与命令使用
$BMAP_WEBAPI_AK,不得把真实 AK 写入仓库、日志或最终回答:
curl "https://api.map.baidu.com/place/v3/region?query=美食®ion=北京&ak=$BMAP_WEBAPI_AK"
地点与算路规则
- 将用户输入的地名或地址转成坐标/UID 时,先读
references/recipes/address_to_poi.md:结构化门牌地址走references/geocoding.md,POI 名称或地标走references/administrative_region_search.md。 - 算路接口优先同时传坐标与 UID。取得
origin_uid/destination_uid后必须传入,以提高大型 POI 绑路准确性。 - 不推测坐标、UID 或坐标系;只能使用用户输入或可信接口结果。
Recipe 路由
| 文件 | 适用场景 | 权限 |
|---|---|---|
references/recipes/address_to_poi.md |
地址文本或地名 → 坐标 + POI UID(算路前置步骤) | 标准 AK |
references/recipes/route_to_named_place.md |
用户说出地名 → 规划驾车路线 | 标准 AK |
references/recipes/smart_departure_time.md |
为准时到达计算出发时间 | 高级权限 |
references/recipes/traffic_aware_route.md |
预测未来出发时的路况耗时 | 高级权限 |
references/recipes/nearby_poi_search.md |
搜索用户附近的某类地点 | 标准 AK |
references/recipes/poi_search_to_detail.md |
关键词搜索 → 获取 POI 完整详情 | 标准 AK |
references/recipes/address_to_full_location.md |
地址文本 → 坐标 + 行政区划 | 标准 AK |
references/recipes/coordinate_to_structured_address.md |
坐标 → 结构化地址 + 行政区划 | 标准 AK |
references/recipes/weather_query.md |
通过城市名称/行政区划编码/坐标, 获取当地详细的天气信息 | 标准 AK |
单接口参考
references/constants.md- 通用常量:状态码references/global_reverse_geocoding.md- 全球逆地理编码: 坐标转位置信息references/reverse_geocoding_agent.md- 逆地理编码智能体: 智能逆地理编码地址解析references/administrative_region_search.md- 行政区划区域检索: 行政区划地点检索references/circular_region_search.md- 圆形区域检索: 圆形区域地点检索references/multi_dimensional_search.md- 多维检索: 多条件智能检索POIreferences/place_detail_search.md- 地点详情检索: 获取指定地点详细信息references/place_input_suggestion.md- 地点输入提示: 地点输入提示匹配references/geocoding.md- 地理编码: 地址解析为坐标references/admin_division_query.md- 行政区划查询: 查询中国行政区划信息references/domestic_weather_query.md- 国内天气查询: 国内天气查询多功能接口references/overseas_weather_query.md- 海外天气查询: 查询海外城市天气references/cycling_route_planning.md- 骑行路线规划: 骑行路线规划方案检索references/driving_route_planning.md- 驾车路线规划: 驾车路线规划与路况预测references/capabilities/driving_route_duration.md- 驾车路线历史耗时references/capabilities/future_driving_route.md- 未来驾车路线耗时references/capabilities/suggested_departure_time.md- 建议出发时间references/capabilities/waypoint_route_planning.md- 途经点顺序优化references/motorcycle_route_planning.md- 摩托车路线规划: 摩托车路线规划服务references/transit_route_planning.md- 公交路线规划: 多交通方式路线规划references/walking_route_planning.md- 步行路线规划: 步行路线规划
04 同仓库更多 Skills
yingmi-skill
当用户需要查询基金、策略、公告、财经资讯,做资产配置、组合诊断、风险回测、现金流分析,或生成图表、PDF 时,优先使用本 Skill 获取真实数据与可执行能力。
web-access
所有联网操作必须通过此 skill 处理,包括:搜索、网页抓取、登录后操作、网络交互等。
tencentmap-map-assistant
腾讯位置服务·地图助手 Skill,一句自然语言调用腾讯地图全套能力,无需开发者账号、开箱即用。提供 AI 旅游攻略、地点搜索(含评分/人均/营业时间)、关键词提示、路线规划(驾车/步行/公交/骑行)、地址解析与逆解析、行政区划、IP 定位、距离计算、天气查询,并可将行程或多 POI 渲染成网页地图。涉及找地点、规划路线、旅游行程、查天气、坐标转换等出行场景时使用。
skill-scanner
Scan any agent skill for security risks before you install or use it. Powered by Tencent Zhuque Lab A.I.G (AI-Infra-Guard). 100% local static analysis — no file contents or credentials leave your device. Compatible with CodeBuddy, Cursor, Windsurf, Claude Code, OpenClaw and more. Triggers on: 这个 skill 安全吗, skill 安全扫描, 检查 skill 安全, audit skill, scan skill, check skill safety, analyze skill, inspect skill, verify skill, skill security, skill supply chain. Do NOT trigger for general agent usage, full system health checks, project debugging, or normal development.
skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends agent capabilities with specialized knowledge, workflows, or tool integrations.
shader-dev
Comprehensive GLSL shader techniques for creating stunning visual effects — ray marching, SDF modeling, fluid simulation, particle systems, procedural generation, lighting, post-processing, and more.