百度開發者地址:http://developer.baidu.com/php
PlaceAPI接口文檔:http://developer.baidu.com/map/index.php?title=webapi/guide/webservice-placeapihtml
demo:http://yunpan.cn/c3xFQvwhrWMiU 訪問密碼 412cweb
一、申請百度地圖密鑰(ak)api
點擊建立應用ide
二、查看akui
三、圓形區域檢索(xml)url
請求參數htm
返回值:接口
//列表信息
<?xml version="1.0" encoding="utf-8" ?>
<PlaceSearchResponse>
<status>0</status>
<message>ok</message>
<total>14</total>
<results>
<result>
<name>儉樸菜酒店漢正街分店</name>
<location>
<lat>30.5757</lat>
<lng>114.278708</lng>
</location>
<address>中山大道352號(中山大道利濟南路交匯口)</address>
<telephone>(027)85658337</telephone>
<detail>1</detail>
<uid>b292b3aa959b5228be4842d4</uid>
<detail_info>
<tag>美食;中餐廳</tag>
<detail_url>http://api.map.baidu.com/place/detail?uid=您的ak&output=html&source=placeapi_v2</detail_url> //這裏能夠連接到詳情頁面
<type>cater</type>
<distance>1232</distance>
<price>39.0</price>
<overall_rating>3.7</overall_rating>
<service_rating>2.8</service_rating>
<environment_rating>2.8</environment_rating>
<image_num>36</image_num>
<comment_num>19</comment_num>
<di_review_keyword>Array</di_review_keyword>
</detail_info>
</result>
</results>
</PlaceSearchResponse>
四、Place詳情檢索服務
http://api.map.baidu.com/place/v2/detail?uid=5a8fb739999a70a54207c130&ak=您的ak&output=xml&scope=2
請求參數:
返回值
{
"status": 0,
"message": "ok",
"result": {
"name": "百度大廈員工食堂",
"location": {
"lng": 116.308022,
"lat": 40.056892
},
"address": "海淀區上地十街10號(近輝煌國際)",
"detail": 1,
"uid": "5a8fb739999a70a54207c130",
"detail_info": {
"tag": "美食;其餘",
"detail_url": "http://api.map.baidu.com/place/detail?uid=5a8fb739999a70a54207c130&output=html&source=placeapi_v2",
"type": "cater",
"price": "11.0",
"overall_rating": "4.0",
"taste_rating": "4.0",
"service_rating": "4.0",
"environment_rating": "4.0",
"image_num": "2",
"comment_num": "8",
"shop_hours": "早9點到晚8點",
"atmosphere": "",
"featured_service": "",
"recommendation": "麻辣燙,烤魚",
"description": "門店介紹:"
}
}
}
注意:必須先有百度帳號,才能成爲開發者,申請密鑰