
503 Service Unavailable means the server understood your request and is
choosing not to serve it right now. The specification is explicit that this is
temporary — unlike a 404, a 503 is a statement about the server's current
condition, not about the resource.
That one word, temporary, is why the status is so often misread. A 503 is
the same code whether the server is restarting, is genuinely overloaded, or has
decided you specifically are not getting in. The fix for each is different, and
retrying is only correct for one of them.
The three things a 503 actually means
1. Real overload or maintenance
The origin is restarting, deploying, or out of capacity. This is what the status
is for. It is usually brief, usually affects everyone equally, and usually comes
with a Retry-After header.
Signal: the response is small, generic, and served fast. A maintenance page is cheap to generate.
2. An edge that cannot reach the origin
A CDN or reverse proxy in front of the site is up, but the thing behind it is
not. The edge answers on the origin's behalf. Cloudflare's 521, 522 and
523 are vendor-specific variants of exactly this, which is why they are worth
knowing: a 521 means Cloudflare's own network could not open a connection to
the origin at all.
We hit this during a production run against 51 hard targets. One of our three
failures turned out to be a site returning 521 to Cloudflare's own network —
the origin was broken for everybody, not just for us. We had it on our list of
things we could not scrape for weeks before we checked from the other side.
Signal: the error page carries the CDN's branding, not the site's. The body names the vendor.
3. You are being refused
This is the one people miss. Some anti-bot systems answer automated traffic with
a 503 and a challenge page rather than a 403, because 503 reads as
innocuous and encourages clients to retry — which is exactly what makes a
scraper look worse.
Signal: the body is large, contains JavaScript, and mentions a security check or a browser verification. The status says "come back later" and the body says "prove you are a human".
Never classify an HTTP response by status code alone. We ship a content guard
that inspects the body of every 401, 403 and 429 before deciding whether
the request was served or refused — because the status line and the body
disagree often enough to matter.
How to tell them apart in code
The honest check reads three things: the status, the headers, and enough of the body to recognise a challenge.
import re
CHALLENGE = re.compile(
r"(checking your browser|security check|verify you are human|"
r"enable javascript and cookies|cf-browser-verification)",
re.I,
)
def classify_503(response):
body = response.text or ""
# Refusal dressed as a 503: large body, challenge language.
if len(body) > 2500 and CHALLENGE.search(body):
return "refused"
# Edge could not reach the origin.
server = response.headers.get("server", "").lower()
if response.status_code in (521, 522, 523) or "cloudflare" in server:
if "origin" in body.lower() or response.status_code != 503:
return "edge"
retry_after = response.headers.get("retry-after")
return "overloaded" if retry_after else "unknown"The 2500 is not arbitrary. A genuine maintenance page is small. A challenge
page carries a JavaScript payload, and in our own measurements the body length
separates the two cleanly enough to use as a first-pass filter — we use the same
floor in production.
What to do about each
| Classification | Correct action | Wrong action |
|---|---|---|
| Overloaded / maintenance | Honour Retry-After, back off exponentially | Retrying immediately |
| Edge cannot reach origin | Stop. The site is down for everyone | Rotating your exit address |
| Refused | Change how you are asking, not how often | Retrying at all |
The third row is the important one. If a 503 is a refusal, every retry makes
your traffic pattern more obviously automated, and the thing you need to change
is upstream of the retry loop: the exit address, the TLS fingerprint, whether
you are rendering JavaScript at all.
Honouring Retry-After properly
Retry-After comes in two formats and most clients only handle one:
from email.utils import parsedate_to_datetime
from datetime import datetime, timezone
def retry_delay(response, default=30):
value = response.headers.get("retry-after")
if not value:
return default
if value.strip().isdigit(): # delta-seconds
return int(value)
try: # HTTP-date
when = parsedate_to_datetime(value)
return max(0, (when - datetime.now(timezone.utc)).total_seconds())
except (TypeError, ValueError):
return defaultIf you only parse the integer form, you silently fall back to your default on every server that sends a date — and your "polite" backoff stops being polite.
Getting the page anyway
When the 503 is a refusal rather than an outage, the fix is to make the
request look like what it claims to be. In our audit of production failures,
the cause was the exit address far more often than the browser fingerprint —
eleven of fourteen genuine walls were network-level. So the first lever is
where the request comes from, and the second is whether a real browser rendered
it.
curl -X POST "https://api.scrapengine.io/api/v1/scrape" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/the-page",
"render": true,
"country": "us"
}'render: true runs the page in a real browser, which resolves challenges that
depend on executing JavaScript. country selects the exit region — useful when
the 503 is geographic rather than behavioural.
Across a production run against 51 targets known to be hard, 48 came back with a
real page. The three that did not were reported as refusals, with the name of
the wall — not as empty successes. That distinction is the whole point: a
pipeline that cannot tell a 503 outage from a 503 refusal will retry the
wrong one forever.
Frequently asked questions
It means the server understood the request but is not serving it right now. The status is explicitly temporary — it describes the server's current condition rather than the resource, so the same URL may work moments later.
Related guides
- HTTP7 min read403 Forbidden: Why a Scraper Gets One and What Actually Fixes ItWe audited every 403 in our production corpus. The browser fingerprint was almost never the cause — the exit address was. Here is how to tell which one you have.
- HTTP7 min read429 Too Many Requests: Reading Retry-After and Backing Off ProperlyA 429 is the one refusal that tells you how to fix it. Most clients ignore half the instruction — here is how to parse it, and when a 429 is not about rate at all.
- AI Agents7 min readHTML to Markdown: Turning a Live Page into Clean Input for an LLMConverting HTML to Markdown is easy. Getting Markdown worth feeding to a model is the hard part — most of the work happens before the converter runs.