How to Deal With Rate Limited APIs in NodeJS

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.

--

--

--

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am a full-time software engineer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

MySQL — Operand should contain 1 column(s)

The Definition of JavaScript

How to solve Cannot find module ‘fs/promises’?

Polymer Summit 2017: NPM time

A simple dynamic Search component in React

Building a ‘Fire Water Tree’ game in React

How to Single Sign-on with React Native and Fabric

gql`wtf?` : Discovering ES6 Tagged Template Literals

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
janac

janac

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am a full-time software engineer.

More from Medium

Event Recap — Haverford Idea Hack

The Muggle Sorting Hat: An App for Teachers to help create new classes

Adding Pickup Feature to ShopeeFood App

$MYT And $eMYT :