API 文档 / 地址解析 / 逆地理编码
逆地理编码
接口说明
经纬度 → 地址,支持全国坐标反查
输入示例:经纬度:116.480881,39.989410;半径:1000 米
返回示例:返回北京市 · 北京市 · 朝阳区 · 阜通东大街附近的地址、街道、门牌和周边信息。
请求地址
GEThttps://cloud.dtbgis.com/api/v1/regeocode
鉴权方式
在 HTTP Header 中携带你的 API Key:
X-API-Key: 你的API-Key
每个 Key 绑定已购接口与额度,调用成功扣减 1 次;调用失败(参数错误等)不扣额度。未开通该接口返回 403,额度耗尽返回 429。
请求参数
| 参数 | 必填 | 说明 | 示例 / 默认值 |
|---|---|---|---|
location |
必填 | 经纬度,格式 116.480881,39.989410 | 116.480881,39.989410 |
radius |
可选 | 搜索半径(米) | 1000 |
extensions |
可选 |
base 或 all
可选值:
默认、base base、all all |
base |
请求示例
curl -H "X-API-Key: 你的API-Key" \ "https://cloud.dtbgis.com/api/v1/regeocode?location=116.480881%2C39.989410&radius=1000&extensions=base"
import requests
resp = requests.get(
"https://cloud.dtbgis.com/api/v1/regeocode?location=116.480881%2C39.989410&radius=1000&extensions=base",
headers={"X-API-Key": "你的API-Key"},
)
print(resp.status_code, resp.json())
fetch("https://cloud.dtbgis.com/api/v1/regeocode?location=116.480881%2C39.989410&radius=1000&extensions=base", {
headers: { "X-API-Key": "你的API-Key" }
})
.then(r => r.json())
.then(console.log);
返回结果说明
所有接口统一返回 JSON 信封结构:
{
"code": 200,
"msg": "success",
"data": { ... },
"quota_remaining": 9999
}| 字段 | 说明 |
|---|---|
code | 业务状态码,200 表示成功 |
msg | 状态描述,成功为 success |
data | 本接口为上游服务代理,data 为 高德地图 Web 服务 的原始响应,字段以 官方文档 为准 |
quota_remaining | 本接口剩余可用调用次数 |
上游异常时 HTTP 仍为
200,需检查 data.status 判断上游是否成功(此类情况通常由系统自动切换 Key 处理)。错误码
错误以统一结构返回:{"detail": {"code": 429, "msg": "..."}}
| HTTP | 含义 | 常见原因 / 处理 |
|---|---|---|
400 | 参数错误 | 缺少必填参数或格式不合法 |
401 | 鉴权失败 | API Key 缺失、不存在、已停用或已过期 |
403 | 权限不足 | 该 Key 未开通此接口,请购买对应额度 |
429 | 额度耗尽 / 限流 | 额度用完需续费;或超过速率(60 秒 200 次) |
404 | 资源不存在 | 路径错误,或查询对象无数据 |
503 | 上游不可用 | 服务商暂时异常,稍后重试 |
完整错误码见 文档首页 · 错误码总览。