Benchling

Rate Limiting

If you make a lot of API requests in a short amount of time, you may hit the API rate limit. Benchling will respond to further requests with a 429 “Too Many Requests” response until the limit resets.

When integrating with a rate-limited API, our recommended best practice is to update your code to handle 429 HTTP status codes in an HTTP response, and then retry with an exponential backoff, e.g.,

  1. Make a request
  2. If the request returns a 429, wait 1 second + a random number of milliseconds (up to 1000) and retry.
  3. If the request returns a 429, wait 2 seconds + a random number of milliseconds (up to 1000) and retry.
  4. If the request returns a 429, wait 4 seconds + a random number of milliseconds (up to 1000) and retry.
  5. And so on, up to a maximum backoff time (typically 32 or 64 seconds), until the API request goes through.

The random number of milliseconds should be recalculated before every request. The purpose of adding random jitter to each wait period is to avoid cases where multiple requests somehow become synchronized and all retry at once, sending requests in concentrated waves.

Rate Limiting


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.