首页 文章

Google Place API - 始终返回此“状态”:“REQUEST_DENIED”

提问于
浏览
4

我目前正在使用Google Place API,每当我要访问此链接时,我都会遇到问题

https://maps.googleapis.com/maps/api/place/search/json?location=latitude,longitude&radius=1&sensor=false&key=apikey

输入 latitude,longitudeAPI key 等信息并设置 sensor equal to false ,但它始终显示:

{
   "debug_info" : [],
   "html_attributions" : [],
   "results" : [],
   "status" : "REQUEST_DENIED"
}

我已经搜索了那种错误,我看到一些帖子建议检查 sensor 值并检查 API key . 我已经检查了它,并检查了 Google Maps API v3 的服务是否已启用 . 但没有什么对我有用 . 我是新来的,我不知道我做错了什么,请帮忙 .

2 回答

  • 0

    您正在使用http(s)来调用Google API,您的html也是在http(s)下托管的 . 如果没有尝试将谷歌网址更改为http .

    否则,其他所有其他东西看起来都不错,这让我觉得你可能想再次检查你的api控制台,转到服务并检查你的'Places API'是否已打开 .

    您还可以尝试将端口地址更改为443以从Places API获取响应

  • 7

    在以下情况下,Places API会返回“status”:“REQUEST_DENIED”:

    You have not activated the Places API Service in the services tab of the APIs console.
    The sensor parameter is missing from your request, or is set to something other than true or false.
    The key parameter is missing from your request.
    The key parameter does not match the your API key in the API Access tab of the APIs console.
    Your API key has not been correctly set up in the API Access tab of the APIs Console:
        If you are using a Browser key, check that your allowed Referer(s) are correct.
        If you are using a Server key, check that your allowed IP(s) are correct.
        Android and iOS keys are not supported, please use a Browser or Server key.
    The request was not sent as an HTTPS request, HTTPS is required for all Web Service requests.
    The incorrect HTTP method was used to send the request:
        All requests must be sent as a GET request except for Place Actions.
        All Place Actions must be sent as a POST request.
    

相关问题