The Google Calendar API has changed how we manage API usage

Posted by Charles Maxson, Developer Advocate

The Google Calendar API has changed how it manages API usage. Previously, queries were monitored and limited on a daily basis. As of May 2021, queries started to be monitored and limited on a per-minute basis. This introduces better behavior when your quota is exceeded, as requests are rate-limited until quota is available rather than failing all requests for the rest of the day. This also helps developers recognize issues around quota enforcements faster and shouldn't affect the performance of existing projects.

To view your usage and quota limits, have a look in the Google API console.

Image of Calendar API

To help you manage your quotas, we’ve put together a few helpful tips:

  • Use push notifications instead of polling.
  • If you cannot avoid polling, make sure you only poll when necessary (for example poll very seldomly at night).
  • Make sure to use randomized timing so that requests from your users spread out evenly instead of creating bursts.
  • Use incremental synchronization with sync tokens for all collections instead of repeatedly retrieving all the entries.
  • Increase page size to retrieve more data at once by using the maxResults parameter.
  • Update events when they change, avoid recreating all the events on every sync.
  • Use exponential backoff for error retries to make rate-limiting work properly.

For further details into managing quotas please review the manage quotas documentation. You can also find more details on error handling on the resolve errors documentation.

To stay on top of news and updates around Google Workspace APIs and developer platform please sign up to our developer newsletter.