Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

My app says the Google API quota was exceeded

Short answer

Google meters API use in quota units per minute, per project and per user. For Gmail, Google lists 1,200,000 units per minute per project and 6,000 per user, with different costs per call. Errors come from bursts, loops and wasteful calls. Google recommends retrying with exponential backoff.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • My app shows quota exceeded, rate limit exceeded or too many requests from Google.
  • It works all day and fails when many users act at once, or during a nightly job.
  • A sync that used to finish now stops half way.
  • Everything fails for a minute and then recovers by itself.
  • A change made the app suddenly call Google much more.

Why does this happen?

  1. Limits are per minute and per user

    Google lists, for Gmail, 1,200,000 quota units per minute per project and 6,000 per minute per user per project. One user's activity, or one account used by a background job, can reach the per-user limit while the project total is far from full.

  2. Different calls cost different amounts

    Google lists the cost of each Gmail method: for example listing messages costs 5 units, reading a message costs 20, and sending one costs 100. Reading the full body of thousands of messages in a loop adds up much faster than listing them.

  3. Retries make the burst worse

    An app that retries instantly after an error multiplies the calls. Google recommends truncated exponential backoff: wait, double the wait after each failure, add a random delay, and stop after a maximum number of tries.

  4. A job polls instead of listening

    A job that checks every mailbox or sheet every few seconds spends quota even when nothing changed.

  5. Many tools share one project

    Several scripts and apps may all be using the same Google Cloud project and the same credentials, so their use is added together.

What can I do about it today?

  1. Note the time and what was runningA nightly import, a mass email, a new feature or a busy hour. The pattern tells your developer more than the message.
  2. Do not click retry repeatedlyEach manual retry spends more quota and can keep the block in place.
  3. Find out which Google project the app usesAsk who created the Google Cloud project, so that someone with access can open its quota page.
  4. Stop any extra tool that also uses the accountPause a test script or an old integration that shares the same Google login, then watch whether the errors stop.
  5. Send your developer the error textThe exact message and the time, not a summary.

When should I bring someone in?

  • Quota errors repeat daily or on every busy hour.
  • Google says a limit cannot be raised and the app needs a different design.
  • Mail, calendar or file data is missing because a job stopped midway.

How do I handle it?

  1. Measure the callsI count which Google calls the app makes, how often and for which users, using logs or a short test run.
  2. Remove calls that are not neededCache what rarely changes, ask only for fields that are used, and use batching and change notifications where Google offers them.
  3. Add proper backoffFailed calls are retried with exponential backoff and a random delay, with a cap, as Google recommends.
  4. Spread the loadLarge jobs run in steps instead of one burst, and one user is not made to carry a whole company's work.
  5. Alert before it stopsYou get a warning when use approaches a limit, instead of finding out when users complain.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Can I just ask Google for a higher quota?

Google says quota increases for the Gmail API are requested from the Quotas page in the Google Cloud console and that approval is not certain. It also states some limits, such as the daily threshold, cannot be raised. Reducing waste usually works better.

Is the limit per user or for my whole company?

Both exist. Google lists a per project and a per user per project limit, so one heavy user can be limited while others are fine.

Are Sheets and Calendar the same?

Each Google API has its own limits. Sheets is covered on its own page.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.