Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

retrieve points of interests (attractions/tourist places) of a place/country using google places api

I want to retrieve points of interests of a place/country through google places api say 'points of interests in london'. I want the results to be same as I google search it like [here][1. I've used something like this

'https://maps.googleapis.com/maps/api/place/radarsearch/json?location='+str(lat)+','+str(long)+'&radius=500&type=tourist&rankby=prominence&key=API_KEY')

where lat,long are respective latitude,longitude of that place/country.

But the resulting json file does not retrieve points of interests of that place rather it just outputs nearby places.

i also tried this

'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location='+str(lat)+','+str(long)+'&radius=500&type=tourist&&rankby=prominence&key=API_KEY'

which ended up in same results

is there any option to do it without using radius parameter

please do help me

like image 817
Albin Antony Avatar asked Jun 17 '16 05:06

Albin Antony


3 Answers

Try this google places API url. You will get the point of interest/Attraction/Tourists places in (For Eg:) New York City. You have to use the CITY NAME with the keyword Point Of Interest

https://maps.googleapis.com/maps/api/place/textsearch/json?query=new+york+city+point+of+interest&language=en&key=API_KEY

These API results are same as the results of the below google search results.

https://www.google.com/search?sclient=psy-ab&site=&source=hp&btnG=Search&q=New+York+point+of+interest

like image 199
SO-user Avatar answered Nov 15 '22 14:11

SO-user


Try this google place API url. https://maps.googleapis.com/maps/api/place/textsearch/json?query=point+of+interest+in+cityName&key=API_KEY

like image 34
Sutanu Rath Avatar answered Nov 15 '22 15:11

Sutanu Rath


I worked on a project that made extensive use of this functionality. In the end, the best way to get attractions in a city was to use a query like:

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=your-query-here&types=establishment&location=37.76999,-122.44696&radius=500&key=YOUR_API_KEY

If you want points of interest that aren't businesses, remove the types=establishment arg.

like image 40
duhaime Avatar answered Nov 15 '22 14:11

duhaime