```yaml
product: AlterLab
title: "HTTP Status Code — Web Scraping Glossary | AlterLab"
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/glossary/http-status-code
```

protocol

# HTTP Status Code

HTTP status codes are three-digit numbers in server responses that indicate the outcome of a request — success, redirection, client error, or server error.

HTTP status codes are grouped into five classes by their first digit. 1xx codes are informational (rarely encountered by scrapers). 2xx codes signal success: 200 OK (content returned), 204 No Content (success with empty body). 3xx codes are redirects: 301 Moved Permanently, 302 Found (temporary redirect), 304 Not Modified (cached content still valid).

4xx codes indicate client-side errors: 400 Bad Request (malformed request), 401 Unauthorized (authentication required), 403 Forbidden (authenticated but not permitted), 404 Not Found (resource absent), 429 Too Many Requests (rate limited, check Retry-After header). 5xx codes indicate server-side errors: 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout.

For scrapers, 403 and 429 are the most important to handle correctly. A 403 typically means the IP or session is blocked — rotating proxies or solving a challenge is needed. A 429 means the request rate should be reduced — respect the Retry-After header or apply exponential backoff. 5xx errors are generally transient and worth retrying.

### What is HTTP Status Code?

HTTP status codes are three-digit numbers in server responses that indicate the outcome of a request — success, redirection, client error, or server error.

### How does AlterLab handle HTTP Status Code?

For scrapers, 403 and 429 are the most important to handle correctly. A 403 typically means the IP or session is blocked — rotating proxies or solving a challenge is needed. A 429 means the request rate should be reduced — respect the Retry-After header or apply exponential backoff. 5xx errors are generally transient and worth retrying.

## Examples

```
import httpx

response = httpx.get("https://example.com")
match response.status_code:
    case 200:
        process(response.text)
    case 429:
        wait = int(response.headers.get("retry-after", 60))
        time.sleep(wait)
    case 403:
        rotate_proxy()
    case _ if response.status_code >= 500:
        retry_with_backoff()
```

## Related Terms

[HTTPHTTP (HyperText Transfer Protocol) is the application-layer protocol used by web browsers and scrapers to request and receive resources from web servers.](https://alterlab.io/glossary/http)[Rate LimitingA server-side control that caps the number of requests accepted from a single IP or session within a time window, returning HTTP 429 when exceeded.](https://alterlab.io/glossary/rate-limiting)[Retry LogicAutomated re-sending of failed requests with backoff strategies, essential for handling transient errors, rate limits, and flaky anti-bot challenges.](https://alterlab.io/glossary/retry-logic)[Exponential BackoffExponential backoff is a retry strategy where the wait time between successive retries increases exponentially, reducing load on rate-limited or temporarily unavailable endpoints.](https://alterlab.io/glossary/exponential-backoff)[Anti-Bot ProtectionSystems deployed by websites to detect and block automated traffic using TLS fingerprinting, CAPTCHA challenges, and behavioural analysis.](https://alterlab.io/glossary/anti-bot-protection)

## Extract HTTP Status Code data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

[View API docs](https://alterlab.io/docs/api/rest)

[Back to Glossary](https://alterlab.io/glossary)