接口描述
请求路径:https://mapapi-routes.apigw-gz.didiyunapi.com/api/v1/traffic/circle
请求方法:GET
输入参数
参数名称 | 必选 | 默认值 | 描述 |
---|---|---|---|
center | 是 | 无 | 中心点坐标经纬度:lng,lat。经纬度小数点后不超过6位 |
radius | 否 | 500 | 搜索半径,0-5000米 |
city | 否 | 无 | 只返回city指定城市的结果。支持省、市中文、全拼、adcode格式输入。 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
status | int | 状态码 |
info | string | 状态说明 |
result | Result | 请求返回数据 |
Result:
参数名称 | 类型 | 描述 |
---|---|---|
description | string | 路况综述 |
evaluation | Evaluation | 路况评价 |
steps | array<Steps> | 路况评价 |
Evaluation
参数名称 | 类型 | 描述 |
---|---|---|
expedite | int | 畅通所占百分比 |
congested | int | 缓行百分比 |
blocked | int | 拥堵百分比 |
unknown | int | 未知路段所占百分比 |
Steps
参数名称 | 类型 | 描述 |
---|---|---|
outline | string | 路段坐标点串 |
traffic_status | string | 交通状况,//0畅通;1缓行;2拥堵;3无路况 |
错误码
示例
请求:
curl -X GET \
'https://mapapi-routes.apigw-gz.didiyunapi.com/api/v1/traffic/circle?center=116.358529,39.954762'\
--header 'Authorization: AppCode XXX'
输出:
{
"status": 0,
"info": "OK",
"result": {
"description": "路况综述",
"evaluation": {
"expedite": 0.76,
"congested": 0.32,
"blocked": 0.15,
"unknown": 0.11
},
"steps": [
{
"outline": "118.03918,34.50006|118.03924,34.50023|118.04052,34.50384|118.03919,34.50408",
"traffic_status": "0"
}
]
}
}