# How is rate limiting implemented?

**URL:** <http://forum.companieshouse.gov.uk/t/how-is-rate-limiting-implemented/140>\
**Category:** Uncategorized\
**Created:** [July 8, 2015, 10:51am UTC](http://forum.companieshouse.gov.uk/t/how-is-rate-limiting-implemented/140 "2015-07-08T10:51:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seb\_bacon](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/seb_bacon/32/1121_2.png) [@seb\_bacon](http://forum.companieshouse.gov.uk/u/seb_bacon)\
**Post date:** [July 8, 2015, 10:51am UTC](http://forum.companieshouse.gov.uk/t/how-is-rate-limiting-implemented/140/1 "2015-07-08T10:51:50Z")

</div>

I would like to implement a multithreaded client which may scale up or down. The simplest way to handle the rate limiting is to rely on the API to tell me when I’ve hit a limit; then each client can exponentially back off until the rate limit is restored.

But this depends on how rate limiting is implemented. When I hit my limit, do I get a specific error code? Am I limited for a certain amount of time? Is the 600 requests counter reset every 5 minutes, or averaged over a different period?

Thanks!

---

<div class="post-metadata">

**Author:** ![iankent](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/iankent/32/1117_2.png) [@iankent](http://forum.companieshouse.gov.uk/u/iankent)\
**Post date:** [July 8, 2015, 12:32pm UTC](http://forum.companieshouse.gov.uk/t/how-is-rate-limiting-implemented/140/2 "2015-07-08T12:32:40Z")

</div>

Rate limiting is based on a maximum number of requests within a given time window.

By default, this is 600 requests in a 5 minute window, and the 5 minute window begins when the first request is made.

Each request returns a `X-Ratelimit-Reset` header. This is a unix timestamp, and when that time passes the remaining rate limit (`X-Ratelimit-Remain`) is reset to the maximum (`X-Ratelimit-Limit`).

When you exceed the rate limit, any further requests will return a `429` response.

After receiving a `429` response, you should wait until the time specified in `X-Ratelimit-Reset` has passed before making further requests.

---

<div class="post-metadata">

**Author:** ![ruben\_couso](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/ruben_couso/32/1106_2.png) [@ruben\_couso](http://forum.companieshouse.gov.uk/u/ruben_couso)\
**Post date:** [December 22, 2015, 2:42pm UTC](http://forum.companieshouse.gov.uk/t/how-is-rate-limiting-implemented/140/3 "2015-12-22T14:42:13Z")

</div>

The ‘600 requests in a 5 minute window’ limitation … can be changed in some way?  
We mean, is there any way you can increase the number of requests per 5 minutes or even disable this limitation?

Thank you very much in advance!
