首页 > 解决方案 > This API key is not authorized to use this service or API

问题描述

I am trying to do my Geolocation python program. I have already had an API key. I also enable geocoding API, Map static API, direction API, Distance matrix API, geolocation API, places API, map javascript API. APIs description

However, I received this message:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<GeocodeResponse>
<status>REQUEST_DENIED</status>
<error_message>This API key is not authorized to use this service or API.</error_message>
</GeocodeResponse>

the link I want to access: https://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=pentagon&key=MYKEY

What should I do to solve this error?

标签: pythonapirequestgeolocationaccess-denied

解决方案


登录谷歌开发者控制台。

确保选择了您要访问的项目。

在左侧的导航面板中选择 APIs and Services

在左侧的面板中选择凭据。

在 API Keys 下,单击铅笔(编辑)图标。

向下滚动到 API Restrictions 并选择不限制密钥并保存。

如果这不起作用,您需要检查以确保项目已链接到计费帐户,您需要为此部分提供信用卡。


推荐阅读