How to Determine Remaining Requests Before Reaching Rate-Limits

Overview

This article explains how to monitor an application's current API rate limit status. It details the specific HTTP response headers that provide the necessary information to determine if an application is approaching its request limit for a given time window.

The following HTTP error may be seen

429 HTTP Error (Too Many Requests)

Applies To
  • API

  • Rate Limiting

Solution

The solution to determining if the Rate-Limit is being approached is to monitor the headers for each request call.

The headers:

  • x-ratelimit-limit: The maximum number of requests available in the current time frame.
  • x-ratelimit-remaining: The number of remaining requests in the current time frame.
  • x-ratelimit-reset: A UNIX timestamp of the expected time when the rate limit will reset.

Please see Rate Limit Policy for more information on the HTTP response headers.

Related References

Recommended content

No recommended content found...