To ensure that the person with the best internet connection cannot overthrow the board, we set up some rate limits that you have to respect. We use headers to communicate our current rate limit setup.

For example:

HEADERS = {
  # ... your Authorization headers
}

result = requests.get(
  "<http://pixels.pythondiscord.com/get_pixels>",
  headers=HEADERS
)

print(result.headers)

We are interested in the last four headers, prefixed by requests-:

{
    ...,
    'requests-remaining': '4',
    'requests-limit': '5',
    'requests-period': '10',
    'requests-reset': '9.523'
}

Here is the meaning of each header:

Do note that trying to send a request while requests-remaining is 0 will result in a cooldown phase, where you won't be able to send any request for a longer time than the normal ratelimit period.

If for any reason this happens, you can check how long you have to still wait in the cooldown-reset header.

We recommend you respect rate limits as much as possible, as running into cooldowns will slow you down.

You can also send a HEAD request to query the state of your rate-limits but without performing any action.

One possible setup would be to wait requests-reset seconds when requests-remaining reaches zero, but we won't give you any more hints!