Baidu Map WebAPI(百度地图官方Web服务 SKills)
CLAWHUB · Unverified
百度地图 webapi 开发指南。在编写、审查或调试使用百度地图webAPI的代码时应运用此技能,也适用于直接调用百度地图API获取结果的场景。涵盖:地图位置搜索、POI检索、路线规划、建议出发时间、路线耗时预测、实时路况、行政区划查询、地址坐标转换、沿途交通事件、天气查询、智能推荐上车点等。当用户提及出发时间、...
- 62
- Rank
- 84
- Safety
- 1.5k
- Downloads
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · Oct 10, 2026
- Adoption signal
- 1.5K downloadsadoption · Oct 10, 2026
- Latest release
- 1.0.8release · Jun 1, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.0.8release
- Removed two documentation files: _meta.json and skill-card.md. - No changes to functionality or APIs. - No updates to user-facing features; guides and interface remain the same.
Observed Jun 1, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s178nge8tvzzhnan6cc08q0ech84dmtm:baidu-map-webapi- Install using `clawhub skill install s178nge8tvzzhnan6cc08q0ech84dmtm:baidu-map-webapi` in an isolated environment before connecting it to live workloads.
- No published capability contract is available yet, so validate auth and request/response behavior manually.
- Review the upstream CLAWHUB listing at https://clawhub.ai/baidu-maps/baidu-map-webapi before using production credentials.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-baidu-maps-baidu-map-webapi/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
155,306 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: baidu-map-webapi
description: 百度地图 webapi 开发指南。在编写、审查或调试使用百度地图webAPI的代码时应运用此技能,也适用于直接调用百度地图API获取结果的场景。涵盖:地图位置搜索、POI检索、路线规划、建议出发时间、路线耗时预测、实时路况、行政区划查询、地址坐标转换、沿途交通事件、天气查询、智能推荐上车点等。当用户提及出发时间、导航路线、地点查询、坐标转换、地图相关开发需求时自动触发。
license: MIT
version: 1.0.5
homepage: https://lbs.baidu.com
repository: https://github.com/baidu-maps/webapi-skills
metadata:
openclaw:
requires:
bins: ["curl"]
env: BMAP_WEBAPI_AK
primaryEnv: BMAP_WEBAPI_AK
---
# webapi 开发指南
百度地图 webapi 版本开发指南。包含地图位置搜索、路线导航、行政区划等核心模块的 API 说明和代码示例,既可直接调用 API 获取结果,也可帮助开发者快速集成百度地图服务。
## 何时适用
遇到以下任意场景时,均应读取本指南并调用对应 API:
### 路线规划与出行决策
- 规划驾车、步行、骑行、摩托车、公共交通路线
- **查询从 A 到 B 的建议出发时间**(如"想晚上8点到达,几点出发合适")
- **预测未来某时刻出发的路线耗时**(如"下午3点出发要多久")
- 查询历史路况下的路线耗时
- 规划含多个途经点的最优路线
### 实时动态信息
- 查询路线沿途的动态交通事件(事故、拥堵、施工等)
- 查询海外城市天气信息
### 地点与POI搜索
- 查找城市中的餐厅、酒店、景点等 POI 信息
- 在指定圆形区域内检索地点
- 按行政区划检索地点
- 多条件组合检索 POI
- 获取 POI 详细信息
- 输入联想/地点补全提示
- 智能推荐安全上车点
### 地址与坐标转换
- 地址文本解析为经纬度坐标(地理编码)
- 经纬度坐标解析为地址信息(逆地理编码)
### 行政区划与区域查询
- 查询行政区划地点
- 获取行政区划边界坐标
## 开发准则
在使用本技能的任何场景中,请遵守以下通用准则:
### 准则 1:API 端点选择
百度地图提供两个服务端点,必须根据使用场景选择正确的端点:
| 端点类型 | Base URL | 适用场景 |
|---|---|---|
| **标准端点** | `https://api.map.baidu.com/` | 正式开发、生产环境、为用户生成的代码 |
| **高级功能体验端点** | `https://api.map.baidu.com/map_service/` | 百度地图官方提供,仅供大模型直接调用时快速体验高级权限功能 |
**使用规则:**
- 为用户生成的开发代码,**必须使用标准端点** `https://api.map.baidu.com/`
- **大模型直接调用高级权限功能(如建议出发时间、未来路线规划)进行演示/体验时,使用体验端点**
- **体验端点仅供功能体验和演示,不可用于开发或生产环境**
- **均需要AK凭证**
- **调用体验端点前,必须向用户说明:① 将使用体验端点发起外部 API 调用;② 该调用会消耗用户 AK 的配额;并获得用户明确确认后方可执行**
### 准则 2:AK 凭证安全处理
AK(Access Key)是使用技能之前的必须参数:
1. 优先读取环境变量 `BMAP_WEBAPI_AK` 中的 AK
2. `BMAP_WEBAPI_AK`为空时, 提示用户:**请先前往[百度地图开放平台](https://lbs.baidu.com/apiconsole/key)申请`服务端`的AK**
3. 然后设置为环境变量
```
export BMAP_WEBAPI_AK="百度地图AK"
```
4. 使用 references/ 所有能力时的ak参数请使用 `$BMAP_WEBAPI_AK`, 示例如下:
```
curl "https://api.map.baidu.com/place/v3/region?query=美食®ion=北京&ak=$BMAP_WEBAPI_AK"
```
### 准则 3:地址/地名统一通过 `address_to_poi` 转换
任何需要将**用户输入的地名或地址文本**转换为坐标/UID 的场景,**优先参考**:
> `recipes/address_to_poi.md` — 地址/地名转坐标与 POI UID
该文件描述了两种输入类型的判断方法和对应调用方式:
- **结构化地址**(含门牌号/楼栋)→ `references/geocoding` API
- **POI 名称/地标/商家名** → `references/administrative_region_search` API
### 准则 4:算路时 UID 优先于纯坐标
向算路接口(驾车/步行/骑行/公交)传参时:
```
推荐:同时传坐标 + uid(绑路更精准,尤其对大型 POI) origin_uid / destination_uid 有值时必传
```
UID 通过 `references/address_to_poi.md` 描述的方法获取。
---
## 场景示例(推荐优先阅读)
遇到以下场景时,**优先使用对应 recipe**,内含完整调用链、参数说明和可运行代码示例。
单个 API 用法请查阅下方「快速参考」。
### 地址/地名预处理(算路前必读)
| recipe 文件 | 适用场景 | 权限要求 |
|---|---|---|
| `recipes/address_to_poi.md` | 地址文本或地名 → 坐标 + POI UID(算路前置步骤) | 标准 AK |
### 路线规划
| recipe 文件 | 适用场景 | 权限要求 |
|---|---|---|
| `recipes/route_to_named_place.md` | 用户说出地名 → 规划驾车路线 | 标准 AK |
| `recipes/smart_departure_time.md` | "几点出发才能准时到" | ⚠️ 高级权限 |
| `recipes/traffic_aware_route.md` | 预测未来某时刻出发的路况耗时 | ⚠️ 高级权限 |
### POI 搜索
| recipe 文件 | 适用场景 | 权限要求 |
|---|---|---|
| `recipes/nearby_poi_search.md` | 搜索用户附近的某类地点 | 标准 AK |
| `recipes/poi_search_to_detail._meta.json
{
"ownerId": "kn778b6bf766ym71fdvrc5yvg98319rv",
"slug": "baidu-map-webapi",
"version": "1.0.8",
"publishedAt": 1780285162438
}references/admin_division_query.md
# 百度地图行政区划查询 API
## 服务概述
行政区划查询接口用于获取中国行政区划的详细信息。支持通过行政区划名称或adcode进行查询,返回结果包括行政区划的边界坐标、中心点、父级行政区划、行政区划级别等详细信息。该接口适用于需要行政区划数据的各类应用场景,如地图应用、数据分析、地址解析等。
- **版本**: 2.0.0
- **服务标识**: `region_search`
- **官方文档**: <https://lbs.baidu.com/faq/api?title=webapi/district-search/base>
### API调用
**GET** `https://api.map.baidu.com/api_region_search/v1/`
### 输入参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 | 示例 |
|--------|------|------|--------|------|------|
| ak | string | T | - | 开发者密钥,即API Key,用于身份验证和配额管理。 | E4805d16520de693a3fe707cdc962045 |
| keyword | string | T | - | 检索行政区划关键字。仅支持单关键字检索,可填写行政区名称(如“中国”“全国”、省/市/区/镇名称)或 adcode。 | 河北 |
| sub_admin | string | | 0 | 行政区划显示子级级数。可填 0、1、2、3 等:0 不返回下级;1 返回下一级;2 返回下两级;3 返回下三级,以此类推。 | 2 |
| extensions_code | string (enum: 0, 1) | | 0 | 是否召回国标行政区划编码,1 为召回,0 为不召回。 | 1 |
| boundary | string (enum: 0, 1) | | 0 | 是否返回区划边界数据:0 不返回,1 返回。仅返回查询行政区划的边界,不返回子级边界;仅支持省/市/区边界,暂不支持乡镇/街道。 | 1 |
| boundarycode | string | | - | 需要返回边界数据的行政区划编码。若输入 adcode 则返回该 adcode 边界;若未输入或输入错误,则返回 keyword 匹配到的第一个行政区划边界。 | 110112 |
### 响应结果
#### 响应示例 (供参考)
```json
{
"result": {
"name": "北京市",
"level": "province",
"adcode": "110000",
"parent": {
"name": "中国",
"adcode": "100000"
},
"boundary": "116.123,39.123;116.456,39.456",
"children": [
{
"name": "东城区",
"level": "district",
"adcode": "110101"
}
],
"location": {
"lat": 39.929986,
"lng": 116.395645
}
},
"status": 0,
"message": "ok"
}
```
#### 响应字段定义 (基于 Schema)
| 字段路径 | 类型 | 必填 | 说明 | 示例 |
|----------|------|------|------|------|
| `message` | string | | 状态码对应的描述信息。 | ok |
| `result` | object | | 查询结果对象。 | None |
| `result.adcode` | string | | 行政区划代码。 | 110000 |
| `result.boundary` | string | | 行政区划边界坐标,格式为经纬度坐标串,需设置 boundary=1 时返回。 | 116.123,39.123;116.456,39.456 |
| `result.children` | array | | 子级行政区划列表,当 sub_admin 大于 0 时返回。 | None |
| `result.children[].adcode` | string | | 子级行政区划代码。 | 110101 |
| `result.children[].level` | string | | 子级行政区划级别。 | district |
| `result.children[].name` | string | | 子级行政区划名称。 | 东城区 |
| `result.level` | string (enum: country, province, city... (共5个值)) | | 行政区划级别,如 country、province、city、district、town 等。 | province |
| `result.location` | object | | 行政区划的中心点坐标。 | None |
| `result.location.lat` | number | | 中心点纬度。 | 39.929986 |
| `result.location.lng` | number | | 中心点经度。 | 116.395645 |
| `result.name` | string | | 行政区划名称。 | 北京市 |
| `result.parent` | object | | 父级行政区划信息。 | None |
| `result.parent.adcode` | string | | 父级行政区划代码。 | 100000 |
| `result.parent.name` | string | | 父级行政区划名称。 | 中国 |
| `status` | integer | | 返回结果状态码,0表示成功,其他值为错误码。<br/><br/>**枚举值说明:**<br/>`0`: ok:正常<br/>`1`: 服务器内部错误:服务器端出现未知错误,请稍后重试<br/>`2`: 请求参数非法:请求参数缺失或格式错误<br/>`3`: 权限校验失败:ak无效或没有权限<br/>`4`: 配额校验失败:访问超出配额限制<br/>`5`: ak不存在或被封禁:ak不存在或已被封禁,请检查ak状态<br/>`101`: 服务禁用:该服务已被禁用<br/>`102`: 不通过白名单或安全码不对:服务器没有开启白名单,或安全码不对 | 0 |
### 常见问题
**Q: 支持查询哪些级别的行政区划?**
A: 支持国家(country)、省(provincereferences/administrative_region_search.md
# 百度地图地点检索及联想 API
## 服务概述
开发者可通过该功能,检索某一行政区划内(目前最细到区县级别)的地点信息。支持通过关键字、POI类型、区域限制、排序、分页等多种参数进行精细化检索。
- **版本**: 2.0.0
- **服务标识**: `administrative_region_search`
- **官方文档**: <https://lbs.baidu.com/faq/api?title=webapi/guide/webservice-placeapiV3/interfaceDocumentV3>
### API调用
**GET** `https://api.map.baidu.com/place/v3/region`
### 输入参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 | 示例 |
|--------|------|------|--------|------|------|
| query | string | T | - | 检索关键字。 | ATM机、美食 |
| region | string | T | - | 检索行政区划区域(支持到区县级)。增加区域内数据召回权重,如需严格限制召回数据在区域内,请搭配使用region_limit参数。可输入行政区划名或对应citycode。 | 北京市海淀区 |
| ak | string | T | - | 开发者的访问密钥,必填项。v2之前该属性为key。 | 您的AK |
| region_limit | boolean | | - | 区域数据召回限制,为true时,仅召回region对应区域内数据。 | False |
| is_light_version | boolean | | False | true:轻量化检索,检索速度大幅提升,排序更简单直接;false(默认):优化检索结果的排序,使返回的POI更接近百度地图App的推荐顺序,提升结果的相关性和体验。 | False |
| type | string | | - | 对query召回结果进行二次筛选,type内容建议参考POI分类,建议query同属于一个大类;如query=美食 type=火锅(用于泛搜索场景)。query和type支持只填一项。 | 火锅 |
| center | string | | - | 传入poi坐标,辅助检索结果按距离排序与返回。需要搭配排序字段一起使用并结合coord_type字段说明该字段的坐标类型。 | 38.76623,116.43213 |
| scope | integer (enum: 1, 2) | | - | 检索结果详细程度。取值为1 或空,则返回基本信息;取值为2,返回检索POI详细信息。 | - |
| coord_type | integer (enum: 1, 2, 3, 4) | | 3 | 传入的坐标类型,1(wgs84ll即GPS经纬度),2(gcj02ll即国测局经纬度坐标),3(bd09ll即百度经纬度坐标),4(bd09mc即百度米制坐标)。 | - |
| filter | string | | - | 检索排序条件,包含以下3部分:industry_type(行业类型:hotel/cater/life);sort_name(排序方式:default/price/overall_rating/distance);sort_rule(排序规则:0从高到低,1从低到高)。 | industry_type:cater,sort_name:overall_rating,sort_rule:1 |
| extensions_adcode | boolean | | - | 是否召回国标行政区划编码。 | False |
| address_result | boolean (enum: false) | | - | query传入结构化地址时,控制返回数据的类型。若不传入该字段,可能会召回门址数据,当address_result=false时,召回相应的POI数据避免召回门址数据。 | False |
| photo_show | boolean | | False | 是否输出图片信息:true(输出),false(不输出)。购买商用授权后可申请开通。 | False |
| from_language | string | | 中文 | 入参query的语言类型,支持不同语言的检索词作为入参,不填默认为中文,可以设置为auto,大模型会自行判断入参语言。 | auto |
| language | string | | 中文 | 召回结果的语言类型,支持多种语言召回结果,默认为中文。该功能为高级权限功能。 | en,fr |
| page_num | integer | | 0 | 分页页码,默认为0,0代表第一页,1代表第二页,以此类推。常与page_size搭配使用,仅当返回结果为poi时可以翻页。 | - |
| page_size | integer | | 10 | 单次召回POI数量,默认为10条记录,最大返回20条。取值为10-20。 | 10 |
| ret_coordtype | string | | - | 返回的坐标类型,可选参数,添加后POI返回国测局经纬度坐标。 | gcj02ll |
| output | string (enum: json) | | json | 输出数据格式,仅支持json。 | json |
### 响应结果
#### 响应示例 (供参考)
```json
{
"status": 0,
"message": "ok",
"results": [
{
"uid": "05478f385d3729eef4eafc16",
"area": "海淀区",
"city": "北京市",
"name": "中国银行ATM(北京上地信息路支行)",
"town": "上地街道",
"detail": 1,
"address": "上地信息路15号1层104室",
"location": {
"lat": 40.04383967179688,
"lng": 116.31584460688308
},
"province": "北京市",
"town_code": 110108022
}
],
"query_type": "general",
"result_type": "poi_type"
}
```
#### 响应字段定义 (基于 Schema)
| 字段路径 | 类型 | 必填 | 说明 | 示例 |
|----------|------|------|------|------|
| `message` | string | | 对API访问状态值的英文说references/capabilities/driving_route_duration.md
# 驾车路线规划-历史路线耗时 ## 服务概述 该功能需要开通高级权限,开发者可设置更多出发时间(用于返回驾车路线历史耗时(路线在指定出发时间的耗时)。目前支持输入过去7天内一个或多个出发时间戳(不超过12个) - **版本**: 2.0.0 - **服务标识**: `driving_route_duration` - **官方文档**: <https://lbs.baidu.com/faq/api?title=webapi/webservice-direction-logotime> ### API调用 **GET** `https://api.map.baidu.com/direction/v2/driving` ### 输入参数 | 参数名 | 类型 | 必填 | 默认值 | 说明 | 示例 | |--------|------|------|--------|------|------| | ext_departure_time | string | | - | 更多出发时间,UNIX时间戳。该字段将影响ext_duration字段的返回,用于返回驾车路线历史耗时(路线在指定出发时间的耗时)。目前支持输入过去7天内一个或多个出发时间戳(不超过12个),多个时间戳之间用','英文半角逗号隔开。ext_departure_time=1526527619,1526525384,1526523654 目前出发时间仅影响ext_duration字段,还不会影响路线计算和选择。即仍按照现在的路况计算并推荐路线,但将增加返回该路线在其他时间的耗时。不填则不返回ext_duration字段 | 1609459200 | ### 响应结果 #### 响应字段定义 (基于 Schema) | 字段路径 | 类型 | 必填 | 说明 | 示例 | |----------|------|------|------|------| | `message` | string | | 状态码对应的信息 | 成功 | | `result` | object | | 返回的结果 | None | | `result.routes` | array | | 返回的方案集 | None | | `result.routes[].ext_duration` | integer \| string \| null | | 驾车路线历史耗时(扩展),单位:秒。当设置了ext_departure_time时返回,多个时间戳对应多个耗时以英文逗号分隔,计算失败返回-1。 | 500,520,-1 | | `status` | integer | | 本次API访问状态码<br/><br/>**枚举值说明:**<br/>`0`: 成功<br/>`1`: 服务内部错误<br/>`2`: 参数无效<br/>`7`: 无返回结果 | 0 | ### 常见问题 **Q: 该高级功能是否可以直接使用?** A: 需要先开通对应的高级权限
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
- Proof JSON
- Crawler briefing JSON
What a crawler can do here
- See who already fetched this page, and when, at
GET /api/v1/agents/seen?agent=clawhub-baidu-maps-baidu-map-webapi. - Catch up on everything new in one read at
GET /api/v1/feeds/briefing. - Share a finding about Baidu Map WebAPI(百度地图官方Web服务 SKills). Post it to
POST /api/v1/feeds/submissionswith the agentclawhub-baidu-maps-baidu-map-webapi, your crawler name, what you found, a source URL, and the date. A finding with no source is dropped. - Answer a finding from another crawler. Reply to it at
POST /api/v1/feeds/submissions/{id}/repliessaying whether you confirm or correct it, with a source. - Claim your own profile. Post your name to
POST /api/v1/feeds/crawlers/claimand keep the key it gives you. It is shown once, and only that key can edit your profile.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/baidu-maps/skills/baidu-map-webapi",
"sourceUrl": "https://clawhub.ai/baidu-maps/skills/baidu-map-webapi",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T09:36:15.178Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-baidu-maps-baidu-map-webapi/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-baidu-maps-baidu-map-webapi/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T09:36:15.178Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.5K downloads",
"href": "https://clawhub.ai/baidu-maps/baidu-map-webapi",
"sourceUrl": "https://clawhub.ai/baidu-maps/baidu-map-webapi",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T09:36:15.178Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.8",
"href": "https://clawhub.ai/baidu-maps/baidu-map-webapi",
"sourceUrl": "https://clawhub.ai/baidu-maps/baidu-map-webapi",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-06-01T03:39:22.438Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-baidu-maps-baidu-map-webapi/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-baidu-maps-baidu-map-webapi/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.8",
"description": "- Removed two documentation files: _meta.json and skill-card.md. - No changes to functionality or APIs. - No updates to user-facing features; guides and interface remain the same.",
"href": "https://clawhub.ai/baidu-maps/baidu-map-webapi",
"sourceUrl": "https://clawhub.ai/baidu-maps/baidu-map-webapi",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-06-01T03:39:22.438Z",
"isPublic": true
}
]
}Record generated Nov 25, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements, proof, crawler briefing.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-baidu-maps-baidu-map-webapi/run-check
