谷歌地图地理编码:我得到了一个新的 API 密钥,但它声称它无效 [英] google maps geocode: I get a new API key and it claims it's invalid

查看:22
本文介绍了谷歌地图地理编码:我得到了一个新的 API 密钥,但它声称它无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Google 地图地理编码 API 的地理编码库(MarginalHacks.com 上的 makeKML.pm).它已停止工作,因为它使用的是 v2 请求,所以我已切换到 v3,但我被告知我的 API 密钥无效.所以我登录到他们灾难性的混乱云控制台,并最终弄清楚如何制作新的服务器 API 密钥.我再次尝试使用新密钥发出请求:

I have a geocode library (makeKML.pm at MarginalHacks.com) which uses the Google Maps geocode API. It has stopped working because it was using v2 requests, so I've switched to v3, and I'm told my API key is invalid. So I login to their disastrously confusing cloud console and finally figure out how to make a new server API key. Again I try a request with the new key:

https://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=659+Valencia+St%2C+San+Francisco+CA&key=<<<my new API key here>>>

我不断得到:

<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
 <status>REQUEST_DENIED</status>
 <error_message>The provided API key is invalid.</error_message>
</GeocodeResponse>

对正在发生的事情有什么想法,或者我如何确保我使用的是正确类型的 API 密钥?我在云控制台中打开了 Google Maps Geocode API 并注册了一个新的网络应用程序,我可以在该应用程序中获取我正在使用的服务器密钥.

Any thoughts on what's going on, or how I can ensure that I'm using the right type of API key? I've turned on the Google Maps Geocode API in the cloud console and registered a new web app which is where I'm getting the server key I'm using.

推荐答案

您的查询有效 没有钥匙

没有Google 地图地理编码网络服务的关键参数;该文档确实指出:Maps API for Business 用户必须在其地理编码请求中包含有效的客户端和签名参数",但这是额外费用(与 Google 签订的合同),而不是密钥".

There is no key parameter to the Google Maps Geocoding Web Service; the documentation does state: "Maps API for Business users must include valid client and signature parameters with their Geocoding requests", but that is additional cost (a contract with Google), and not a "key".

这篇关于谷歌地图地理编码:我得到了一个新的 API 密钥,但它声称它无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆