百度实时路况接口服务,基于用户输入的道路名称,提供该道路的实时路况查询,参考图:http://v.juhe.cn/trafficInfo/搜索路况.png http://v.juhe.cn/trafficInfo/逐向路况.png
接口平台:聚合数据
接口地址:http://v.juhe.cn/trafficInfo/getTrafficInfoByName
支持格式:json/xml
请求方式:http get/post
请求示例:http://v.juhe.cn/trafficInfo/getTrafficInfoByName.php?longitude=117.041217&latitude=36.660453&cityName=济南市&roadName=和平路&key=您的APPKEY
JSON返回示例:
{
"reason": "查询成功",
"result": {
"roadInfo": { 搜索道路信息
"roadLength": 3401, 所搜道路长度 单位:米
"roadName": "和平路", 搜索道路的名称
"cityName": "济南市" 搜索道路所在城市名称
},
"traffic": {
"trendInfo": [ 不同方向道路路况
[
{
"RL": 253, 该路段长度(米)
"IL": 117.035527, 下一路口经度
"AS": 32, 该路段平均速度
"TT": 1, 道路拥堵状态 1:畅通,2:缓行,3:拥堵,4:无路况,5: 严重拥堵
当 TT 值为 4 时,result.traffic 中的路况信息的 字段(AS,MS,CT)无效,默认值用-1 表示。
"CT": 1449108688, 该路段路况更新时间 UNIX 时间戳
"PT": 28, 该路段预计通过时间单位:秒
"HT": 0, 是否是历史路况数据 1:是; 0:否
"IN": "山师北街", 下一路口名称
"IB": 36.660371, 下一路口纬度
"MS": 47, 该路段最大速度
"IR": 2 下一路口等级
},
{
"RL": 331,
"IL": 117.038831,
"AS": 0,
"TT": 4,
"CT": 1449108754,
"PT": 39,
"HT": 0,
"IN": "山师东路",
"IB": 36.660507,
"MS": 0,
"IR": 2
},
{
"RL": 443,
"IL": 117.043247,
"AS": 0,
"TT": 4,
"CT": 1449108702,
"PT": 53,
"HT": 0,
"IN": "羊头峪东沟街",
"IB": 36.660683,
"MS": 0,
"IR": 2
},
{
"RL": 652,
"IL": 117.049755,
"AS": 30,
"TT": 1,
"CT": 1449108608,
"PT": 78,
"HT": 0,
"IN": "山大路",
"IB": 36.660732,
"MS": 41,
"IR": 1
},
{
"RL": 680,
"IL": 117.056551,
"AS": -1,
"TT": 4,
"CT": -1,
"PT": 81,
"HT": 0,
"IN": "燕子山小区东路",
"IB": 36.66066,
"MS": -1,
"IR": 2
},
{
"RL": 223,
"IL": 117.058773,
"AS": -1,
"TT": 4,
"CT": -1,
"PT": 26,
"HT": 0,
"IN": "燕子山路",
"IB": 36.660649,
"MS": -1,
"IR": 2
},
{
"RL": 610,
"IL": 117.064868,
"AS": -1,
"TT": 4,
"CT": -1,
"PT": 73,
"HT": 0,
"IN": "甸新东路",
"IB": 36.660648,
"MS": -1,
"IR": 2
},
{
"RL": 212,
"IL": 117.066969,
"AS": -1,
"TT": 4,
"CT": -1,
"PT": 25,
"HT": 0,
"IN": "二环东路辅路",
"IB": 36.66064,
"MS": -1,
"IR": 1
}
],
[
{
"RL": 212,
"IL": 117.064867,
"AS": -1,
"TT": 4,
"CT": -1,
"PT": 25,
"HT": 0,
"IN": "甸新东路",
"IB": 36.660702,
"MS": -1,
"IR": 2
},
{
"RL": 610,
"IL": 117.058774,
"AS": -1,
"TT": 4,
"CT": -1,
"PT": 73,
"HT": 0,
"IN": "燕子山路",
"IB": 36.660702,
"MS": -1,
"IR": 2
},
{
"RL": 223,
"IL": 117.056551,
"AS": -1,
"TT": 4,
"CT": -1,
"PT": 26,
"HT": 0,
"IN": "燕子山小区东路",
"IB": 36.660713,
"MS": -1,
"IR": 2
},
{
"RL": 669,
"IL": 117.049863,
"AS": -1,
"TT": 4,
"CT": -1,
"PT": 80,
"HT": 0,
"IN": "山大路",
"IB": 36.660783,
"MS": -1,
"IR": 1
},
{
"RL": 581,
"IL": 117.044063,
"AS": 38,
"TT": 1,
"CT": 1449108476,
"PT": 55,
"HT": 0,
"IN": "历山东路",
"IB": 36.660761,
"MS": 47,
"IR": 2
},
{
"RL": 520,
"IL": 117.038872,
"AS": 19,
"TT": 2,
"CT": 1449108733,
"PT": 98,
"HT": 0,
"IN": "山师东路",
"IB": 36.660563,
"MS": 24,
"IR": 2
},
{
"RL": 336,
"IL": 117.035522,
"AS": 28,
"TT": 1,
"CT": 1449108749,
"PT": 43,
"HT": 0,
"IN": "山师北街",
"IB": 36.660425,
"MS": 31,
"IR": 2
},
{
"RL": 250,
"IL": 117.033031,
"AS": 25,
"TT": 1,
"CT": 1449108667,
"PT": 36,
"HT": 0,
"IN": "泺源大街",
"IB": 36.660337,
"MS": 25,
"IR": 1
}
]
],
"trafficText": [ 路况信息文本
{
"textInfo": [],
"trend": "由西向东" 道路上行或下行路况信息文本描述
},
{
"textInfo": [ 道路上行或下行路况信息文本描述详细信息
{
"TT": 2, 路况信息描述文本路况等级 1:畅通,2:缓行,3:拥 堵,4:无路况,5:严重拥堵
"startSG": 5, 路况信息文本描述起始 roadSegment 的序号
"endSG": 8, 路况信息文本描述结束 roadSegment 的序号
"text": "从山大路到泺源大街缓行时速19," 文本内容
}
],
"trend": "由东向西"
}
]
}
},
"error_code": 0
}