On this page
HTTP 401 Unauthorized means the request lacks valid authentication credentials. The server is telling you it doesn't know who you are — unlike 403, which means it knows and still refuses. The response usually carries a WWW-Authenticate header naming the scheme (Basic, Bearer, etc.). It's also written “HTTP 401” or just “401 error” / “401 status code.”
Quick facts
| Status code | 401 |
|---|---|
| Meaning | Unauthorized |
| Category | 4xx Client Error |
| Common causes (scraping) | Missing/expired token, wrong API key, no session cookie |
| Right response | Fix the request / retry with backoff; for disguised blocks use a real-browser unblock |
Related terms
Concept map
How 401 Status Code (401 Unauthorized) connects
The terms most directly tied to this one. Hover a node to see its neighbours, click to preview, drag to rearrange.
Tools & solutions for this topic
Frequently asked questions
Is 401 a client or server error?
It's a client-side (4xx) error — the server is pointing at something in your request.
Does a 401 mean I'm blocked when scraping?
Not necessarily. 401 points at your request, not a ban — but anti-bot layers sometimes return it instead of a 403, so check the response body and headers.
How do I fix a 401 error?
The request lacks valid authentication credentials is the cause, so the fix targets that. Correct the offending part of the request, then retry.
What's the difference between 401 and 403?
401 Unauthorized means you haven't authenticated — provide credentials and retry. 403 Forbidden means you're authenticated (or none is needed) but still not allowed. For unauthenticated scraping, 403 is usually the relevant one.
Last updated: 2026-05-28