第1行: | 第1行: | ||
{{car-sidebar}} | {{car-sidebar}} | ||
− | ==接口说明== | + | |
+ | == 接口说明 == | ||
+ | <span style="color:red;"> 车联网API服务的各种能力后续将合并到Web API服务中。自2015年12月31日起,车联网API服务将不再向新用户提供服务支持。已有用户服务暂不受影响,请已使用了各种车联网API服务的开发者,尽快升级服务到Web API中使用。</span> | ||
+ | |||
根据中心点坐标、检索半径、关键字查找周边信息,如苏州街周边3公里范围内的“酒店”。 | 根据中心点坐标、检索半径、关键字查找周边信息,如苏州街周边3公里范围内的“酒店”。 | ||
− | ==接口示例== | + | == 接口示例 == |
− | http://api.map.baidu.com/telematics/v3/local?location=116.305145,39.982368&keyWord=酒店&output=xml&ak=E4805d16520de693a3fe707cdc962045 | + | [http://api.map.baidu.com/telematics/v3/local?location=116.305145,39.982368&keyWord=酒店&output=xml&ak=E4805d16520de693a3fe707cdc962045 http://api.map.baidu.com/telematics/v3/local?location=116.305145,39.982368&keyWord=酒店&output=xml&ak=E4805d16520de693a3fe707cdc962045] |
− | ==接口参数设置== | + | == 接口参数设置 == |
{| | {| | ||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | ! width="100" | 参数类型 |
− | | | + | ! width="100" | 参数名称 |
− | | | + | ! width="100" | 是否必须 |
− | + | ! 具体描述 | |
|- | |- | ||
− | |String | + | | String |
− | | | + | | ak |
− | | | + | | true |
− | | | + | | 开发者密钥 |
|- | |- | ||
− | |String | + | | String |
− | | | + | | sn |
− | | | + | | false |
− | | | + | | 若用户所用ak的校验方式为sn校验时该参数必须。 ([http://developer.baidu.com/map/index.php?title=lbscloud/api/appendix sn生成算法]) |
|- | |- | ||
− | | | + | | String |
− | | | + | | keyWord |
− | |true | + | | true |
− | | | + | | 搜索关键词,如百度大厦,苏州街 |
|- | |- | ||
− | | | + | | Float |
− | | | + | | location |
− | | | + | | true |
− | | | + | | 搜索的坐标,如: location=116.305145,39.982368; |
|- | |- | ||
− | | | + | | String |
− | | | + | | tag |
− | |false | + | | false |
− | | | + | | 基础分类,如:” 生活服务”,详细分类http://developer.baidu.com/map/static/doc/BaiduMap_tag.zip |
|- | |- | ||
− | | | + | | Int |
− | | | + | | radius |
− | |false | + | | false |
− | | | + | | 搜索的范围半径,默认为3000m |
|- | |- | ||
− | | | + | | String |
− | | | + | | cityName |
− | |false | + | | false |
− | | | + | | 搜索的城市名;支持城市名,如:cityName ="北京" |
|- | |- | ||
− | |Int | + | | Int |
− | | | + | | sort_rule |
− | | | + | | false |
− | | | + | | 返回结果中的POI点与中心点的直线距离排序规则,取值如下:0:从近到远,1:从远到近。 |
|- | |- | ||
− | |Int | + | | Int |
− | | | + | | number |
− | |true | + | | true |
− | | | + | | 单页上所获取的数据的数目,默认为10条数据,单页最多可输出20条数据; |
|- | |- | ||
− | | | + | | Int |
− | | | + | | page |
− | | | + | | true |
− | | | + | | 获取指定页面的数据 |
|- | |- | ||
− | |String | + | | String |
− | | | + | | output |
− | |false | + | | false |
− | | | + | | 输出的数据格式,默认为xml格式,当output设置为’json’时,输出的为json格式的数据。 |
|- | |- | ||
− | |String | + | | String |
− | | | + | | coord_type |
− | |false | + | | false |
− | | | + | | 请求参数坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02、wgs84。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标。wgs84表示gps获取的坐标。 |
|- | |- | ||
− | |String | + | | String |
− | |callback | + | | out_coord_type |
− | |false | + | | false |
− | |将json格式的返回值通过callback函数返回以实现jsonp功能。举例:callback=showLocation(JavaScript函数名)。 | + | | 返回结果输出时的坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标。 |
+ | |- | ||
+ | | String | ||
+ | | callback | ||
+ | | false | ||
+ | | 将json格式的返回值通过callback函数返回以实现jsonp功能。举例:callback=showLocation(JavaScript函数名)。 | ||
|} | |} | ||
− | ==返回数据 | + | == 返回数据 == |
− | + | ||
− | + | ||
− | <pre> | + | == 返回xml格式的数据 == |
− | <localSearchResponse> | + | <pre><localSearchResponse> |
<status>Success</status> | <status>Success</status> | ||
<total>229</total>//搜索到的相关信息的数目 | <total>229</total>//搜索到的相关信息的数目 | ||
第121行: | 第123行: | ||
</pre> | </pre> | ||
− | ==返回json格式的数据== | + | == 返回json格式的数据 == |
− | + | <pre>{ | |
− | <pre> | + | |
− | { | + | |
status: "Success", | status: "Success", | ||
total: 229, | total: 229, |
2020年1月14日 (二) 16:28的版本
接口说明
车联网API服务的各种能力后续将合并到Web API服务中。自2015年12月31日起,车联网API服务将不再向新用户提供服务支持。已有用户服务暂不受影响,请已使用了各种车联网API服务的开发者,尽快升级服务到Web API中使用。
根据中心点坐标、检索半径、关键字查找周边信息,如苏州街周边3公里范围内的“酒店”。
接口示例
http://api.map.baidu.com/telematics/v3/local?location=116.305145,39.982368&keyWord=酒店&output=xml&ak=E4805d16520de693a3fe707cdc962045
接口参数设置
参数类型 | 参数名称 | 是否必须 | 具体描述 |
---|---|---|---|
String | ak | true | 开发者密钥 |
String | sn | false | 若用户所用ak的校验方式为sn校验时该参数必须。 (sn生成算法) |
String | keyWord | true | 搜索关键词,如百度大厦,苏州街 |
Float | location | true | 搜索的坐标,如: location=116.305145,39.982368; |
String | tag | false | 基础分类,如:” 生活服务”,详细分类http://developer.baidu.com/map/static/doc/BaiduMap_tag.zip |
Int | radius | false | 搜索的范围半径,默认为3000m |
String | cityName | false | 搜索的城市名;支持城市名,如:cityName ="北京" |
Int | sort_rule | false | 返回结果中的POI点与中心点的直线距离排序规则,取值如下:0:从近到远,1:从远到近。 |
Int | number | true | 单页上所获取的数据的数目,默认为10条数据,单页最多可输出20条数据; |
Int | page | true | 获取指定页面的数据 |
String | output | false | 输出的数据格式,默认为xml格式,当output设置为’json’时,输出的为json格式的数据。 |
String | coord_type | false | 请求参数坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02、wgs84。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标。wgs84表示gps获取的坐标。 |
String | out_coord_type | false | 返回结果输出时的坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标。 |
String | callback | false | 将json格式的返回值通过callback函数返回以实现jsonp功能。举例:callback=showLocation(JavaScript函数名)。 |
返回数据
返回xml格式的数据
<localSearchResponse> <status>Success</status> <total>229</total>//搜索到的相关信息的数目 <poiList>//搜索到的信息列表 <point> //第一条数据 <name>北京大地花园酒店</name> <city>北京市</city> <address>北京市海淀区海淀大街35号(近海淀桥南侧,近中关村图书大厦)</address> <telephone>(010)82615588</telephone> <location> <lng>116.30606594159</lng> <lat>39.982760910623</lat> </location> <website /> <distance>89</distance> <district>海淀区</district> <additionalInf>//该地点的相关其他信息 <name>北京大地花园酒店</name> <telephone>010-82615588</telephone> <address>北京市海淀区海淀大街35号(近海淀桥南侧,近中关村图书大厦)</address> <price>288.0</price>//平均消费价格 <tag>准三星酒店,中关村、上地</tag> </additionalInfo> <type /> </point> </poiList> </localSearchResponse>
返回json格式的数据
{ status: "Success", total: 229, pointList: [ { name: "北京大地花园酒店", cityName: "北京市", location: { l ng: 116.30606594159, lat: 39.982760910623 }, address: "北京市海淀区海淀大街35号(近海淀桥南侧,近中关村图书大厦)", district: null, additionalInformation: { name: "北京大地花园酒店", telepnone: "010-82615588", address: "北京市海淀区海淀大街35号(近海淀桥南侧,近中关村图书大厦)", price: "288.0", tag: "准三星酒店,中关村、上地", link: [{ name: "去哪儿", url: "http://hotel.qunar.com/city/beijing_city/dt-426/#ex_track=bd_ditu" }, { name: "到到网", url:"http://www.daodao.com/Hotel_Review-g294212-d606460-Reviews-m13829-Beijing_Dadi_Garden_Hotel-Beijing.html" }] }, type: "宾馆星级宾馆<font color="#c60a00">酒店</font>三星级" }] }