Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<[REQUEST_DENIED] Google - Geocode [empty]> #440

Open
joebling opened this issue May 30, 2021 · 3 comments
Open

<[REQUEST_DENIED] Google - Geocode [empty]> #440

joebling opened this issue May 30, 2021 · 3 comments

Comments

@joebling
Copy link

when i have installed geocoder, run the examples in readme.md, it shows:

g = geocoder.google([-6.1166283, 106.88594], method='reverse')
g
<[REQUEST_DENIED] Google - Reverse [empty]>

@Kalebu
Copy link

Kalebu commented Jun 7, 2021

I'm having the same error with normal geocoding

>>> g = geocoder.google('Mbezi, Tanzania')
>>> g
<[REQUEST_DENIED] Google - Geocode [empty]>

@gpsugy
Copy link

gpsugy commented Jun 14, 2021

Not sure when this got implemented, but I noticed we now need to include the third parameter key=[YOUR_API_KEY]. For example, g = geocoder([-6.1166283, 106.88594], method='reverse', [YOUR_API_KEY])

If that still does not work, you likely need to enable Billing for the project: https://console.cloud.google.com/billing

@BigBaaadBob
Copy link

BigBaaadBob commented Jun 21, 2021

I have the same problem. I have billing set up and the python googlemaps code works with the apikey, but the geocoder doesn't:

$ python
Python 3.9.5 (default, May 18 2021, 14:42:02) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import googlemaps
>>> import os
>>> gmaps = googlemaps.Client(key=os.getenv('GOOGLE_API_KEY'))
>>> tz = gmaps.timezone((45.15, -75.14))
>>> tz
{'dstOffset': 3600, 'rawOffset': -18000, 'status': 'OK', 'timeZoneId': 'America/Toronto', 'timeZoneName': 'Eastern Daylight Time'}
>>> quit()

$ geocode '45.15, -75.14' --provider google --method timezone
{"raw": {"errorMessage": "You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account", "status": "REQUEST_DENIED"}, "status": "ERROR - No results found", "ok": false}

FWIW, I use the environment variable in the above, but I get the same result if I use the key parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants