您已超出此 API 的每日请求配额。谷歌地方 API iOS Swift

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38216519/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:38:27  来源:igfitidea点击:

You have exceeded your daily request quota for this API. Google Places API iOS Swift

iosswiftgoogle-mapsgoogle-places-api

提问by Richa Srivastava

I am trying to use Google Places API in a very simple app. I just want to locate all the shopping malls near the current location. I used this web service:

我正在尝试在一个非常简单的应用程序中使用 Google Places API。我只想找到当前位置附近的所有购物中心。我使用了这个网络服务:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=12.9412390245245,77.6171295438685&radius=1000&sensor=true&types=shopping_mall&key=MY_SERVER_KEY

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=12.9412390245245,77.6171295438685&radius=1000&sensor=true&types=shopping_mall&key=MY_SERVER_KEY

It was working, but now I am getting the following error message:

它正在工作,但现在我收到以下错误消息:

{
   "error_message" : "You have exceeded your daily request quota for this API.",
   "html_attributions" : [],
   "results" : [],
   "status" : "OVER_QUERY_LIMIT"
}

How can I avoid this? Also, while creating server key, I did not provide any IP address, as I don't have any server. I don't want to pay anything for this simple service. Is there anyway we can avoid it or any other free alternative?

我怎样才能避免这种情况?另外,在创建服务器密钥时,我没有提供任何 IP 地址,因为我没有任何服务器。我不想为这种简单的服务支付任何费用。无论如何我们可以避免它或任何其他免费选择吗?

回答by Maulik Patel

as per following link https://developers.google.com/maps/documentation/geocoding/usage-and-billing

按照以下链接 https://developers.google.com/maps/documentation/geocoding/usage-and-billing

only one daily request quota for this API. otherwise billing compulsory.

此 API 每天只有一个请求配额。否则强制计费。

回答by Bharat

Almost every Google API has a daily free quota. For Google Places API it's 2500 requests per day and 10 requests per second. If you want to use more than that, I would suggest to enable billing. If you still want to use the free quota, please wait for a day to get those 2500 requests again.

几乎每个 Google API 都有每日免费配额。对于 Google Places API,它是每天 2500 个请求和每秒 10 个请求。如果您想使用更多,我建议启用计费。如果您仍想使用免费配额,请等待一天再次获取那 2500 个请求。

P.S. : The quota is based on specific accounts. Please make your own API key using Google API console if you're using a random one.

PS:配额是基于特定帐户的。如果您使用的是随机密钥,请使用 Google API 控制台制作您自己的 API 密钥。

Hope it helps.

希望能帮助到你。

回答by saurabh goyal

here is your answer link

这是你的答案链接

@engin-kurutepeHave answered it very well .

@ engin-kurutepe回答得很好。

He writes "Make sure that you're not hitting the Google API too fast. They don't limit the total number of requests but the rate of requests. About 10 requests per second is more or less the fastest you're allowed to hit their APIs."

他写道:“确保您不会太快地访问 Google API。他们不限制请求的总数,而是限制请求的速率。每秒大约 10 个请求或多或少是您被允许访问的最快速度他们的 API。”

Hope this Helps!

希望这可以帮助!

回答by API

You have to create a billing account to activate it. They have a daily limit for which you will not be charged - only pay if it exceeds the limit. Look at their pricing details on https://developers.google.com/places/web-service/usage-and-billingand plus there is a free trial for a month.

您必须创建一个计费帐户才能激活它。他们有一个每日限额,您不会被收取费用 - 只有在超过限额时才付款。在https://developers.google.com/places/web-service/usage-and-billing上查看他们的定价详细信息,此外还有一个月的免费试用期。

For a small project with very little number of requests you will end up not paying anything but you still have to associate a credit/debit card with the account for it to work.

对于请求数量很少的小项目,您最终不会支付任何费用,但您仍然必须将信用卡/借记卡与帐户相关联才能使其工作。

回答by Amit Singh

You can try FourSquareAPI, Its free, but it requires the users location to find places and thats good for near by places, its NOT good for searching for places far away.

您可以尝试FourSquareAPI,它是免费的,但它需要用户的位置来查找位置,这对附近的地方很有用,而不适合搜索远处的地方。