问题描述
我有一个使用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>>>
我不断收到:
I keep getting:
<?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,并注册了一个新的Web应用程序,这是我获取服务器密钥的地方。
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.
推荐答案
您的查询有效
没有;该文档确实声明: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密钥,它声称它是无效的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!