HTTP Errors

What Is the 401 Status Code? (Unauthorized)

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 code401
MeaningUnauthorized
Category4xx Client Error
Common causes (scraping)Missing/expired token, wrong API key, no session cookie
Right responseFix the request / retry with backoff; for disguised blocks use a real-browser unblock

What a 401 Unauthorized means

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.). In short, 401 status code is the request lacks valid authentication credentials.

Why scrapers see 401

Scrapers hit 401 when a page or API sits behind authentication: a missing or expired session cookie, an absent or wrong API key / Bearer token, or a login the scraper never completed. Some sites also return 401 instead of 403 when an anti-bot layer decides the caller isn't a logged-in human.

How to fix a 401 error

Supply valid credentials for the scheme the server asks for — refresh an expired token, replay a logged-in session's cookies, or add the API key header. For authenticated areas, log in once and reuse the session instead of authenticating per request. When a 401 is really a disguised bot block on a public page, treat it like a 403: realistic headers, a clean residential IP, and a real-browser fingerprint via Web Unblocker.

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.

0 terms · 0 connections
You are here · HTTP Errors
Building map…

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