Use this when automation hits API rate limits (HTTP 429) and must throttle requests.
Rate Limiting · Parallelism & Concurrency
Rate limiting caps how many requests or tasks run per second, respecting API limits and HTTP 429 responses, so automation does not get throttled or overload targets.
1. Rate limiting protects APIs and devices.
2. Client-side throttling.
3. Respect headers.
4. Back off on 429.
5. Spread scheduled jobs.
requests → rate limiter → API within limits
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Retrying immediately on 429.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Respect 429 and Retry-After.
- Throttle requests.
- Batch where possible.
- Client-side rate limiter (token bucket) — throttling
- API limit headers monitored — awareness
- Backoff on 429 — handling
ReferenceWhy it matters1 section · depth on demand
What it is
Rate limiting caps request rates to protect APIs and devices; clients must respect 429 and Retry-After.
ReferenceImportant terms & boundaries2 sections · depth on demand
How it works
APIs enforce limits per token, user or IP, usually over a time window, and return 429 with Retry-After when exceeded. Clients should throttle themselves (token bucket) and back off exponentially with jitter on 429/503.
Example
for attempt in range(5):
r = s.get(url, timeout=10)
if r.status_code != 429: break
time.sleep(int(r.headers.get("Retry-After", 2 ** attempt)))
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Parallelism & Concurrency > Rate Limiting. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.python.org/3/library/concurrent.futures.html · confidence 94%