Gmail API配额使用情况检查 [英] Gmail API quota usage check

查看:104
本文介绍了Gmail API配额使用情况检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个使用Gmail API的项目,它可能会超过此页面上的API限制 https://developers.google.com/gmail/api/v1/reference/quota


API限额

每日使用量1,000,000,000配额单位每天

每用户费率限制每用户每秒250个配额单位



超出费率限制将导致HTTP 403或HTTP 429太多请求响应,您的应用应该通过以指数回退重试来响应。





  1. 因此,我们可以通过脚本进行调用,以在运行项目之前检查剩余的API调用数量?或者它只能在网页的google API控制台中看到?

  2. 是否将HTTP 403错误绑定到每日使用限制和HTTP 429绑定到用户速率限制?

  3. API日常使用是指日历日吗?


解决方案

您提供的链接提供了大量关于Gmail定额使用情况和限制的信息。



1.因此,我们可以通过脚本拨打电话来检查我们运行项目之前剩下的API调用数量?或者它只能在网页的google API控制台中看到?



要查看配额使用情况,请访问您的开发者控制台。你是正确的,它可以使用控制台查看。您还可以看到流量(每秒请求的数量)以及项目启用API的错误率。

2.是否绑定了HTTP 403错误以每日使用限制和HTTP 429绑定到用户速率限制?



根据文档使用限制
$ b


超出 rate limit 会导致HTTP 403或HTTP 429 Too Many Requests响应,并且您的应用程序应通过以指数退避方式重试来响应。

4xx错误更可能与用户费率限制有关。文档讨论了遇到错误4xx(指数退避)时应该怎么做。



3. API限制日常使用是指日历日吗?



每日使用量意味着每天最大的API请求量



希望此信息有所帮助。


We are developing a project working with Gmail API, it might exceed the API limit on this page https://developers.google.com/gmail/api/v1/reference/quota

API Limit

Daily Usage 1,000,000,000 quota units per day

Per User Rate Limit 250 quota units per user per second

"Exceeding a rate limit will cause an HTTP 403 or HTTP 429 Too Many Requests response and your app should respond by retrying with exponential backoff."

  1. So we can we make a call from script, to check the number of API call left before we run the project? Or it can only be seen in google API console in a web page?
  2. Does the HTTP 403 error bonded to Daily Usage limit and HTTP 429 bonded to User Rate Limit?
  3. Does the API limit Daily Usage means calendar day?

解决方案

The link that you've provided gives a lot of information about Gmail Quota Usage and limits.

1.So we can we make a call from script, to check the number of API call left before we run the project? Or it can only be seen in google API console in a web page?

To view the quota usage, access your developer console. And you are correct, it is viewable using the console. You can also see traffic ( number of request per seconds), and error ratio of the enabled API of your project.

2.Does the HTTP 403 error bonded to Daily Usage limit and HTTP 429 bonded to User Rate Limit?

According to the documentation Usage Limits:

Exceeding a rate limit will cause an HTTP 403 or HTTP 429 Too Many Requests response and your app should respond by retrying with exponential backoff.

An error 4xx is more likely be related to user rate limit. And the documentation discussed what to do when experiencing an error 4xx (exponential backoff).

3.Does the API limit Daily Usage means calendar day?

Daily usage means the maximum API requests per day

Hope this info helps.

这篇关于Gmail API配额使用情况检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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