Skip to content

What are the limits?

Rate Limits

The Lottery Results REST API employs rate limits to ensure a uniform experience for all users.

Info

Rate limits are not fixed values and may change in the future.

Global Applications

To prevent service overload, global rate limit per public IP source is enforced for any API route. Calculated over all API routes. Limits are cumulated.

  • 20 requests per seconds
  • 1200 requests per minutes
  • 72000 requests per hours

We allow double bursting values.

Lottery routes

For lottery routes, you are authenticated with a specific token, and the following specific rate limits are additionally applied:

  • ~20 requests per seconds
  • 1200 requests per minutes
  • 72000 requests per hours

Working with rates limits

How can your application gracefully interact with these limits? This section describes how our API informs client applications about limiting and covers some best practices.

Reaching the limit

In the event that your application reaches a limit: the HTTP response code will be 429, the response body will indicate that limiting has occurred:

HTTP/1.1 429 Too Many Requests
...
{ "code": 429, "error": "Too Many Requests" }

In addition, the header X-RateLimit-Reset is positioned to indicate the number of seconds to wait for the next retry.

HTTP/1.1 429 Too Many Requests
...
X-RateLimit-Reset: 10
...

But to avoid 429 error, you can follow X-RateLimit-Remaining header to known if you will reach the limit.

Best practices

  • Ensure your application is ready to handle being rate limited. Because error request count as error quota.
  • Update your application to not retry before the X-RateLimit-Reset timestamp.
  • Update your application to not execute a new request if X-RateLimit-Remaining is not a positive value.