Google 处 API 错误 1

Google Places API Error1

我收到以下错误消息:

This IP, site or mobile application is not authorized to use this API key. Request received from IP address 203.196.191.151, with empty referer", html_attributions: [ ], results: [ ], status: "REQUEST_DENIED"

如 Javascript(即基于浏览器)API 键的文档中所述:

Restrict your API keys to be used by only the IP addresses, referrer URLs, and mobile apps that need them: By restricting the IP addresses, referrer URLs, and mobile apps that can use each key, you can reduce the impact of a compromised API key.

您使用的密钥有这样的限制。在 cloud console.

中设置所需的 IP 或引荐来源网址

You can specify the hosts and apps that can use each key from the console by opening the Credentials page and then either creating a new API key with the settings you want, or editing the settings of an API key.