批量服务
POST
/batch
返回码 | 英文描述 | 定义 | 常见原因 |
---|---|---|---|
0 | ok | 正常 | 服务请求正常召回 |
-1 | 用户请求格式错误 | json请求正文不符合规定的格式 | |
-2 | 返回数据格式非json错误 | json里的请求子串使用了callback参数 | |
-3 | 服务不支持 | 访问了非正逆编码服务 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://api.map.baidu.com/batch?ak=&sn=' \
--header 'Content-Type: application/json' \
--data-raw '{
"reqs": [
{
"method": "string",
"url": "string"
}
]
}'
响应示例响应示例
{
"status": 0,
"batch_result": [
{
"status": 0,
"result": {
"location": {
"lng": 106.3795289775268,
"lat": 29.609004995890615
},
"precise": 1,
"confidence": 100,
"comprehension": 100,
"level": ""
}
},
{
"status": 0,
"result": {
"location": {
"lng": 119.74541499999992,
"lat": 35.65865089820304
},
"formatted_address": "山东省青岛市黄岛区港兴大道",
"business": "",
"addressComponent": {
"country": "中国",
"country_code": 0,
"country_code_iso": "CHN",
"country_code_iso2": "CN",
"province": "山东省",
"city": "青岛市",
"city_level": 2,
"district": "黄岛区",
"town": "",
"adcode": "370211",
"street": "港兴大道",
"street_number": "",
"direction": "",
"distance": ""
},
"pois": [],
"roads": [],
"poiRegions": [],
"sematic_description": "",
"cityCode": 236
}
}
]
}
请求参数
Query 参数
ak
string
必需
默认值:
{{ak}}
sn
string
可选
默认值:
{{sn}}
Body 参数application/json
返回响应
修改于 2022-08-22 02:56:20