驾车路线规划
GET
/direction/v2/driving
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request GET 'https://api.map.baidu.com/direction/v2/driving?origin=40.01116,116.339303&destination=39.936404,116.452562&ak=&sn='
响应示例响应示例
{
"status": "string",
"message": "string",
"type": 0,
"result": {
"restriction": "string",
"duration": 0,
"total": 0,
"routes": {
"origin": {
"lng": 0,
"lat": 0
},
"destination": {
"lng": 0,
"lat": 0
},
"tag": "string",
"route_id": "string",
"distance": 0,
"duration": 0,
"ext_duration": 0,
"suggest_departure_time": 0,
"taxi_fee": 0,
"toll": 0,
"toll_distance": 0,
"steps": {
"leg_index": 0,
"direction": 0,
"distance": 0,
"road_name": "string",
"road_type": "string",
"toll": 0,
"toll_distance": 0,
"toll_gate_name": "string",
"toll_gate_location": {
"lng": 0,
"lat": 0
},
"start_location": {
"lng": 0,
"lat": 0
},
"end_location": {
"lng": 0,
"lat": 0
},
"path": "string",
"adcodes": "string",
"traffic_condition": {
"status": 0,
"geo_cnt": 0,
"distance": 0
}
}
}
},
"end_walkinfo": {
"distance": 0,
"path": "string"
},
"start_walkinfo": {
"distance": 0,
"path": "string"
}
}
请求参数
Query 参数
origin
string
必需
示例值:
40.01116,116.339303
destination
string
必需
示例值:
39.936404,116.452562
origin_uid
string
可选
destination_uid
string
可选
waypoints
string
可选
coord_type
string
可选
示例值:
bd09II
ret_coordtype
string
可选
示例值:
bd09II
tactics
integer
可选
示例值:
0
alternatives
string
可选
示例值:
0
cartype
integer
可选
示例值:
0
plate_number
string
可选
departure_time
string
可选
ext_departure_time
string
可选
expect_arrival_time
string
可选
gps_direction
integer
可选
radius
number
可选
speed
number
可选
output
string
可选
timestamp
integer
可选
callback
string
可选
intelligent_plan
integer
可选
walkinfo
integer
可选
ak
string
必需
默认值:
{{ak}}
sn
string
可选
默认值:
{{sn}}
返回响应
修改于 2022-08-22 02:01:33