I keep getting 429 rate limit errors. What are Trello’s rate limits?

I’m requesting members via /1/members/:id and keep getting rate limited even if I throttle to less than 100 requests per 10 seconds.

1 Like

Trello has multiple types of rate limits. There are two things you’ll want to do to understand why you are receiving a 429.

The first is to introspect the response object you’re receiving from Trello when you git a 429. It should be a JSON object that looks like the following:

  "message": "Rate limit exceeded"

The error key will give you an indication as to which limit you are hitting. There are three types of rate limits you should be familiar with:

  • API_KEY_LIMIT_EXCEEDED: There is a limit of 300 requests per 10 seconds for each API key. Which means that the API key limit is shared across all of the tokens that belong to the key. For instance, if you had 300 users (so you’ve generated 300 tokens with a single API key) you would be able to make a single request with each over a 10 second window.
  • API_TOKEN_LIMIT_EXCEEDED: There is a limit of 100 requests per 10 second interval for each token. The token limit is intentionally less that the key limit so that you can not have one bad token spin out of control and cause your entire key to hit rate limits.
  • MEMBER_LIMIT_EXCEEDED: There is a limit f 100 requests per 900 seconds to 1/members/ route. This limit is in place to prevent Trello users to be enumerated.

Trello returns information about remaining requests for key and token limits in the response headers for every request:

HTTP/2 200
x-rate-limit-api-token-interval-ms: 10000
x-rate-limit-api-token-max: 100
x-rate-limit-api-token-remaining: 99
x-rate-limit-api-key-interval-ms: 10000
x-rate-limit-api-key-max: 300
x-rate-limit-api-key-remaining: 299
date: Wed, 17 Jan 2018 20:59:00 GMT

You should use those headers to throttle your requests and ensure that you stay within the limits.

You can read more about the rate limits here: https://developers.trello.com/docs/rate-limits