Hi guys,
Maps API V2 has stopped working for me today, citing a 'bad api key' error:
>>> g = Google()
>>> g.geocode('an address')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 81, in geocode
return self.geocode_url(url, exactly_one)
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 88, in geocode_url
return dispatch(page, exactly_one)
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 107, in parse_xml
self.check_status_code(status_code)
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 168, in check_status_code
raise GBadKeyError("The api_key is either invalid or does not match the domain for which it was given.")
geopy.geocoders.google.GBadKeyError: The api_key is either invalid or does not match the domain for which it was given.
I've also tried using the my API key (from the Google API Console):
>>> g = Google(api_key='AIzaSyArPsABms_FlecypnwTJZ5qZbacefefcL1E')
>>> g.geocode('an address')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 81, in geocode
return self.geocode_url(url, exactly_one)
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 88, in geocode_url
return dispatch(page, exactly_one)
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 107, in parse_xml
self.check_status_code(status_code)
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 168, in check_status_code
raise GBadKeyError("The api_key is either invalid or does not match the domain for which it was given.")
geopy.geocoders.google.GBadKeyError: The api_key is either invalid or does not match the domain for which it was given.
I've also tried using a domain, with the same results. I'm based in the UK, so I did:
>>> g = Google(api_key='AIzaSyArPsABms_FlecypnwTJZ5qZbacefefcL1E', domain='
maps.google.co.uk')
>>> g.geocode('an address')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 81, in geocode
return self.geocode_url(url, exactly_one)
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 88, in geocode_url
return dispatch(page, exactly_one)
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 107, in parse_xml
self.check_status_code(status_code)
File "/home/craig/.virtualenvs/aaa/local/lib/python2.7/site-packages/geopy/geocoders/google.py", line 168, in check_status_code
raise GBadKeyError("The api_key is either invalid or does not match the domain for which it was given.")
geopy.geocoders.google.GBadKeyError: The api_key is either invalid or does not match the domain for which it was given.
Do you guys have any idea what's causing this?