Skip to main content
Answered

Facing issues with API rate limits in my Intercom app—any solutions?

  • February 5, 2025
  • 1 reply
  • 11 views

catjack

Looking for effective ways to optimize API usage, implement retries, or increase limits (Read More). Any best practices or solutions to handle this efficiently without hitting restrictions? Appreciate any insights!

Best answer by Emilygav

Hey ​@catjack! Emily here from Support Engineering at Intercom 👋🏼
 

You could consider implementing exponential backoff. This strategy involves retrying failed requests with increasing delays, which helps manage network errors and avoid hitting rate limits.

Here's a basic approach:

  • Initial Request: Make a request to the API.
  • Retry on Failure: If the request fails, wait for a short period (e.g., 1 minute plus a random number of seconds) before retrying.
  • Increase Delay: If subsequent retries fail, double the wait time (e.g., 2 minutes, then 4 minutes) before each retry.
  • Maximum Retries: Continue this pattern up to a set maximum number of retries.

For implementation, you can use libraries that handle exponential backoff automatically, such as:

retry for Node.js
backoff for Python
retries for Ruby

These libraries simplify the process by managing the retry logic for you, allowing you to specify the number of retries and handling the rest :)

If you want to learn more about API usage you can read more from our docs here 👈🏼

View original
Did this topic help you find an answer to your question?

1 reply

Emilygav
Intercom Team
Forum|alt.badge.img+3
  • Intercom Team
  • 82 replies
  • Answer
  • February 14, 2025

Hey ​@catjack! Emily here from Support Engineering at Intercom 👋🏼
 

You could consider implementing exponential backoff. This strategy involves retrying failed requests with increasing delays, which helps manage network errors and avoid hitting rate limits.

Here's a basic approach:

  • Initial Request: Make a request to the API.
  • Retry on Failure: If the request fails, wait for a short period (e.g., 1 minute plus a random number of seconds) before retrying.
  • Increase Delay: If subsequent retries fail, double the wait time (e.g., 2 minutes, then 4 minutes) before each retry.
  • Maximum Retries: Continue this pattern up to a set maximum number of retries.

For implementation, you can use libraries that handle exponential backoff automatically, such as:

retry for Node.js
backoff for Python
retries for Ruby

These libraries simplify the process by managing the retry logic for you, allowing you to specify the number of retries and handling the rest :)

If you want to learn more about API usage you can read more from our docs here 👈🏼


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings