接口描述
请求路径:https://mapapi-places.apigw-gz.didiyunapi.com/api/v1/district
请求方法:GET
输入参数
参数名称 | 必选 | 默认值 | 描述 |
---|---|---|---|
keywords | 是 | 无 | 搜索关键词。 |
city | 否 | 无 | 指定城市,支持省、市中文、全拼、adcode格式输入,暂不支持全拼输入 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
status | int | 状态码 |
info | string | 状态说明 |
result | Result | 请求返回数据 |
Result:
参数名称 | 类型 | 描述 |
---|---|---|
districts | array<District> |
District:
参数名称 | 类型 | 描述 |
---|---|---|
citycode | string | 城市编码 |
adcode | string | 行政区域编码 |
name | string | 行政区名称 |
fullname | string | 行政区全称 |
outline | string | 行政区边界坐标点,行政区有多块时用 |
center | string | 行政区中心点 |
level | string | 行政区划级别:省/市/区县 |
错误码
示例
请求:
curl -X GET \
'https://mapapi-places.apigw-gz.didiyunapi.com/api/v1/district?keywords=%E9%95%BF%E6%B2%BB'\
--header 'Authorization: AppCode XXX'
输出:
{
"status": 0,
"info": "OK",
"result": {
"districts": [
{
"citycode": "140400",
"adcode": "",
"name": "长治市",
"fullname": "山西省长治市",
"outline": "",
"center": "113.11649,36.19581",
"level": ""
}
]
}
}