百度地图WEB服务-地点检索API
行政区划区域检索圆形区域检索矩形区域检索地点检索服务(又名Place API)是百度地图开放平台提供的Web API接口服务;
该服务提供多种场景的地点(POI)检索功能,包括行政区域检索、圆形区域检索、矩形区域检索。
行政区划区域检索
根据检索关键字返回指定行政区域内的指定地点信息
接口链接主体如下:
http://api./place/v2/search
该接口必填的请求参数如下
以上三个参数是接口请求的必填参数,使用时有以下说明:
region:此处可以填写指定的结构化地理信息,如:北京市;或填写地理位置的对应编码,具体编码内容参见:http://wiki./cms/citycode/BaiduMap_cityCode_1102.zipquery:行政区划区域检索不支持多关键字检索
同时此接口还提供以下参数辅助地点查询:
对于以上参数需注意以下事项:
coord_type:设置调用接口后返回数据中含有的经纬度坐标类型,可选坐标类型,1(wgs84ll即GPS经纬度),2(gcj02ll即国测局经纬度坐标),3(bd09ll即百度经纬度坐标),4(bd09mc即百度米制坐标)默认为3。scope:此参数决定返回是否返回POI信息,具体差别可参照以下请求实例
http://api./place/v2/search?ak=你的ak®ion=北京市&query=景点&output=json&page_size=1&page_num=1&scope=1
{"status":0,"message":"ok","total":400,"results":[{"name":"颐和园","location":{"lat":40.004869,"lng":116.278749},"address":"北京市海淀区新建宫门路19号","province":"北京市","city":"北京市","area":"海淀区","street_id":"2a7a25ecf9cf13636d3e1bad","telephone":"(010)62881144","detail":1,"uid":"2a7a25ecf9cf13636d3e1bad"}]}
http://api./place/v2/search?ak=你的ak®ion=北京市&query=景点&output=json&page_size=1&page_num=1&scope=2
{"status":0,"message":"ok","total":400,"results":[{"name":"颐和园","location":{"lat":40.004869,"lng":116.278749},"address":"北京市海淀区新建宫门路19号","province":"北京市","city":"北京市","area":"海淀区","street_id":"2a7a25ecf9cf13636d3e1bad","telephone":"(010)62881144","detail":1,"uid":"2a7a25ecf9cf13636d3e1bad","detail_info":{"tag":"旅游景点;文物古迹","navi_location":{"lng":116.27991,"lat":40.008881069203},"type":"scope","detail_url":"http://api./place/detail?uid=2a7a25ecf9cf13636d3e1bad&output=html&source=placeapi_v2","overall_rating":"4.8","comment_num":"100","children":[]}}]}
圆形区域检索
接口链接主体:
http://api./place/v2/search
此接口是根据给定的坐标地址(圆心位置)以及制定半径搜索以内的所有符合条件的地点信息,所以该接口请求参数大多与行政区域搜索相同,以下将列出不同的几个参数:
测试请求案例:
http://api./place/v2/search?query=酒店&location=39.915,116.404&radius=2000&output=json&ak=你的ak&page_num=1&page_size=1
接口返回信息:
{"status":0,"message":"ok","total":301,"results":[{"name":"东方君悦大酒店","location":{"lat":39.916116,"lng":116.42095},"address":"北京市东城区东长安街1号","province":"北京市","city":"北京市","area":"东城区","street_id":"504d6113c1140eaa46572655","telephone":"(010)85181234,(010)65109000","detail":1,"uid":"669775d035a11b42fd0eb03d"}]}
矩形区域检索
接口主体链接:
http://api./place/v2/search
此接口作用是搜索指定区域内符合条件的地址信息,该指定区域由参数中给定的多个经纬度坐标点决定,与圆形区域检索接口相同该接口请求参数大多与行政区域搜索相同,以下将列出不同的几个参数:
测试请求案例:
http://api./place/v2/search?output=json&query=银行&bounds=39.915,116.404,39.975,116.414&ak=Blj5DUjgDtE3g9PnhR39TBRnXcf2CvvR&page_size=1&page_num=1
接口返回信息:
{"status":0,"message":"ok","total":30,"results":[{"name":"北京银行(中轴路支行)","location":{"lat":39.957382,"lng":116.404191},"address":"北京市东城区安德路16号(洲际大厦首层)","province":"北京市","city":"北京市","area":"东城区","street_id":"33ddf832c2d7244952e5c51e","telephone":"95526","detail":1,"uid":"33ddf832c2d7244952e5c51e"}]}
更多有关地点检索API使用详情可查看官方服务文档:/index.php?title=webapi/guide/webservice-placeapi
相关百度地图方面博文后面会持续更新,欢迎大家支持。
如果觉得《百度地图WEB服务-地点检索API》对你有帮助,请点赞、收藏,并留下你的观点哦!