If you’ve spent any time working with 3rd party APIs you’ll have come up against an issue where you make a tonne of calls to an API and it doesn’t finish giving you what you want. You might get a helpful error like 429 — Too Many Requests or something less helpful like ECONNRESET

Either way, what is happening is that as a consumer of that API you are only allowed to make so many requests in a certain period of time, or the number of concurrent requests you’re allowed to make is restricted.

What’s going to happen here is the code will call the 1000000 times as fast as possible and all requests will take place in a very short space of time (on my MacBook Pro it’s < 700ms)

Understandably, some API owners might be a little upset by this as it’s creating a heavy load.

#programming #npm #web-development #api #javascript

Rate Limiting API Calls — Sometimes a Bottleneck Is a Good Thing
3.60 GEEK