RateLimit-Limit
General Summary
Section titled “General Summary”Standardized header indicating the maximum number of requests allowed in the current rate limit window.
Detailed Description
Section titled “Detailed Description”The RateLimit-Limit response header is the IETF standardized version of X-RateLimit-Limit. It specifies the total number of requests a client is permitted to make within a given time window before being rate limited. This header is part of the RateLimit Header Fields for HTTP specification (RFC draft) and represents the modern, standardized approach to communicating rate limiting policies.
Use Cases (When, Why, and How)
Section titled “Use Cases (When, Why, and How)”When to Use It
Section titled “When to Use It”Modern APIs should prefer this standardized header over the legacy X-RateLimit-Limit version. Include it in responses to API requests where rate limiting is enforced.
Why to Use It
Section titled “Why to Use It”Using the standardized header promotes interoperability across different API implementations and client libraries. It follows current best practices by avoiding the X- prefix, which was originally meant for experimental headers but has been deprecated for new standards.
How to Use It
Section titled “How to Use It”The server sets this header to a numeric value representing the maximum allowed requests. Clients should read this value to understand their quota.
Example code in Javascript:
fetch('https://api.example.com/data') .then(response => { const limit = response.headers.get('RateLimit-Limit'); const remaining = response.headers.get('RateLimit-Remaining'); console.log(`Rate limit: ${remaining}/${limit} requests remaining`); return response.json(); });Example
Section titled “Example”RateLimit-Limit: 1000