Mat*_*thi 9 api google-maps google-maps-api-3
我正在尝试使用以下网址向Google Places API提出请求:https://maps.googleapis.com/maps/api/place/search/xml? location = 37.77264,0122.409915 & radius = 500 & type = educational %20services&名称=珠穆朗玛峰%20college%20san%20francisco&传感器=假键= YourApiKey
这是我得到的回应:
<PlaceSearchResponse>
<status>REQUEST_DENIED</status>
</PlaceSearchResponse>
Run Code Online (Sandbox Code Playgroud)
知道上面的URL有什么问题吗?
注意: - 我在Android APP中实现了它.
我遇到了这个API的同样问题..
网上提供的大多数解决方案/建议都是关于错误的密钥.
但是如何获得合适的密钥呢?这方面的帮助很小.
在我的情况下,它背后的唯一原因是错误的KEY.
我正在使用我Android Key (The one we use for google Maps)访问google places,这就是为什么它给了我ACCESS DENIED响应.
经过几个小时的苦苦挣扎,我在Google API文档中注意到有一个截图如何创建KEY
因为我注意到他们正在使用的钥匙 "Key for browser apps (with referers)"
而我正在使用的是 "Key for Android apps (with certificates)"
.....
和 to get the respective key We need to create a Browser Key.
我最初使用的关键是

所需的密钥是

获取所需的密钥: - 只需单击"Browser Key"并再次单击输入,请求关于某个URL不是必填字段

有关如何在ANDROID中使用它的更多详细信息,请参阅此链接
"Places API"从API控制台打开服务| 归档时间: |
|
| 查看次数: |
16759 次 |
| 最近记录: |