All posts
April 29, 2026 · Snapdock

What Does "Rate Limiting" Mean? Why Your Script Suddenly Stops Working.

Your script was working fine. You built it with Claude, ChatGPT, or Gemini, and it was pulling data, sending requests, doing exactly what you asked it to do…

Your script was working fine. You built it with Claude, ChatGPT, or Gemini, and it was pulling data, sending requests, doing exactly what you asked it to do. Then it stopped. Maybe it started throwing errors like “429 Too Many Requests” or “Rate limit exceeded.” Maybe it just started failing silently. You did not change the code. Nothing is broken. The script is just suddenly not working, and you have no idea why.

This is rate limiting. Here is what it is and what to do about it.

What Rate Limiting Actually Is

Almost every API and online service limits how many requests you can make in a given time period. This limit is called a rate limit.

Think of it like a nightclub with a one-in-one-out door policy. The club can only hold so many people. If too many arrive at once, the bouncer turns people away until space opens up. Your requests are the people. The API is the club. The bouncer is the rate limiter.

Rate limits exist because APIs are shared infrastructure. If one user’s script made millions of requests per second, it would use up resources that thousands of other users depend on. Rate limits keep the service stable and fair.

A rate limit is typically expressed as a number of requests per time period. For example: 100 requests per minute, 1000 requests per hour, or 10 requests per second. When you exceed that limit, the API rejects your requests until the time window resets.

The Error That Tells You It Is Happening

When you hit a rate limit, the API usually returns an HTTP status code of 429, which means “Too Many Requests.” Your script’s error log or terminal output will often show something like:

429 Too Many Requests
Rate limit exceeded. Please retry after 60 seconds.

Or for OpenAI and similar APIs:

RateLimitError: Rate limit reached for requests

The 429 status code is the clearest signal that rate limiting is the problem. If you see it, you are not doing anything wrong. You are just sending requests faster than the API allows.

Why Your Script Hits Rate Limits

Scripts hit rate limits for a few common reasons:

Processing too many items in a loop. If your script loops through a list of items and makes an API call for each one, and the list is long, you will hit the rate limit quickly. A loop that processes 500 items with one API call per item will trigger 500 requests in seconds.

Running the script too frequently. If your script runs every minute but the API allows only 100 requests per hour, frequent runs will accumulate and hit the limit.

Using a free tier with strict limits. Free API tiers typically have much lower rate limits than paid tiers. OpenAI’s free tier, for example, allows significantly fewer requests per minute than paid accounts.

How to Fix Rate Limiting

Add delays between requests. The simplest fix. Adding a pause between API calls gives the rate limit window time to reset. Ask your AI: “My script is hitting rate limits when it loops through items and makes API calls. Can you add a small delay between each request to avoid the rate limit?”

Implement exponential backoff. A smarter approach where your script automatically waits longer each time it gets rate limited, then retries. Ask your AI: “Can you add exponential backoff to my API calls so that when I get a 429 error, the script waits and retries automatically?”

Batch your requests. Some APIs let you send multiple items in a single request instead of one item per request. Ask your AI: “Does [API name] support batch requests? If so, can you update my script to batch multiple items per request instead of making individual calls?”

Upgrade to a paid tier. If your use case genuinely requires more requests than the free tier allows, upgrading is the right answer. Check the API provider’s pricing page for higher rate limit tiers.

Cache responses. If your script requests the same data repeatedly, cache the response instead of making a new API call every time. Ask your AI: “My script requests the same data multiple times. Can you add simple caching so it only makes the API call once and reuses the response?”

The One Thing to Remember

Rate limiting means you are making API requests faster than the service allows. The 429 error code is the signal. The fix is almost always adding delays between requests, implementing automatic retry logic, or reducing how frequently your script runs. Ask your AI to add rate limit handling to your script and it will implement the right approach for your specific situation.


Want your scripts running reliably without hitting infrastructure limits? → Snapdock

New here? These might help: What is an API? The honest explanation nobody bothers to give you. → Python errors. What your computer is actually trying to tell you. →