即使使用API 密钥,Python地理编码器REQUEST DENIED?

问题描述 投票:0回答:1

我注册了一个用于地理编码地址的Google API密钥。我正在尝试使用Python的地理编码器。

g = geocoder.google('Mountain View, CA', key='puting my key here')

但是,它还在给我:

<[REQUEST_DENIED] Google - Geocode [empty]>

任何人都可以向我解释发生了什么事吗?提前致谢。

python geocoding google-geocoder google-geocoding-api
1个回答
0
投票

从错误消息中,我认为在API控制台上可能没有为项目检索API密钥启用地理编码API。请确认一下。在启用Geocoding API后运行脚本时,将返回以下响应。

<[OK] Google - Geocode [###]>

Note:

  • 如果您知道项目ID,则可以打开启用API的页面 https://console.cloud.google.com/apis/library/geocoding-backend.googleapis.com?project=project-id-#####
  • 关于定价,请检查https://cloud.google.com/maps-platform/pricing/

References:

如果这对你的情况没用,我道歉。

© www.soinside.com 2019 - 2024. All rights reserved.