Errors and troubleshooting
What causes 503 Service Unavailable while scraping?
Either the server really is overloaded or under maintenance, or a protection layer is answering your requests with 503 as part of a challenge or a soft block.
Two very different 503s
503 Service Unavailable officially means the server is temporarily unable to handle the request, because it is overloaded or down for maintenance. In scraping you meet a second kind: protection systems that serve a challenge or a soft block with status 503. The first kind fixes itself with time; the second needs you to change how you send requests, or to pass the check. Telling them apart takes one look at the body.
A real outage or overload
- The body is a maintenance page or a short server error, often the same for every visitor.
- A
Retry-Afterheader may say when to come back. - A normal browser on another network sees the same error.
- The errors come and go with the site's peak hours.
Back off and retry later. If your own traffic could be part of the load, reduce it: a scraper that keeps hammering an overloaded site prolongs the outage for everyone and is likely to be blocked when the site recovers.
A challenge or soft block
- The body contains a JavaScript challenge, a "checking your browser" message or a CAPTCHA.
- The same page loads fine in your own browser.
- Only your scraper's IPs or user agents get the 503.
Cloudflare's challenge pages, for example, have historically been served with 503 as well as 403. In that case solve the challenge: an Cloudflare Challenge task returns the cf_clearance cookie for your proxy and user agent. The page on identifying Cloudflare protection shows which markers to look for.
def triage_503(resp, browser_sees_it_too):
text = resp.text.lower()
if "challenge" in text or "captcha" in text or "checking your browser" in text:
return "solve the challenge, then reuse the session"
if browser_sees_it_too:
return "real outage: wait, honor Retry-After, lower the rate"
return "soft block on your client: slow down, fix headers, try another IP"
Rate driven 503s
Some servers and API gateways use 503 instead of 429 when you exceed a limit, or when their queue for your IP is full. If 503s appear only above a certain request rate and vanish when you slow down, treat them like 429 responses: cap concurrency per host and add backoff with jitter.
Retry rules
Retry 503 with exponential backoff, honoring Retry-After when present. Cap the number of retries, and stop the whole job if most requests return 503 for several minutes; that is an outage, not a transient error. Record the body of a few 503 responses so you can tell later which kind you hit.
GateSolver's equivalent
If the GateSolver API itself cannot process a request at a given moment, the JSON reply carries ERROR_SERVICE_UNAVAILABLE. It is not charged; wait a few seconds and repeat the call. In the in.php interface, the reply ERROR_NO_SLOT_AVAILABLE plays the same role: retry shortly. The error handling guide shows how to fold both into your retry logic alongside site-side 503s.
Being a good citizen
When a site is under strain, the considerate move is to pause. Schedule heavy jobs outside the site's busy hours, use caching so you only fetch pages that changed, and keep a global pause switch in your scraper so you can stop all workers at once. These habits avoid trouble with the site and keep your data collection sustainable.
If 503s persist for hours on a site that works for normal visitors, assume you are being filtered rather than waiting out an outage, and revisit your headers, IPs and request rate.
Common questions
Is 503 always a server problem?
No. Protection systems also serve challenges and soft blocks with 503, so check the response body.
How long should I wait after a 503?
Honor Retry-After if present; otherwise back off exponentially starting from a few seconds.
Can a 503 page contain a CAPTCHA?
Yes. Some challenge pages use 503, and solving them yields a cookie that clears the session.
What is the GateSolver equivalent of a 503?
ERROR_SERVICE_UNAVAILABLE in JSON or ERROR_NO_SLOT_AVAILABLE in in.php; both are free, retry shortly.
Why do I get 503 only at high concurrency?
The server or gateway is using 503 as a rate limit; lower concurrency per host and add backoff.
Keep reading
- HTTP status codeThe three digit codes servers answer with, and what 200, 301, 403, 429 and 503 usually mean for a scraper.
- How do I avoid HTTP 429 Too Many Requests?A 429 means you crossed a rate limit; slow down, honor Retry-After, back off with jitter and spread load across sessions.
- Tell Turnstile, managed challenges and blocks apartStatus codes, headers, page markers and cookies that separate a Turnstile widget, a challenge page and a hard Cloudflare block.
- Error handling for CAPTCHA APIsSort every CAPTCHA API error into retry, fix or stop, follow those rules in code, and know which outcomes cost nothing.