HTTP 429 Too Many Requests: Read the Headers, Then Back Off

A 429 is an application-level 'slow down', not a network failure. The response headers usually tell you exactly when to retry and how — clients that honor them fix themselves.

What you'll see

Root causes

Client exceeds the provider's quota

Rate limits are per token, per IP, or per endpoint. Check the vendor's docs against your request pattern — fan-out loops and retry storms are the usual offenders.

Missing retry-after handling

The 429 usually carries Retry-After or X-RateLimit-Reset headers. Clients that ignore them and hammer anyway get deprioritized further or temporarily blocked.

Fix it

  1. Read the rate-limit headers
    curl -sI https://api.example.com/v1/things | grep -iE 'retry-after|rate-limit|429'
  2. Implement exponential backoff with jitter
    # retry on 429/503: wait = min(base * 2^n, cap) + random_jitter; honor Retry-After when present
  3. Batch or throttle the workload
    # e.g. p-limit in Node, ratelimit in Python, or a token bucket in front of fan-out calls
  4. Verify the limit isn't a misconfiguration
    # your own nginx? limit_req settings; your own app? middleware defaults — 429s from your stack are yours to tune

Field note

Shared pools: some providers count by IP for anonymous traffic — a NAT office can trip limits for everyone. Log 429s with the retry window; alerting on them without the window tells you nothing actionable.

Common questions

Should I just retry 429s immediately in a loop?

Never — immediate retries add load and often extend throttling. Honor Retry-After if present, otherwise exponential backoff with jitter, and cap total retries.

How do I raise the limit?

If it's a third-party API: higher-tier plans, API keys (per-token limits usually beat per-IP), or asking for a quota bump. If it's your own service: tune the limiter middleware deliberately.

Ship it right the first time

Our most-documented failures, packaged as ready-to-ship starter kits: Docker, Kubernetes, and Terraform.

Browse the template store →

One-time. Yours to modify. Instant download from the NinjaOps template store.