{"action":"opened","issue":{"url":"https://api.github.com/repos/googlemaps/google-maps-services-python/issues/145","repository_url":"https://api.github.com/repos/googlemaps/google-maps-services-python","labels_url":"https://api.github.com/repos/googlemaps/google-maps-services-python/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/googlemaps/google-maps-services-python/issues/145/comments","events_url":"https://api.github.com/repos/googlemaps/google-maps-services-python/issues/145/events","html_url":"https://github.com/googlemaps/google-maps-services-python/issues/145","id":169506262,"number":145,"title":"Can't retrieve paginated results using 'places_nearby' method","user":{"login":"WesleyBatista","id":755254,"avatar_url":"https://avatars.githubusercontent.com/u/755254?v=3","gravatar_id":"","url":"https://api.github.com/users/WesleyBatista","html_url":"https://github.com/WesleyBatista","followers_url":"https://api.github.com/users/WesleyBatista/followers","following_url":"https://api.github.com/users/WesleyBatista/following{/other_user}","gists_url":"https://api.github.com/users/WesleyBatista/gists{/gist_id}","starred_url":"https://api.github.com/users/WesleyBatista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WesleyBatista/subscriptions","organizations_url":"https://api.github.com/users/WesleyBatista/orgs","repos_url":"https://api.github.com/users/WesleyBatista/repos","events_url":"https://api.github.com/users/WesleyBatista/events{/privacy}","received_events_url":"https://api.github.com/users/WesleyBatista/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-05T00:48:27Z","updated_at":"2016-08-05T00:48:27Z","closed_at":null,"body":"Hello guys!\r\n\r\nConsulting the [docs](https://developers.google.com/places/web-service/search#PlaceSearchResults), I see that to get the next page of results we just need to set the `page_token` parameter with the `next_page_token` from the last response.\r\n\r\nSo, here is what I am using to paginate:\r\n```python\r\nimport googlemaps\r\ngmaps = googlemaps.Client(key=__API_KEY)\r\nparams = {\r\n    'location': (-23.56, -46.7),\r\n    'radius': 90\r\n}\r\nresult = gmaps.places_nearby(**params)\r\n\r\n# ...\r\n\r\nif 'next_page_token' in result.keys(): \r\n    while 'next_page_token' in result.keys():\r\n        print result['next_page_token']\r\n        params.update({\"page_token\": result[\"next_page_token\"]})\r\n        result = gmaps.places_nearby(**params)\r\n```\r\n\r\nAnd this is what I am getting:\r\n```\r\n---------------------------------------------------------------------------\r\nApiError                                  Traceback (most recent call last)\r\n<ipython-input-78-71bc14e5bc08> in <module>()\r\n      6         params.update({\"page_token\": result[\"next_page_token\"]})\r\n      7         print params\r\n----> 8         result = gmaps.places_nearby(**params)\r\n      9     #     a.append(result[\"results\"])\r\n\r\n/Library/Python/2.7/site-packages/googlemaps/places.pyc in places_nearby(client, location, radius, keyword, language, min_price, max_price, name, open_now, rank_by, type, page_token)\r\n    142                    keyword=keyword, language=language, min_price=min_price,\r\n    143                    max_price=max_price, name=name, open_now=open_now,\r\n--> 144                    rank_by=rank_by, type=type, page_token=page_token)\r\n    145 \r\n    146 \r\n\r\n/Library/Python/2.7/site-packages/googlemaps/places.pyc in _places(client, url_part, query, location, radius, keyword, language, min_price, max_price, name, open_now, rank_by, type, page_token)\r\n    229 \r\n    230     url = \"/maps/api/place/%ssearch/json\" % url_part\r\n--> 231     return client._get(url, params)\r\n    232 \r\n    233 \r\n\r\n/Library/Python/2.7/site-packages/googlemaps/client.pyc in _get(self, url, params, first_request_time, retry_counter, base_url, accepts_clientid, extract_body, requests_kwargs)\r\n    238                 result = extract_body(resp)\r\n    239             else:\r\n--> 240                 result = self._get_body(resp)\r\n    241             self.sent_times.append(time.time())\r\n    242             return result\r\n\r\n/Library/Python/2.7/site-packages/googlemaps/client.pyc in _get_body(self, resp)\r\n    263                     body[\"error_message\"])\r\n    264         else:\r\n--> 265             raise googlemaps.exceptions.ApiError(api_status)\r\n    266 \r\n    267     def _generate_auth_url(self, path, params, accepts_clientid):\r\n\r\nApiError: INVALID_REQUEST\r\n```\r\n\r\nAm I doing something wrong?"}}
{"actor":{"display_login":"WesleyBatista"}}