2014-02-21 62 views
0

所以我運行下面的谷歌Places API的調用:我的JSON輸出的Android的 - 谷歌Places API的 - 沒有 「評論」 陣列

https://maps.googleapis.com/maps/api/place/search/json?location=34.0467359,-118.441764&rankby=distance&sensor=true&key=MY_API_KEY&types=restaurant

部分是:

"results" : [ 
    { 
    "geometry" : { 
     "location" : { 
      "lat" : 34.047332, 
      "lng" : -118.443431 
     } 
    }, 
    "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png", 
    "id" : "03ed19ca32b20080897e31095e6eed2715cde819", 
    "name" : "Del Taco", 
    "opening_hours" : { 
     "open_now" : true 
    }, 
    "price_level" : 1, 
    "reference" : "CnRrAAAA6Dqit_GeW6rLNFXGo4cb-SBPdIr09vVlvU7n2W8QVesy6svOTDQu-lkhbdWPBPM64uR3a8pwer_dwbwi1weyKXIhTYAa0deSu4-Xp3S8K2LvPexGFCd7oasJ1dK8ZtCAA4IvwQbpkM6GaJ9xCn1jqRIQ63-ofgMIddQpjtHoJcOlVhoUDwWYwlyV3hyVg-4jYExfcPPxhU4", 
    "types" : [ "restaurant", "food", "establishment" ], 
    "vicinity" : "11066 Santa Monica Blvd, Los Angeles" 
    }, 
    { 
    "geometry" : { 
     "location" : { 
      "lat" : 34.047475, 
      "lng" : -118.443474 
     } 
    }, 
    "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png", 
    "id" : "6e6ae3ea79f06eb6c790ed533a35d9b3abc6c344", 
    "name" : "Moon House Chinese Cuisine", 
    "opening_hours" : { 
     "open_now" : true 
    }, 
    "price_level" : 1, 
    "reference" : "CoQBfAAAAFmSc3ErmitzFoxmNvuNXG5x0iJCWpXITFr9VtKcA5SRpcSyXmFW9LR_F2vLVUC4dCCSo7xQm_l_JaOuAttZmYJDonYNnobGAT6fVXR1Gw_p3lmJWwKgd7zTqeMCGXPk8kBT6ztYWzLpTEnKtg2u9jFRvYUerdBsv1Keso3yXVESEhBGizJBrGPMBDz2nte3wF81GhQ21SBkMNMSG6Bx0Ymi65rr2jyQBg", 
    "types" : [ "restaurant", "food", "establishment" ], 
    "vicinity" : "11058 Santa Monica Blvd, Los Angeles" 
    }, 

我檢查返回的JSON,我甚至沒有看到「評論」數組。但我檢查了同一地點的谷歌地圖,我可以看到有幾條評論。任何想法,爲什麼它不包括?

回答

3

奧萊特問題是,地方API doesen't包括評論。但如果你想獲得評論,那麼你必須提出詳細的要求。

如:這是樣品的地方要求

https://maps.googleapis.com/maps/api/place/nearbysearch/json? 
location=34.0467359,-118.441764&radius=1000&sensor=true 
&key=YOUR_PLACE_API_KEY&types=restaurant 

這是樣本地點的詳細信息請

https://maps.googleapis.com/maps/api/place/details/json? 
reference=REFERENCE_STRING_OF_THE_PLACE&sensor=true&key=YOUR_PLACE_API_KEY 
+0

這是正確的。如果你想要評論,你需要同時打這兩個電話。撥打搜索電話以查找位置,並針對您希望評論的每個位置進行詳細通話。 – Bobbake4

+0

哇哇!謝謝@kevz – MoMoney

0

代替search使用near by search如下: -

,也包括半徑:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=34.0467359,-118.441764&radius=50000&sensor=true&key=MY_API_KEY&types=restaurant 
+0

這並沒有什麼差別。我已經嘗試過。不知道有什麼區別,但無論如何它沒有幫助。 – MoMoney