Gmail API Global Per Second Rate Limit

Sebastian Fairchild

I need to be able to correctly catch and handle global rate limit errors returned from the Gmail API. How will I be able to differentiate between per-user rate limit errors and global rate limit errors?

I can't find any explicit documentation for this, but I assume that the domain attribute in the response payload will say global instead of usageLimits. Can anyone verify if this is correct?

Example below of what I assume a global rate limit error looks like

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "message": "Rate Limit Exceeded",
    "reason": "rateLimitExceeded",
   }
  ],
  "code": 403,
  "message": "Rate Limit Exceeded"
 }
}
Andres Duarte

You can check this by forcing the quota limit rate error for user and for domain. If you’re the admin, in Google Cloud platform console (console.cloud.google.com) you can edit, for each project and each API, the total quota rate limit and per user. Read the instructions on how to edit quota limits [1].

You can see the “quota units” used per each Gmail API method here [2].

About the error messages, i forced both limits as explained before and got this:

For user:

"errors": [

    "domain": "usageLimits",
    "reason": "userRateLimitExceeded",
    "message": "User Rate Limit Exceeded. Rate of requests for user exceed configured project quota. You may consider re-evaluating expected per-user traffic to the API and adjust project quota limits accordingly. You may monitor aggregate quota usage and adjust limits in the API Console: XXXXX",
    "extendedHelp": "XXXXX"
  ]

Where i put the XXXXX there’s a url to modify the quota limits of that project.

For domain (total):

  "errors": [

    "domain": "usageLimits",
    "reason": "rateLimitExceeded",
    "message": "Rate Limit Exceeded"
   ]

[1] https://cloud.google.com/apis/docs/capping-api-usage

[2] https://developers.google.com/gmail/api/v1/reference/quota

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

rate limit for rest api using spring

From Dev

Facebook Marketing API Rate Limit

From Dev

Upload rate limit on Dailymotion API

From Dev

How to limit API calls per second with angular2

From Dev

Rate limit AWS API gateway endpoint

From Dev

Node.js - Working with an API limit of 5 requests per second

From Dev

Azure function: limit the number of calls per second

From Dev

Incapsula Rate Limit Per Second

From Dev

Limit fadeOut() to 3 steps per second

From Dev

How to rate limit per user in API Gateway?

From Dev

Heroku deployment API rate limit exceeded

From Dev

Sonos Control API Rate limit

From Dev

Apple Music Search API rate limit

From Dev

Tweepy Hipchat API - Except rate limit?

From Dev

Rate limit network but allow bursting per TCP connection before limiting

From Dev

Limit number of connections per second in Apache HttpClient

From Dev

How to check rate limit in streaming api in twitter

From Dev

Limit not bandwith, but packets per second in linux

From Dev

Calculating data rate per second but the result always the same

From Dev

Spring @Async with rate per second

From Dev

gnu parallel: how to set the limit per second

From Dev

Open Library Covers API Rate Limit

From Dev

twitter api rate limit issue

From Dev

Get frame's position at an specific rate per second

From Dev

Firebase rate limits per second, per user?

From Dev

How to rate limit per user?

From Dev

Asyncio - how to limit requests per 1 second?

From Dev

Trying to set a source intensity rate in hours but it is in per second

From Dev

Python Async Limit Concurrent coroutines per second