New1 billion tokens free on sign-up — crawl, parse, chunk and embed on the houseSee pricing
SarvCrawlSarvCrawl

Glossary · Extraction and parsingUpdated

What do HTTP status codes mean for scraping?

HTTP status codes are the three-digit numbers a server returns with every response to say what happened: 2xx success, 3xx redirect, 4xx a problem with the request, 5xx a problem on the server. For a scraper they decide whether to keep the page, follow it, retry it later or drop it.

01Status codes in more depthof 06

Status codes in more depth

Every HTTP response starts with a status line, such as HTTP/1.1 200 OK. The first digit gives the class; the rest narrows it down. Browsers mostly hide the code, but a crawler has to act on it for every URL, and storing it is the cheapest way to see what went wrong in a large crawl.

The codes that matter, and what to do

CodeMeaningWhat a scraper should do
200 OKThe page was returned.Keep it, but check it is the real content and not an error or login page.
301, 308Moved permanently.Follow, and record the new URL in place of the old one.
302, 303, 307Moved temporarily.Follow, but keep the original URL as the one to revisit.
304 Not ModifiedUnchanged since your last copy (conditional request).Reuse the stored copy.
401, 403Authentication required, or refused.Often a block or login wall. Retrying unchanged rarely helps.
404 Not FoundNothing at this URL.Drop it; recheck later if it used to exist.
410 GoneDeliberately and permanently removed.Drop it and stop revisiting.
429 Too Many RequestsYou hit a rate limit.Slow down and retry after Retry-After.
500, 502, 503, 504Server or gateway error.Retry later with backoff; 503 often means overload.

429 has its own entry: see HTTP 429 and rate limiting for backoff with jitter.

Redirects and soft errors

Redirects matter to a crawler because they change what a URL is. A permanent redirect means the old address should be replaced; a chain of several hops, or a loop, should be cut off after a few steps. A redirect can also lead off the site entirely, which a scoped crawl has to refuse. See redirect handling.

The status code is also not always honest. A soft 404 is a “page not found” message served with 200, and many bot challenges and login pages return 200 too. Checking for very short content or known error text catches most of them.

Common pitfalls

  • Treating every non-200 as permanent. 429 and 5xx are temporary by nature; record them and come back.
  • Retrying 404s in a loop. They will not fix themselves on the next request.
  • Indexing soft 404s. Error pages served with 200 end up in a knowledge base as junk.
  • Not storing the code. Without it, a crawl that quietly returned 403 for half the site looks like a short site.

How SarvCrawl handles it

SarvCrawl stores the HTTP status code of every page it fetches, and GET /api/kb/:id/pages returns it with each page, so you can find failures after a crawl. Responses of 401, 403 and 429 are retried through a different proxy path. Redirects are followed; if the target falls outside the crawl’s scope, the page is rejected with an error saying why. When a monitored page stops loading, the monitor endpoint reports it with status error rather than skipping it.

curl -s -H "x-api-key: $KB_API_KEY" \
  https://crawl.sarv.com/api/kb/$KB_ID/pages

Frequently asked questions

Should a scraper retry a 403?

Once or twice at most. A 403 usually means the server has refused the client, and repeating the same request rarely changes that. Slowing down, or checking whether the site allows automated access, is more useful.

What is the difference between 404 and 410?

Both mean nothing is at the URL. 410 Gone says the removal is deliberate and permanent, so a crawler can stop checking; a 404 may come back.

What is a soft 404?

An error page returned with status 200 instead of 404. It looks like success to a scraper, so detect it by content: very short pages or known “not found” text.

Which status codes are safe to retry?

429 and 5xx codes, with backoff. For 429, wait for the Retry-After time if the server gives one.

SarvCrawl

Turn any site into a searchable knowledge base

Crawl pages and parse documents into clean markdown, then chunk, embed and search them from one API.