Skip to content

4xx Client errors

429 Too Many Requests

The client sent too many requests in a time window (rate limiting). Retry-After says when to try again.

Common causes

  • Laravel's throttle middleware (API routes: 60 per minute by default).
  • Login throttling after failed attempts.
  • An external API's rate limit.

How to fix a 429 error

  1. 1

    Wait for Retry-After seconds and retry with back-off.

  2. 2

    Raise or tune the limit in RateLimiter::for() if real users hit it.

  3. 3

    Cache API responses instead of calling the API on every page view.

In Laravel

RateLimiter::for('api', fn ($request) => Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()));

Check the status of a URL

The first line of the response shows the status code; -L follows redirects and shows each step.

curl -I https://example.com/page
curl -IL https://example.com/old-page

Frequently asked questions

What does HTTP 429 mean?

The client sent too many requests in a time window (rate limiting). Retry-After says when to try again.

How do I fix a 429 error?

Wait for Retry-After seconds and retry with back-off. Raise or tune the limit in RateLimiter::for() if real users hit it. Cache API responses instead of calling the API on every page view.

How does Laravel handle 429?

RateLimiter::for('api', fn ($request) => Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()));

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.