google-maps-api-3 - Google Place API - 始终返回此 "status": "REQUEST_DENIED"

标签 google-maps-api-3 google-places-api

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

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

输入信息,如 经纬度 API key 并设置 传感器等于假 ,但它总是显示:

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

我已经搜索过那种错误,我看到有些帖子建议检查 传感器 值并检查 API key .我已经检查过了,还检查了 Google Maps API v3 的服务是否已启用.但没有什么对我有用。我是新手,我不明白我做错了什么,请帮忙。

最佳答案

您正在使用 http(s) 调用 Google API,您的 html 是否也托管在 http(s) 下。如果没有,请尝试将 google url 更改为 http。

否则,其他一切看起来都还不错,这让我觉得您可能想再次检查您的 api 控制台,转到 SERVICES 并检查您的“Places API”是否已打开。

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

关于google-maps-api-3 - Google Place API - 始终返回此 "status": "REQUEST_DENIED",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17213687/

相关文章:

适用于 Google Maps API v3 的 HTML5 Canvas 地标

ios - 如何快速从google place api获取地点图片

android - placeautocompletefragment 完整地址

android - 在 Places API 的 fetchPlace() 中在哪里设置 session token ?

javascript - 将图像放在 google maps API 标记中的图像上

Javascript全局变量仅在匿名函数内更新

xml - 我如何从 Google Maps API 获取行车时间?

javascript - Google Maps Javascript API 正在返回静态图像

android - 在选项卡 fragment android中添加谷歌地点选择器

google-maps-api-3 - 使用 Google Places API 在自动完成建议中仅获取城市名称