48 of 51 hard targets returned a real page in production. Read the run

Blog / HTTP

503 Service Unavailable: What It Means and How to Get the Page Anyway

A 503 can mean a server is overloaded, in maintenance, or quietly refusing you. Here is how to tell the three apart, and what to do about each.

Scrapengine Team//7 min read

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".

Watch out

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.

Python
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

ClassificationCorrect actionWrong action
Overloaded / maintenanceHonour Retry-After, back off exponentiallyRetrying immediately
Edge cannot reach originStop. The site is down for everyoneRotating your exit address
RefusedChange how you are asking, not how oftenRetrying 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:

Python
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 default

If 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.

Shell
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.

FAQ

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.

Keep reading

The pages you need are already refusing you

Start with a thousand pages. No proxy pool to rent, no browser fleet to run, and nothing billed for a wall we could not get through.