I've written a script to send an address to Google Maps' API and receive back the Lat and Lng. However, I'm receiving error messages that I've exceeded Google's rate limit after 20 or so queries. Is there something I'm not considering?
I'd appreciate any help. I'm very new at using API's so better understanding why I'm hitting the rate limit would be very helpful.
After reading the addresses from a csv file named Location, below is my relevant code.
for row in locations:
address = 'XXX, New Haven, CT'
first = re.search('^(.*),',row[0])
address = re.sub('XXX',first.group(), address)
lat, lng = gmaps.address_to_latlng(address)
And my error message is below.
Traceback (most recent call last):
File "<input>", line 5, in <module>
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/googlemaps-1.
0.2-py2.7.egg/googlemaps.py", line 310, in address_to_latlng
return tuple(self.geocode(address)['Placemark'][0]['Point']['coordinates'][1
::-1])
File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/googlemaps-1.
0.2-py2.7.egg/googlemaps.py", line 262, in geocode
raise GoogleMapsError(status_code, url, response)
GoogleMapsError: Error 620: G_GEO_TOO_MANY_QUERIES