1

I want to convert a list of addresses to geocoordinates. I'm using GeoPy with Google Map API but it doesn't work.

My code is

import geopy
from geopy.geocoders import GoogleV3
geocoder = GoogleV3(api_key='AIzaSyBRlSJVypArruSuonWevVQNeaL2QUFbMNI')
geolocator.geocode("1 Apple Park Way, Cupertino, CA").point

But i got the error:

---------------------------------------------------------------------------
GeocoderQueryError                        Traceback (most recent call last)
<ipython-input-25-eda7eba13f7e> in <module>()
----> 1 geolocator.geocode("1 Apple Park Way, Cupertino, CA").point

2 frames
/usr/local/lib/python3.7/dist-packages/geopy/geocoders/googlev3.py in _check_status(status)
    433         elif status == 'REQUEST_DENIED':
    434             raise GeocoderQueryError(
--> 435                 'Your request was denied.'
    436             )
    437         elif status == 'INVALID_REQUEST':

GeocoderQueryError: Your request was denied.

I don't know how to make it right. Please help.

Son Pham
  • 25
  • 5

0 Answers0