Rate Limits — The Polite Rules
There's one more house rule every busy kitchen keeps: it won't let any single guest order endlessly. There's a cap on how often you can ask. That cap is called a rate limit, and understanding it will save you a lot of confusion.
What a rate limit is
A rate limit is the maximum number of requests you're allowed to send in a set window of time.
It's always phrased as a count per a time: 60 requests per minute, or 1,000 per day, or 5 per second. Two numbers — how many, and how often.
Picture a coffee shop with a friendly sign: "One free refill per hour." You can absolutely have more coffee — but not faster than the rule allows. Come back too soon and the barista smiles and says "give it a bit." A rate limit is exactly that sign, applied to API orders.
Why kitchens set limits
This isn't the service being stingy. It's the service staying up for everyone.
If one app could fire a million requests a second, it could overwhelm the kitchen — and then nobody gets served, including you. The limit spreads the kitchen's attention fairly across all its guests so the lights stay on. A rate limit protecting the service is a rate limit protecting your access too.
Your plan usually sets your limit. Remember the keys from last lesson? A free key often comes with a modest limit; a paid one buys a bigger one. The key both identifies you and carries your allowance.
What it feels like when you hit it
Here's the practical part. When you go over your limit, the kitchen doesn't cook your order. Instead it sends back a special status code:
- 429 means "Too Many Requests." It's the polite "whoa, slow down" of the API world.
So if your requests were sailing through with calm 200s and suddenly you start getting 429s, you haven't broken anything — you've simply knocked too fast. The fix isn't to try harder; it's to wait. The window resets (a minute passes, the day rolls over) and you're welcome again.
Many APIs even help you here. They tuck little headers into each response telling you how many requests you have left and when the count resets — like the barista saying "you've got two refills left, resets at noon." Reading those lets you pace yourself before you ever hit 429.
How to be a good guest
You don't need clever tricks. You need three calm habits.
Ask only when you need to. If the weather doesn't change second to second, don't request it every second. Ask once, hold onto the answer for a while, and reuse it. (Reusing a saved answer instead of re-asking has a name — caching — but the instinct is just "don't pester the kitchen for what you already have.")
Slow down when told. A 429 is information, not a wall. Pause, then resume. Hammering harder only digs you deeper.
Know your numbers. Before you build anything real on an API, read its docs for the limit. Knowing "1,000 a day" up front means you plan within it instead of crashing into it.
Be the guest the kitchen is glad to see, and the kitchen will serve you for years. 🔦
Your turn
Open the docs of any API you've looked at this course and hunt for its rate limit — search the page for "rate limit," "per minute," "per day," or "quota." Write down the two numbers: how many, how often.
Then do a little math: if you asked once every second, would you blow through a daily limit? (Spoiler: 86,400 seconds in a day adds up fast.) You're learning to plan inside the rules. Next, we put the whole journey together.
Stuck or curious?
Ask Pip about this lesson — tap the porthole bottom-right.