Why does the below piece of code give None as the output?
import geocoder
g = geocoder.google('Mountain View, CA')
print g.latlng
Why does the below piece of code give None as the output?
import geocoder
g = geocoder.google('Mountain View, CA')
print g.latlng
Copyright © 2021 Jogjafile Inc.
To find the answer you can use the other code they provide for manually doing what geocoder does:
Looking in this object we can see that it contains an
error_message
key, as well as the statusOVER_QUERY_LIMIT
. The error message reads as follows:This is due to the fact that Google stopped supporting keyless API access back on June 11, 2018. To use Google as the provider for geocoding you'll need to get an API key and enable billing. You may want to look at some free alternatives for geocoding out there if you don't want to pay for their API access.
EDIT: Looks like the
geocoder
documentation also has a list of alternatives that you can try using.