Google Geocoding API的API密钥放置位置? [英] Where to place API key for Google Geocoding API?

查看:126
本文介绍了Google Geocoding API的API密钥放置位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

以下是编码的示例URL(它返回json) -

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



消息:OVER_QUERY_LIMIT

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



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



消息:REQUEST_DENIED

我想知道API Key的位置/方式。 ClientID >在URL中,而不是,就像你在免费版中所做的那样:https://developers.google.com/maps/articles/v2tov3#newkey



所以您的网址应如下所示: http://maps.googleapis。 com / maps / api / geocode / json?client = xxxxx& address = Dallas& sensor = false

没有足够的幸运拥有付费帐户,所以我无法测试 - 但我认为这会让您走上正确的道路。



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


客户端ID



您必须在所有API请求中包含您的客户端ID。您的客户ID
将您标识为Maps API for Business客户,并为您的应用程序启用支持
和购买的配额。没有
客户ID的请求不符合Maps API for Business的优势。



如果您从免费API服务切换到Google Maps API for
业务实现,您必须从
请求中删除关键参数。 Google Maps API Web服务将拒绝使用
同时生成的客户端ID和密钥。



认证和授权中提供了更多信息


如果您丢失了客户ID,可以通过登录
支持门户并点击地图:添加URL来恢复它。在
页面左侧的链接。


编辑



有关更多信息(包括有关将您的客户ID传递到Earth API,v2 API和Maps API for Flash的说明),请阅读加载客户端API



如果您丢失了客户端ID或加密密钥,可以通过登录到支持门户并单击地图:从页面左侧的链接添加URL来恢复它们。

We use Google Geocoding API to map address to Latitude and Longitude.

Here is the sample URL for encoding (which returns json) -

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

Message: OVER_QUERY_LIMIT

Ok, it makes sense, because we exceed over 2500 daily limit so we place API key like this -

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

Message: REQUEST_DENIED

I'm wondering where/how to place the API Key.

解决方案

Looks like in version 3 you need to pass the ClientID in the URL and not a key as you do in the free version: https://developers.google.com/maps/articles/v2tov3#newkey

So your URL should look like: http://maps.googleapis.com/maps/api/geocode/json?client=xxxxx&address=Dallas&sensor=false

Not lucky enough to have a paid account so I cannot test - but I think that will get you on the correct path.

Relevant from this link: 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.

EDIT

For more information, including instructions on passing your client ID to the Earth API, v2 API, and the Maps API for Flash, please read Loading Client-side APIs.

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

这篇关于Google Geocoding API的API密钥放置位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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