Guides

Audit your scraping bill for dead links and refused pages

Dead links and refused pages are paid for again on every scheduled re-crawl. A small Python script to audit your own results log, how to spot soft 404s, and what to change.

Sid Mishra6 min read
Card titled 'Audit your scraping bill for dead links and refused pages'. A stat card reads: 500 dead URLs a run (5% of 10,000), × 52 weekly runs a year, 26,000 paid requests for nothing, marked as an example, not a measurement.
On this page

TL;DR

  • Dead links (404, 410) and refused pages (401, 403, 429, challenge pages) are paid for again on every scheduled re-crawl, not once.

  • An example: 10,000 URLs with 5% dead, crawled weekly, is 26,000 dead requests a year. On an API that bills 1 credit per 404 at $0.99 per 1,000, that's about $26 a year, or about $129 with JSON extraction.

  • The script below reads your own results log and splits it into ok, dead and refused, with counts, credits and the URLs that stayed dead run after run.

  • Watch for soft 404s: a "page not found" template served with status 200 looks like success in every log.

  • Drop a URL only after two dead runs in a row, keep refused pages, and use the sitemap to skip what hasn't changed.

Most web scraping costs are read as one number: pages times price. The pages that return nothing hide inside that number. A URL that went dead in March is still in the list in November, and every scheduled run pays for it again.

This is a hands-on audit you can run on your own results log, whatever API you use. Who bills what is a separate question; our comparison of web scraping APIs covers it (checked 26 November 2026).

Why do dead and refused pages cost more than they look?

Because a crawl list ages and a schedule repeats. Here's an example (not a measurement):

  • 10,000 URLs, 5% of them dead: 500 dead requests a run.

  • Crawled weekly: 500 × 52 = 26,000 dead requests a year.

  • On an API that bills 1 credit per 404, at Firecrawl Standard's $0.99 per 1,000 credits: about $26 a year.

  • With JSON extraction at 5 credits a page: about $129 a year.

That's small for one site, and I won't pretend otherwise. It grows with every site you add, every schedule you tighten from weekly to daily, and every month the list goes without a clean-up. Refused pages add to it on APIs that bill them. Firecrawl bills 403s as well as 404s; ScrapingBee and ZenRows bill 404s and 410s; ScraperAPI bills 404s (all from that comparison, checked 26 November 2026).

The audit: what did you pay for?

The script reads a results log, either JSONL or CSV, with url, status and, if your API returns it, credits. Add a run column (the run's date, so it sorts) and a challenge column set to 1 for challenge pages, if your API tells you about them. Without a run column, it uses the order of the log. It uses only the standard library.

import csv
import json
import sys
from collections import defaultdict

DEAD = {404, 410}
REFUSED = {401, 403, 429}

def rows(path):
    with open(path, newline="", encoding="utf-8") as f:
        if path.endswith(".jsonl"):
            return [json.loads(line) for line in f if line.strip()]
        return list(csv.DictReader(f))

def kind(row):
    status = int(row.get("status") or 0)
    if status in DEAD:
        return "dead"
    if status in REFUSED or str(row.get("challenge", "")).lower() in ("1", "true"):
        return "refused"
    return "ok" if 200 <= status < 300 else "other"

totals = defaultdict(lambda: [0, 0.0])        # kind -> [requests, credits]
history = defaultdict(list)                   # url -> [(run, order, kind)]
for i, row in enumerate(rows(sys.argv[1])):
    k = kind(row)
    totals[k][0] += 1
    totals[k][1] += float(row.get("credits") or 0)
    history[row["url"]].append((row.get("run", ""), i, k))

for k in ("ok", "dead", "refused", "other"):
    n, credits = totals[k]
    print(f"{k:8} {n:5} requests {credits:8.0f} credits")

print("\nDead on the last 2+ runs in a row:")
for url, seen in sorted(history.items()):
    streak = 0
    for _, _, k in sorted(seen, reverse=True):
        if k != "dead":
            break
        streak += 1
    if streak >= 2:
        print(f"  {url} ({streak} runs)")

A sample log, three weekly runs of seven product pages (made up for this post):

run,url,status,credits,challenge
2026-11-09,https://shop.example.com/p/kettle,200,1,
2026-11-09,https://shop.example.com/p/mixer-old,404,1,
2026-11-09,https://shop.example.com/p/scale,200,1,1
2026-11-09,https://shop.example.com/p/press,503,1,
2026-11-16,https://shop.example.com/p/toaster,404,1,
2026-11-16,https://shop.example.com/p/press,404,1,
...

What python audit_bill.py results.csv printed:

ok           7 requests        7 credits
dead         9 requests        9 credits
refused      4 requests        4 credits
other        1 requests        1 credits

Dead on the last 2+ runs in a row:
  https://shop.example.com/p/grinder (3 runs)
  https://shop.example.com/p/mixer-old (3 runs)
  https://shop.example.com/p/press (2 runs)

Two things to notice. The toaster page went 404 once and came back, so it's not on the list: one bad run isn't a dead page. And the press page counts as dead for two runs only, because its first run was a 503, which is the site having a bad day, not the page leaving.

What about a 200 that is really a 404?

Some sites serve their "page not found" template with status 200. A soft 404 looks like success in any log, so the audit above counts it as ok and you keep paying for it. Two ways to spot one:

  • The page says so. The title contains "not found" (or "404", or "page doesn't exist") and the page is short. If your log keeps the title and a word count, filter on both.

  • Compare with a page that can't exist. Request a path like /this-page-does-not-exist-7f3a on the same site and keep what comes back. A page that returns the same content is the site's not-found page, whatever its status code says.

What should you do about it?

  • Drop a URL after it's dead on two runs in a row. A 404 or 410 twice is a page that's gone. A timeout or a 5xx is not dead, however many times it happens.

  • Keep refused pages. A 403 or a 429 means the site refused you, not that the page left. Slow down, or read it another way. Don't delete it from your list.

  • Use the sitemap's lastmod on sitemap-driven crawls. If the sitemap says a page hasn't changed since your last read, you may not need to read it again, and a URL that drops out of the sitemap is a candidate to check.

  • Set a per-page credit cap if your API has one, so a page that would need an expensive read stops at the cap instead of quietly costing more.

How does this look on MeshArc?

I build MeshArc, so weigh this section accordingly. Every page in a response carries its httpStatus, a verdict and the credits it cost:

  • a 404 or 410 comes back with verdict missing, errorCode NOT_FOUND and 0 credits,

  • a refused page comes back blocked, at 0 credits,

  • a soft 404 the crawler recognises is also missing, at 0.

Summing credits by verdict for your own list:

from collections import Counter
from mesharc import MeshArc

arc = MeshArc()  # reads MESHARC_API_KEY
urls = [line.strip() for line in open("urls.txt") if line.strip()]
batch = arc.scrape(urls)
spent = Counter()
for row in batch["pages"]:
    print(row["url"], row["httpStatus"], row["verdict"], row["credits"])
    spent[row["verdict"]] += row["credits"]
print(spent)

(Up to 500 URLs per call; split a longer list into batches.)

One thing that isn't free: a page MeshArc re-reads and finds unchanged is still a read, and it's billed. Only with sitemap_incremental set to true is a page the sitemap marks unchanged skipped at no cost. The per-page cap is max_credits_per_page.

FAQ

Is a 404 always safe to remove from my crawl list?

Not after one run. Wait for two dead runs in a row, and check that the site hasn't moved the page (a redirect target or a new URL in the sitemap).

Why keep pages that return 403 or 429?

Because they're still on the site. A refusal tells you about your request, not the page. Removing them means losing pages you'll want back once you can read them.

Does my scraping API bill 404s?

It depends on the API. Some bill a 404 like any other page, and some don't say how a 404 counts. The comparison lists what each vendor's own pages say, checked 26 November 2026.

How do I catch soft 404s automatically?

Store the title and word count with each result, flag short pages whose title says "not found", and compare against the site's response to a path that can't exist.

What if my API doesn't return credits per page?

Run the audit without the credits column. The request counts still show where the waste is, and you can multiply by your plan's price per request.

Try a URL in the playground to see the status, verdict and credits for a page you already scrape.

ShareLinkedInX
Sid Mishra · Founder, MeshArc

Founder of MeshArc, a scraping API for sites you read more than once. Writes about web scraping, keeping RAG data fresh and spotting what changed on a site.

LinkedInXWebsite

The MeshArc newsletter

New posts and what changed, at most twice a month.

Related posts

Guides

How to generate llms.txt for any site

An llms.txt is a short Markdown map of a site for AI assistants. How to generate one from a sitemap in seconds, or from a crawl with real page descriptions and an llms-full.txt beside it, and the four things that make a generated file wrong.

25 Nov 2026 · 9 min read · Sid Mishra

Guides

Competitor price monitoring with Python: a daily tracker

A daily competitor price tracker in Python: prices read as numbers, mapped to your own SKUs, each run compared with the last, and a blocked page never mistaken for a price change. With a real run and what a month costs.

16 Nov 2026 · 12 min read · Sid Mishra

Crawl a site and see what changed.

A one-time 1,000 credits to start, browser tier included, no card. The playground answers in seconds.