接口描述
请求路径:https://mapapi-places.apigw-gz.didiyunapi.com/api/v1/geocode/geo
请求方法:GET
输入参数
参数名称 | 必选 | 默认值 | 描述 |
---|---|---|---|
address | 是 | 无 | 结构化地址。规则是省、市、区县、城镇、乡村、街道、门牌号、屋邨、大厦。 |
components | 否 | 无 | 没有address时必填;有address时可选,用来过滤结果。但可能跟address字段冲突,也可能导致空结果,不建议跟address同时使用。 |
city | 否 | 无 | 若与address、components冲突,以city为准。支持省、市的中文、全拼、adcode格式输入。 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
status | int | 状态码 |
info | string | 状态说明 |
result | Result | 请求返回数据 |
Result:
参数名称 | 类型 | 描述 |
---|---|---|
count | int | 结果条数 |
pois | array<Pois> | 路线json数组 |
Pois:
参数名称 | 类型 | 描述 |
---|---|---|
citycode | string | 城市编码 |
distance | float | 该poi到请求点的距离,单位:米 |
adname | string | poi所在区县名称 |
name | string | 名称 |
district | string | 区县名称 |
tel | string | 电话 |
level | string | 匹配的行政区划级别 |
location | string | 经纬度 |
street_number | string | 门牌号 |
category_code | string | poi类型 |
adcode | string | poi所在区县编码 |
township | string | 乡镇 |
provincecode | string | poi所在省编码 |
business_area | string | 所在商圈 |
address | string | 结构化地址信息 |
street | string | 街道 |
cityname | string | poi所在城市名称 |
category | string | poi类型 |
id | string | 滴滴poi ID |
provincename | string | poi所在省名称 |
错误码
示例
请求:
curl -X GET \
'https://mapapi-places.apigw-gz.didiyunapi.com/api/v1/geocode/geo?address=%E5%8C%97%E4%BA%AC%E5%B8%82%E6%B5%B7%E6%B7%80%E5%8C%BA%E9%A2%90%E5%92%8C%E5%9B%AD%E8%B7%AF5%E5%8F%B7'\
--header 'Authorization: AppCode XXX'
输出:
{
"status": 0,
"info": "OK",
"result": {
"count": 1,
"pois": [
{
"citycode": "010",
"distance": 10.2,
"adname": "朝阳区",
"name": "凯晨世贸中心",
"district": "三间房乡",
"tel": "188888888",
"level": "1",
"location": "116.364881,39.906314",
"street_number": "1234",
"category_code": "10000",
"adcode": "110102",
"township": "定福庄",
"provincecode": "010",
"business_area": "传媒大学",
"address": "北京市西城区复兴门内大街28号",
"street": "西街",
"cityname": "北京",
"category": "美食",
"id": "2000000000000028666",
"provincename": "北京"
}
]
}
}