How to Deal With Rate Limited APIs in NodeJS

janac
May 2, 2022

Problem

I need to make 100k API calls to an API that errors-out if I send more than 1000 API calls per minute.

Solutions

From simplest to most complex

  1. Add a delay between calls
  2. Use RxJS
  3. Use a message queue

My Solution

We tried RxJS, and it was too complex. Instead, we just added a delay using setTimeout and inserted all the records into our own DB, so we don’t have to deal with the rate limiter at all.

--

--

janac

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am senior software consultant at LazerTechnologies.com.