gpt4 book ai didi

google-maps - 在哪里放置 Google Geocoding API 的 API key ?

转载 作者:行者123 更新时间:2023-12-03 23:45:50 24 4
gpt4 key购买 nike

我们使用 Google Geocoding API将地址映射到纬度和经度。

这是编码的示例 URL(返回 json)-

http://maps.googleapis.com/maps/api/geocode/json?address=Dallas&sensor=false

消息:OVER_QUERY_LIMIT

好的,这是有道理的,因为我们超过了 2500 个每日限制,所以我们像这样放置 API key -

http://maps.googleapis.com/maps/api/geocode/json?key=xxxxx&address=Dallas&sensor=false

消息:REQUEST_DENIED

我想知道在哪里/如何放置 API key 。

最佳答案

看起来在版本 3 中你需要通过 ClientID在 URL 中而不是 key就像您在免费版本中所做的那样:https://developers.google.com/maps/articles/v2tov3#newkey

所以你的 URL 应该是这样的:http://maps.googleapis.com/maps/api/geocode/json?client=xxxxx&address=Dallas&sensor=false

不太幸运有付费帐户,所以我无法测试 - 但我认为这会让你走上正确的道路。

与此链接相关:https://developers.google.com/maps/documentation/business/webservices/

Client ID

You must include your client ID in all API requests. Your client ID identifies you as a Maps API for Business customer and enables support and purchased quota for your application. Requests made without a client ID are not eligible for Maps API for Business benefits.

If you're switching from the free API services to a Maps API for Business implementation, you must remove the key parameter from your requests. Google Maps API web services will deny requests made with both a client ID and a key.

More information is available in the Authentication and Authorization chapter of this guide.

If you have lost your client ID, you can recover it by logging in to the support portal and clicking Maps: Add URLs from the links on the left of the page.



编辑

有关更多信息,包括将您的客户端 ID 传递给 Earth API、v2 API 和 Maps API for Flash 的说明,请阅读 Loading Client-side APIs .

如果您丢失了客户端 ID 或加密 key ,您可以通过登录 support portal 来恢复它们。并单击 map :从页面左侧的链接添加 URL。

关于google-maps - 在哪里放置 Google Geocoding API 的 API key ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18410485/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com