Skip to content

RateLimit-Remaining

Standardized header showing how many requests the client has left before hitting the rate limit threshold.

The RateLimit-Remaining response header is the IETF standardized version of X-RateLimit-Remaining. It indicates the number of requests remaining in the current rate limit window before the client will be throttled. This header decrements with each request made and resets when a new rate limit window begins.

Modern APIs should include this standardized header alongside RateLimit-Limit in every response where rate limiting applies. Prefer this over the legacy X-RateLimit-Remaining header.

The standardized header ensures compatibility with modern API clients and follows current HTTP header naming conventions. It provides real-time feedback about quota consumption without relying on deprecated X- prefixed headers.

The server calculates the remaining requests for the client and includes this value in the response. Clients should monitor this value and implement backoff logic when it approaches zero.

Example code in Javascript:

async function makeRequest(url) {
const response = await fetch(url);
const remaining = parseInt(response.headers.get('RateLimit-Remaining'));
if (remaining < 10) {
console.warn('Approaching rate limit, slowing down requests');
await new Promise(resolve => setTimeout(resolve, 1000));
}
return response.json();
}
RateLimit-Remaining: 847