Using the Google Geocoder without an API key

3,039 views
Skip to first unread message

bkmontgomery

unread,
Jun 1, 2010, 10:49:06 PM6/1/10
to geopy
Hello. I'm new to Geocoding and GIS in general, and geopy seems like
a great project. I've got geopy-0.94 and have been playing with the
Google Geocoder on the console, but I haven't got an API key. The
following code works just fine for me, and returns satisfactory
results:

>>> from geopy import geocoders
>>> g = geocoders.Google()
>>> g.geocode('Some address')

So my question is, do I really need an API key to use Google's
geocoder? The geocoders.Google docstring says the API key is required
for the maps/geo resource, which appears to be the default. Am I
missing something?

Thanks!

Mike Tigas

unread,
Jun 15, 2010, 2:10:33 AM6/15/10
to geopy
maps/geo (which is the now-deprecated Geocoding API V2:
http://code.google.com/apis/maps/documentation/geocoding/v2/index.html
) *technically* requires an API key, but it appears that the API
doesn't fail requests with invalid API keys at the moment.

So yes, you can get away with using GeoPy without an API key, but your
mileage may vary. My concern would be whether Google has a lower rate
limit (against your IP address) when using an invalid key — I’d play
it safe and grab a key, if possible. Since GeoPy is simply a frontend
to the API, by using the Google backend you’re still technically
required to abide by their terms of service: http://code.google.com/apis/maps/terms.html

If I can get the time to update the backend to use the Geocoding API
V3 ( http://code.google.com/apis/maps/documentation/geocoding/ ), this
won’t be an issue since the new geocoder API does not use API keys.
(Issue 34, updating to V3: http://code.google.com/p/geopy/issues/detail?id=34
) I’ll be working on this (and other big things for the next version)
throughout the summer.
Reply all
Reply to author
Forward
0 new messages