DEV Community

Sohail Pathan
Sohail Pathan

Posted on

DevTip: Avoid being blocked from using an API

Hey Devs,

Today, I want to talk about a crucial but often overlooked topic: API Rate Limiting

Have you ever encountered a situation where you attempted to make several API requests, and then you received an email informing you that you've been blocked and must wait for 24 hours?

This occurs when you exceed the API's rate limit :(

Now, what exactly is Rate Limiting? It refers to a particular number of requests that are allowed during a specific time period.

When integrating an API, it is essential to implement a reliable rate limiting mechanism.

rate limiting

Top comments (5)

Collapse
 
ranjancse profile image
Ranjan Dailata • Edited

Sorry, I have never heard of any API Provider blocking out the consumer for exceeding the "Rate" limits. Instead, here's the general pattern - If the consumer exceeds certain rate limits, their request will not be fulfilled, and they will get responded with the HTTP Status Code of 429.

Reference - RateLimit

Collapse
 
iamspathan profile image
Sohail Pathan • Edited

Hey @ranjancse, I know that if consumers exceed certain rate limits, they will receive 429 Errors.

What I meant to say is, as a developer, you should implement a mechanism to avoid getting 429 Errors. If your application consistently receives 429 errors, some API providers might block your requests.

I have never heard of any API provider blocking consumers for exceeding the rate limits.

I experienced this blocking situation while working with the Google Maps API.

Collapse
 
ranjancse profile image
Ranjan Dailata

Hard to believe that Google is blocking the consumers for exceeding the rate limits. Could you please share a reference link or attach the masked email from Google?

Thread Thread
 
iamspathan profile image
Sohail Pathan
Thread Thread
 
iamspathan profile image
Sohail Pathan