Android - Google Places API - No “reviews” Array

こ雲淡風輕ζ 提交于 2019-11-29 17:36:18

Allright the problem is that place API doesen't include reviews. But if u want to get reviews then u have to make place detail request.

eg: this is sample place request

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

this is sample place details request

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

Instead of search use near by search as follows:-

and also include radius :

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

You can get review array by place detail API

https://maps.googleapis.com/maps/api/place/details/json?placeid={place_id}&key={api_key}

where place id is results id field from your response,

Ex. "id" : "03ed19ca32b20080897e31095e6eed2715cde819",

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!