Python & Google Places API | Want to get all Restaurants at a specific postion
Question: I want to get all restaurants in London by using python 3.5 and the module
"googlePlaces" with the Google Places API. I read the "googleplaces"
documentation and searched here. But I don't get it. Thats my Code so far:

    
    
    from googleplaces import GooglePlaces, types, lang
    
    API_KEY = 'XXXCODEXXX'
    
    google_places = GooglePlaces(API_KEY)
    
    query_result = google_places.nearby_search(
        location='London', keyword='Restaurants',
        radius=1000, types=[types.TYPE_RESTAURANT])
    
    if query_result.has_attributions:
    print query_result.html_attributions
    
    
    for place in query_result.places:
        place.get_details()
        print place.rating 
    

The Code doesn't work. What can I do to get a list with all Restaurants in
this area? Thanks


Answer: It'll be better if you drop the `keyword` parameter, `types` already searches
for restaurants.

Bear in mind the Places API (as other Google Maps APIs) is not a database, it
will not return all results that match. Actually returns only 20, and you can
get an extra 40 or so, but that's all.

If I'm reading the [GooglePlaces](https://github.com/slimkrazy/python-google-
places/blob/master/googleplaces/__init__.py) correctly, your code will send an
API request such like:

[http://maps.googleapis.com/maps/api/place/nearbysearch/json?location=51.507351,-0.127758&radius=1000&types=restaurant&keyword=Restaurants&key=YOUR_API_KEY](http://maps.googleapis.com/maps/api/place/nearbysearch/json?location=51.507351,-0.127758&radius=1000&types=restaurant&keyword=Restaurants&key=YOUR_API_KEY)

If you just drop the `keyword` parameter, it'll be like:

[http://maps.googleapis.com/maps/api/place/nearbysearch/json?location=51.507351,-0.127758&radius=1000&types=restaurant&key=YOUR_API_KEY](http://maps.googleapis.com/maps/api/place/nearbysearch/json?location=51.507351,-0.127758&radius=1000&types=restaurant&key=YOUR_API_KEY)

The difference is subtle: `keyword=Restaurants` will make the API match
results that have the word "Restaurants" in their name, address, etc. Some of
these may not be restaurants (and will be discarded), while some actual
restaurants may not have the word "Restaurants" in them.

