How-To

HTTP 429 and Retry-After: Safe Retries for Web Automation

When an authorized request gets HTTP 429, reduce the load and check the response before trying again. Honor a valid Retry-After value, cap the work, and stop when the next attempt won't fit your budget. Changing IP addresses doesn't establish permission or identify which limit you hit.

Hire a Clawd is our own service. This guide explains documented behavior and a hypothetical retry policy, not measured results from a target website.

A status code doesn't explain the whole block

Confirm that the workflow is authorized before tuning it. If the operator offers an API, export or agreed quota, start there. Slower requests and a different network address aren't substitutes for access approval.

One quiet worker can still belong to a noisy fleet

Put the limit where the work is shared. Five processes each obeying a local limit can exceed one account's quota together. Coordinate concurrency and pacing across the relevant account, host or documented quota scope, including scheduled jobs and manual runs.

Reuse a session when the API requires continuity, but keep its credentials private and include its requests in the shared budget. A browser navigation can trigger more requests than the one page URL you entered; count the traffic that the provider's quota actually measures.

If the permitted capacity is too small, reduce duplicate work, request fewer pages, use supported caching or ask the operator for a suitable quota. Don't respond to an unexplained refusal by cycling identities. There's no universal safe requests-per-second number to copy into every job.

Retry-After can be seconds or a date

RFC 9110, section 10.2.3 defines two forms: a non-negative integer delay after receiving the response, or an HTTP-date. For example, Retry-After: 120 asks for a two-minute wait. A date needs parsing as an absolute time, not as a number of seconds.

A past date or a zero delay doesn't guarantee the next request will succeed. Keep your own pacing and attempt limits. For missing or malformed values, use the service's documented fallback, or defer for investigation when its retry policy is unknown. Don't assume a provider-specific reset header uses seconds, milliseconds or a particular epoch without checking its contract.

If the wait exceeds your job's remaining budget, stop or reschedule the job. Don't shorten the server's requested delay to make it fit. Record a not-before time for deferred work so another worker doesn't immediately retry it.

A bounded policy you can test

Define these rules before enabling retries. They're an application policy, not a promise that a site will accept the next request:

  1. Retry only operations you know are safe to repeat. For a read-only fetcher, start with explicitly permitted GET requests; don't copy that policy onto form submissions or payments.
  2. Set a maximum number of total attempts, including the initial request, plus a total elapsed-time budget. Count network time and waiting time, and check the remaining budget before each new attempt.
  3. Apply the documented server delay. Otherwise, when retries are permitted, use bounded backoff with jitter so workers don't all return at once. Stop once either budget is exhausted.
  4. Use one retry owner. A job runner retrying an HTTP client that already retries can multiply attempts. Configure the layers together and record the final stop reason.

These choices follow the retry, timeout and idempotency concerns described in AWS's engineering guidance. A strict wall-clock deadline also needs request cancellation or a deadline-aware transport; checking time between attempts alone can't interrupt a request that's still running.

Hypothetical example: three attempts, 60 seconds

Suppose a read-only job allows three total attempts and 60 seconds overall. Its first response arrives after two seconds with 429 and Retry-After: 120. Only 58 seconds remain, so the job defers without a second attempt. Its next eligible time is at least 120 seconds after that response, subject to the shared quota and continued authorization.

This is policy arithmetic, not a measured service limit. The appropriate budgets depend on the operator's contract and your workflow.

urllib3 retry counts aren't a deadline

Check the version you deploy against the official Retry API. In the current 2.8.0 documentation:

If your policy forbids an early retry, handle an excessive wait by deferring before the library retries. Test the actual version, transport and surrounding job runner. This guide doesn't supply a tested drop-in retry implementation.

Keep enough evidence to fix the workflow

Record the timestamp, method, status, attempt count, elapsed time, interpreted delay and stop reason. Keep request IDs when the service provides them, but redact authorization headers, cookies, personal data and secret URL parameters. Test missing headers, integer and date delays, a delay beyond budget, 403 responses and exhausted attempts against fixtures you control.

Need help deciding what to change?

Ask for a scoped workflow assessment with the permitted task, documented limits and a redacted failure example. Compatibility and delivery scope need checking before any commitment.

If your immediate need is a browser starting point, our Starter Kit includes a configurable Python browser template, setup guide and checklist. It doesn't include a retry scheduler, proxy-pool manager, proxy subscription or guaranteed site access. Try the free browser example before buying.