2

I am using PyGeocoder

https://bitbucket.org/xster/pygeocoder/wiki/Home

I have created an API key with the simple server option, this does not present me with a CLIENT_ID option.

So I have the code:

from pygeocoder import Geocoder
business_geocoder = Geocoder(None, 'MY_API_KEY')
address_string = "London, United Kingdom"
results = business_geocoder.geocode(address_string)

This works fine, but my quote usage is not being reported in the admin console window, and I can change my API_key to any value and it still works. Is anyone else using this feature and if so how did you implement?

E.g. this code works

business_geocoder = Geocoder(client_id=None, private_key='whatever')

This code, gives an error:

business_geocoder = Geocoder(client_id="some", private_key='whatever')

pygeolib.GeocoderError: Error Forbidden, 403
Query: https://maps.google.com/maps/api/geocode/json?language=&region=&signature=hrlktNatq4RvlN9Cvd6VNQf8FMw%3D&bounds=&client=some&components=&address=Barnfield+Drive%2C+Chichester%2C+United+Kingdom&sensor=false

1 Answer 1

2

Google documentation seems to indicate that the Simple API key authentication method is not supported with Geocoding APIs but they still work somehow.

I just updated version 1.2.3 of pygeocoder so you should be able to just do

Geocoder('YOUR_API_KEY').geocode(...

after you upgrade your module

pip install --upgrade pygeocoder
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.