slimkrazy / python-google-places

Simple wrapper around the new 'experimental' Google Places API
MIT License
461 stars 167 forks source link

Get More than 60 results #103

Open ravipatel2293 opened 7 years ago

ravipatel2293 commented 7 years ago

Hello, This library is pretty cool. I'm loving it to use in my application. But here, i have small concern. Google place api is limited to give upto 60 results around a lat and long.So is there a way so i can get more than 60 results around a particular lat and long? Because currently i can get only 60 clinics in my app when user search even thought there are around 250 clinics around 20,000 meters of particular lat and log.

SBillion commented 6 years ago

@ravipatel2293 The only way you have is to move around your lat/lng to get 60 results again and merge. This is not something to do for an UI search but more to find all clinics in a zone. You could do a script for this and keep the google_place_ids in your database (you have the right to do this). This is a good way to get a populated map on your side. Use the Details API to get information on the place from google and add some from your business

joeyk16 commented 5 years ago

@ravipatel2293 I know this is old but I may help someone else.

I wrote this solution in ruby.

![alt text](https://i.imgur.com/hM9dtQ4.jpg "Logo Title Text 1")

  1. Get the south west, and north east coordiate.

  2. Then you will have to create the coordinates for a grid. For ruby I used the GeoPoint gem. For a point I can say give me the coordinates 1km west of this point GeoPoint.new(point_1.destination_point(0, 1.0).to_dms)

  3. Once you have the list of coordinates (from the grid) send them all one by one to Google Places to generate a list.

  4. Merge the list and make sure they're unique.