API Rate Limits and How to Work Within Them

A rate limit is a cap on how many requests you may send to an API in a given period, such as 100 per minute. If you go over, the service refuses requests and usually returns a 429 status code, which means “too many requests.” To work within a limit, send fewer requests, space them out, and wait and retry when you are told to slow down.
Limits exist to protect the service from overload and to share capacity fairly. They show up quickly in automation, where a loop can fire hundreds of requests in a few seconds without anyone noticing.
How limits are expressed
Services state their limits in different ways, so read the documentation of each one. Common forms include:
- a number of requests per second or per minute
- a daily or monthly quota
- a cap on simultaneous requests
- different limits for different endpoints, with writes often stricter than reads
- tiers tied to your plan, so a paid plan may have a higher ceiling
Limits and plans change, so treat any figure you read as a snapshot and check the current documentation before you design around it.
Note also the difference between a short burst limit and a longer quota. You can stay under the monthly total and still be blocked for sending too much too fast.
Reading the signs in the response
Many APIs tell you where you stand. Look at the response headers. They often include the total allowed, the number remaining, and the time when the count resets. Header names vary by service, so check the documentation for the exact ones.
When you hit the limit, the 429 response may include a header telling you how many seconds to wait before trying again. Honor it. Retrying immediately only digs a deeper hole, and some services penalize clients that keep hammering after a refusal.
Log these headers during testing. Seeing the remaining count fall as your automation runs is the clearest way to understand how close to the edge you are.
Slow down on purpose
The simplest remedy is to add a short pause between requests. If the limit is sixty per minute, wait a second between calls. That is crude but effective, and many automation platforms offer a delay step for exactly this reason.
A neater method is to throttle by design. Process items in a queue, taking a fixed number per minute, so the pace stays under the cap no matter how many items arrive at once.
Where you control the timing, spread scheduled jobs out. Ten automations that all wake up at exactly the top of the hour will collide. Offset them by a few minutes.
Retry with backoff
When a request fails with a 429 or a temporary 500-range error, retry after waiting. Better still, use exponential backoff: wait one second, then two, then four, then eight, up to a sensible maximum.
Add a little random variation to each wait, called jitter. Without it, many clients that were refused at the same moment all retry at the same moment too, and collide again.
Set a limit on attempts. After a handful of failures, stop and send an alert, since endless retries can hide a real problem and burn through your allowance.
Ask for less
The best request is the one you never make. Several habits reduce your load.
- Filter at the source. Ask the API for only the records you need, using query parameters, instead of fetching everything and sorting it yourself.
- Request only needed fields, if the API supports field selection.
- Use batch endpoints. Some APIs let you create or fetch many items in one call, which counts as one request rather than fifty.
- Use changes since a timestamp. Ask for what is new since your last run rather than the whole list.
A job that fetched ten thousand records every hour can often be rewritten to fetch only the few dozen that changed.
Cache what does not change
If your automation looks up the same information repeatedly, such as a list of categories or a customer’s plan, store the answer for a while instead of asking again. Even a cache that lasts five minutes can cut thousands of requests.
Decide how fresh the data must be. A product catalog that changes weekly can be cached for hours. A stock level may need to be checked each time.
A cache is also a good safety net. If the API is briefly unavailable or you are rate limited, you can keep working from the stored copy.
Here is a short example of these ideas at work. Imagine a nightly job that checks every customer record for a changed address, one request per customer. With two thousand customers and a limit of sixty requests a minute, the job needs over half an hour even when it behaves. If the API can instead return only records changed since last night, the same job may need a handful of requests and finish in seconds.
Planning for growth
An automation that works with fifty items a day may fail at five hundred. Before volume rises, estimate your peak: how many requests per run, how many runs at once, and which limit applies. Compare it with the ceiling.
If you are close, you have three options: reduce requests with the methods above, spread the work over more time, or move to a plan with higher limits. Check pricing at the time you decide, since it changes.
Also separate keys for separate workloads where the service allows it. A heavy nightly import should not use up the quota that your live customer-facing flow needs.
Your next step
Open the documentation for an API you use and find its rate limit section. Write down the limit, the period, the status code returned when exceeded, and the header that shows the remaining count.
Then check one of your automations: count how many requests a single run makes and how often it runs. If it uses more than half your allowance, add a delay, a filter or a cache this week.