关于Google地图API配额限制的地方库 [英] Regarding Places Library for Google Maps API Quota limits

查看:1135
本文介绍了关于Google地图API配额限制的地方库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速的问题,只是为了澄清措辞和含义(因为它改变了几次地图加载...)



下面有两个语句Places API常见问题:


Google Places API具有以下查询限制:

具有API密钥的用户每24小时允许1 000个请求。
通过API控制台验证其身份的用户每24小时允许
100 000个请求。通过在控制台中启用计费,信用卡需要
进行验证。我们要求您的
信用卡纯粹用于验证您的身份。使用Places API时,您的卡不会被收取
的费用。虽然开发和测试的下限为
,我们建议在启动应用程序之前启用上限
。可以申请
的额外配额。如果被授予,额外的配额是免费的。
如果在将来的某个阶段,某个选项可用于支付额外配额的
,那么该配额将超过现有的免费配额
,并且您需要签署注意一些服务可能有一个乘数:

文本搜索服务是主题到10倍乘数。也就是说,您创建的每个
文本搜索请求将被计为针对您的配额的10个请求
。雷达搜索服务需要5倍的
乘数。也就是说,您制作的每个雷达搜索请求将
计为针对您的配额的5个请求。如果您已将Google
Places API作为Maps API for Business合约的一部分购买,则
乘数可能会有所不同。有关详细信息,请参阅Google Maps API的
商业文档。


这意味着使用Google Places API限制为每天100,000个查询,如果您正在进行文本搜索,则限制为10,000个。



但是,在Uplift页面上,它显示以下内容:


如果您正在开发基于Web的应用程序,只需要
搜索地点,并且不会提交新地点或Place Bumps,则
您应该使用Maps API的Places库,而不要使用Places API网络服务的
。 Places库为每个
最终用户分配一个配额,而不是分配给每个密钥。这意味着您的可用配额
会随着您的用户基数而增加,而不是以固定的
数量为上限。

我以下列方式使用Places API:

  https://maps.googleapis.com/maps/api/ js?key = XXX& libraries = places 
...
service = new google.maps.places.PlacesService(map);
service.textSearch(request,callback);

以及搜索和照片搜索的一些细节。


$ b $因此我的问题是, 考虑到我对Places API的使用,我受到应用程序100,000个查询限制的限制吗?还是我基本上在应用程序级别不受限制,因为我的配额是每个最终用户? / strong>(即每个唯一的IP?如果我有10,000个用户,我对我的整个用户群有100,000 * 10,000的有效配额?) 编辑

>

为了清楚起见:如果我将API密钥放入 https://maps.googleapis.com/maps/api/place/nearbysearch/json?location= -33.8670522,151.1957362& radius = 500& types = food& name = harbor& sensor = false& key = XXXX ,它会增加我在Google API控制台上的Places配额数量,但是如果我运行通过我的JS应用程序查询,我看到没有配额使用更改。我想确保我不会突然遇到大量的配额结果。

解决方案

使用JavaScript API服务(如Places库提供的服务)已为每个最终用户分配了配额。它与 google.maps.Geocoder 这样的对象非常类似,这已在 Geocoding Strategies 文章。


Quick question, just to clarify the wording and meaning (because it's changed a couple of times for Map loading...)

There are the two following statements in the Places API FAQs:

The Google Places API has the following query limits:

Users with an API key are allowed 1 000 requests per 24 hour period. Users who have verified their identity through the APIs console are allowed 100 000 requests per 24 hour period. A credit card is required for verification, by enabling billing in the console. We ask for your credit card purely to validate your identity. Your card will not be charged for use of the Places API. While the lower limit is sufficient for development and testing, we recommend enabling the higher limit before launching your application. It is possible to request an additional quota. If granted, the additional quota is free of charge. If, at some stage in the future, an option becomes available to pay for an additional quota, that quota will be over and above the existing free quota, and you will need to sign up for it explicitly.

Note that some services may have a multiplier:

The Text Search service is subject to a 10-times multiplier. That is, each Text Search request that you make will count as 10 requests against your quota. The Radar Search Service is subject to a 5-times multiplier. That is, each Radar Search request that you make will count as 5 requests against your quota. If you've purchased the Google Places API as part of your Maps API for Business contract, the multiplier may be different. Please refer to the Google Maps API for Business documentation for details.

This implies that use of the Google Places API is restricted to 100,000 queries per day, or 10,000 if you're doing a Text Search.

However, on the Uplift page, it says the following:

If you are developing a web based application that only needs to search for places, and is not submitting new places or Place Bumps, you should use the Places library of the Maps API rather than using the Places API web service. The Places library assigns a quota to each end user rather than to each key. This means that your available quota increases with your user base rather than being capped at a fixed amount.

I am using the Places API in the following way:

https://maps.googleapis.com/maps/api/js?key=XXX&libraries=places
...
service = new google.maps.places.PlacesService(map);
service.textSearch(request, callback);

And also for some details searching and photo searching.

Therefore my question is; Given my usage of the Places API, am I subject to the 100,000 queries limit on my app, or am I essentially uncapped at an app level, as my quota is per end-user? (i.e. per unique IP? if I had 10,000 users I have an effective quota for my entire user base of 100,000*10,000?)

EDIT:

For clarity: if I throw my API key into https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=XXXX, it will increment my Places quota count on the Google API console, however if I run queries through my JS app, I see no quota use change. I want to make sure that i'm not suddenly going to be hit with a massive quota result.

解决方案

Use of the JavaScript API services, like those provided by the Places library, have quota assigned to each end-user. It's a very similar setup as objects like the google.maps.Geocoder, which has been discussed in a bit more detail in this Geocoding Strategies article.

这篇关于关于Google地图API配额限制的地方库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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