Skip to main content

falseok: catch the 200 OK that isn't

Your scraper didn't fail. It succeeded at saving a captcha.

falseok tells you when a scraped page that came back 200 OK is really a block, a login wall or an empty shell, and when today's dataset quietly broke.

pip install falseok
falseok page product.html --status 200
falseok data today.json --vs yesterday.json

Pure Python, zero dependencies, works with whatever fetches your pages. It recognises blocks. It never tries to get around them.

Twelve tools, the same fresh pages

Twelve tools on the same 982 fresh pages: falseok gave a wrong verdict on 3.2% of them, the next best tool on 9.9%; falseok caught 97.4% of the anti-bot blocks and 73.1% of the unusable 200 OK pages, and flagged 0.5% of the real pages

982 pages drawn at random from 40,432 fresh pages on 30,066 sites in 38 languages; no rule of any falseok version was written or tuned on them. Labels come from three independent reviewers; a page counts when at least two of them gave it the same label. The 144 hardest pages of the sample were then re-checked by hand and on screenshots, and that label wins. Every tool judged the same bytes, with the status code and the response headers. 982 pages got a label: 656 real, 117 anti-bot blocks, 141 other refusals, 68 empty. 104 of the 326 unusable pages came back without an error status; the table calls them "200 OK". A wrong verdict is an unusable page let through or a real page flagged, out of all 982.

tool wrong verdicts blocks caught unusable "200 OK" caught real pages flagged other refusals caught empty pages caught ms per page
falseok 3.2% 97.4% 73.1% 0.5% 90.1% 83.8% 1.59
Built for the same job
a Rust scraper's anti-bot classifier 16.8% 94.9% 33.7% 0.2% 16.3% 41.2% 1.68
the blocked-page detector of a popular Python crawler 16.8% 94.9% 33.7% 0.2% 16.3% 41.2% 3.15
a new Python response classifier 23.5% 65.0% 20.2% 0.3% 2.1% 26.5% 49.5
the most used anti-bot detector, JavaScript 25.3% 63.2% 3.8% 0.0% 0.7% 4.4% 2.21
a Rust challenge detector 39.6% 64.1% 14.4% 25.9% 17.0% 11.8% 0.17
Rules inside scraping frameworks
the ban rule of the most used proxy-rotation add-on 9.9% 96.6% 6.7% 0.0% 78.0% 8.8% 0.12
the blocked-request rule of a major crawling framework 21.9% 94.0% 0.0% 0.0% 0.7% 0.0% 22.7
the challenge checks of the most used Cloudflare library 33.2% 0.0% 0.0% 0.0% 0.0% 0.0% 0.02
One-line checks
status-code check (4xx/5xx = bad) 10.6% 95.7% 0.0% 0.0% 78.0% 0.0% <0.01
page-size check (under 10 KB = bad) 14.6% 92.3% 42.3% 1.5% 38.3% 45.6% <0.01
keyword search (captcha, blocked, access denied...) 63.6% 83.8% 51.0% 77.3% 51.1% 55.9% 2.89

falseok gave a wrong verdict on 3.2% of the labelled pages; the next best tool, the ban rule of the most used proxy-rotation add-on, on 9.9%: 3.1 times fewer wrong verdicts. Bold is the best value in a column. The one-line checks are the fastest because they read almost nothing: a status code, a length.

Some of these tools were built for a narrower job (only Cloudflare challenges, only status codes, only anti-bot vendors); the benchmark quotes what each one claims to catch, with 95% confidence intervals.

"Other refusals" are pages not found, server errors, login-only pages and the like. Most of them carry an error status, which is why a plain status check does well there (78.0%) and catches no empty page at all.

Where falseok loses: real pages flagged. It flagged 3 of 656 real pages (0.5%). Five tools flagged none, two more flagged a single page. The 3 were short real pages (33, 57 and 961 characters of visible text) called empty. None of them was called an anti-bot block. The tools with zero false alarms judge only the status code or a few known signatures, or decline to judge many pages, and they catch 0 to 7 of the 104 unusable pages that came back without an error status; falseok caught 76.

What it missed: 3 of the 117 blocks, all served with status 200.

Speed: about 1.4 times faster than the most used JavaScript detector, level with the Rust classifier, about 31.2 times faster than the new Python classifier. The quickest checks (the Rust challenge detector, the proxy add-on's ban rule, the Cloudflare checks, status code, page size) are faster still, because they read almost nothing or stop at the first match. Next to a download of 500 ms or more, under 2 ms is noise.

The table above was measured with 0.3.0, code frozen, on pages no version was tuned on. How 0.3 compares with 0.1 and 0.2 on the same fresh pages and made-up addresses:

Three versions on the same fresh pages (982 labelled pages and 5,315 made-up addresses): 0.3 checks a page in 1.68 ms (0.1: 15.4 ms, 0.2: 2.15 ms), catches 74.6% of made-up addresses that answer 200 OK (0.1: 64.2%), gets 96.8% of everyday pages right (0.1: 96.4%), and checks 2,000 files 3.6 times faster on all cores

New in 0.3

New in 0.3: where the request ended up (url, final_url), what to do next (action, confidence, retry_after), page facts, your own rules, many pages at once (check_pages, --jobs)

More than a block detector

More than a block detector: page not found 92.4% of 5,315 made-up addresses, empty shells 83.8%, block markers in the response headers of 4 anti-bot services, 44 languages, 1,020 of 1,020 broken dataset days caught

  • Page not found: 4,910 of 5,315 made-up addresses on real sites (92.4%), including 173 of the 232 that answered 200 OK at the same address; 5,158 (97.0%) when you also pass url and final_url.
  • Empty shells: 57 of 68 pages that loaded a menu and a footer and nothing else.
  • Response headers: pass them (--headers, or headers= in Python) and it reads the anti-bot service's own block marker and names the vendor (4 services so far).
  • 44 languages: "page not found", "access denied" and the other wording sites write themselves, each phrase taken from a page that really came back.
  • Datasets: on four real scraped datasets, it caught 1,020 of 1,020 deliberately broken days (lost rows, emptied or vanished fields, frozen values, type changes, duplicates, block pages saved as rows) and stayed quiet on 200 of 200 healthy ones. A row-count alert, what most pipelines have, caught 240.

Three things we learned the hard way:

  • Status codes lie. 104 of the 326 unusable pages in the benchmark came back without an error status. A status check calls all of them a success.
  • Grepping for "captcha" flags 77% of real pages (507 of 656). Anti-bot scripts, signup captchas and cookie banners load on normal pages too.
  • Block pages are short. Real pages aren't. The block pages we measured carry 0 to ~2,000 characters of visible text. That one fact does most of the work, and it is also where falseok's few false alarms come from.

Check pages

falseok page product.html
falseok page pages/*.html --status 200
falseok page page.html --headers headers.txt   # the response headers, as `curl -D headers.txt` saves them
falseok page page.html --json

Where the request ended up

Give the address you asked for and the one you landed on after redirects (--final-url may be relative). A deep link that ended on a sign-in, consent, error or home page, on a captcha or challenge address, or on a search that lost its words is flagged even when the page itself looks fine. Without them nothing changes.

falseok page page.html --url https://example.com/item/123 --final-url "/login?next=/item/123"   # login_wall

Every page gets one verdict: ok, not_html, challenge, captcha, rate_limited, login_wall, consent_wall, soft_block, soft_404, empty_shell, http_error

The verdicts as text
verdict what it means
ok no block signal found
not_html binary or compressed data, not a page
challenge an anti-bot check page (the vendor is named when the HTML shows it)
captcha a captcha in place of the content
rate_limited "too many requests", or HTTP 429
login_wall you need to sign in to see this
consent_wall a consent page in place of the content
soft_block "access denied", "continue shopping", "something went wrong" served as 200
soft_404 200, but the page says it does not exist
empty_shell empty response, a saved redirect, or a JavaScript app that never rendered
http_error you passed --status 4xx/5xx and no other signal was found

What to do next

Every result also carries an action: keep, render_js (the content needs a browser to appear), retry, backoff (wait, then retry slower; retry_after holds the seconds when the server sent Retry-After), drop, decompress (the body is still packed) or stop (the site refuses this client or wants a person; falseok does not suggest ways around a block). confidence is high, medium or low: a vendor, a response header or the status is sure, a page's wording less so, a guess from the page's shape least. The table and the rules are in docs/verdicts.md.

challenge [Cloudflare]: cf-mitigated-header (header: "cf-mitigated: challenge") -> stop (high confidence)

Adjust the rules

Add your own rules on top of the bundled ones (same JSON format; one with an existing id replaces it), turn rule or signal ids off, or accept a category you expect, such as a login wall when you scrape behind a login:

falseok page page.html --extra-signatures my_rules.json --disable enable-js --allow login_wall
r = check_page(html, signatures=load_signatures(extra_signatures="my_rules.json"), allow_categories=["login_wall"])

Details in docs/signatures.md.

Many pages at once: falseok page pages/*.html --jobs 0 uses every CPU core; the answers and their order are the same as with one. In Python, falseok.check_pages(items, jobs=None) takes html (or dicts of check_page arguments) and returns a list of results in the same order.

results = falseok.check_pages([{"html": body, "status": 200} for body in bodies], jobs=4)

Check data

falseok data today.json --vs yesterday.json

falseok data output: 131 rows instead of 200, 10 duplicates, a block page saved as a row, salary 62% empty

Reads JSON, JSON Lines, CSV and TSV, including what Excel saves on Windows and European semicolon CSVs. Finds lost rows, fields that went empty, disappeared or froze on one value, changed types, duplicates, and block-page text that got parsed as data. Without --vs it checks the file on its own.

In a cron job or CI

Exit code 0 = fine, 1 = something is wrong, 2 = the input could not be read.

falseok data out/today.jsonl --vs out/last_good.jsonl && cp out/today.jsonl out/last_good.jsonl

From Python

import falseok

r = falseok.check_page(html, status=200)   # html can be text or the raw bytes you received
r = falseok.check_page(resp.content, status=resp.status_code, headers=resp.headers)   # headers are optional
r = falseok.check_page(resp.content, url=asked_url, final_url=resp.url)   # where the redirects ended, optional
if not r.ok:
    print(r.verdict, r.reason)   # captcha robot-check-title (title: "Robot Check")
print(r.action, r.confidence, r.retry_after)   # keep / render_js / retry / backoff / drop / decompress / stop
print(r.content_kind, r.canonical_url, r.meta_refresh, r.script_count)   # html / document / data / compressed / binary / empty

report = falseok.compare(rows_today, rows_yesterday)
for issue in report.issues:
    print(issue.kind, issue.message)

How hard we tried to break it

  • A stress suite written to break it: random bytes, 50 MB pages, unclosed tags, every rule's wording hidden in long real pages, Excel CSVs, JSON nested three levels down, a million rows. The first run found 107 failures. All fixed, all still in the suite, which now holds 2,462 tests.
  • 140,000 random inputs from property-based testing. Nothing broke.
  • Five fresh sets of pages from sites it had never seen. Every set that showed misses we then fixed became a working set, so we don't quote it as proof (the 0.2.0 benchmark set is one of them now). The benchmark above is the untouched half of a random sample from the fifth set (40,432 pages), scored with the code frozen.
  • Linux, macOS and Windows, Python 3.10 to 3.14, on every change.

The whole story, failures included: docs/testing.md.

Where the signatures come from

Every rule lives in one file, src/falseok/signatures.json: a pattern, where to look (title, visible text or raw HTML), and the category. They come from block pages our own production scrapers received with 200 OK, and from the live tests above. The test pages in tests/pages are rebuilt from those cases with identifiers removed.

Seen a block page falseok missed? Send one entry in signatures.json and a small cleaned page in tests/pages. That's the whole contribution: docs/contributing.md.

Documentation

Benchmark · How it works · Verdicts · Data checks · Signatures · Testing · Known limits · Contributing

License

MIT. Made by Benchmarked: we measure data tools against the most used alternatives on price, speed and output.

Metadata

Release files for falseok 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for falseok 0.3.0
File Size Uploaded Provenance Actions
falseok-0.3.0.tar.gz 83.9 kB With provenance Details for falseok-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for falseok 0.3.0
File Interpreter ABI Platform Actions
falseok-0.3.0-py3-none-any.whl Python 3 none any Details for falseok-0.3.0-py3-none-any.whl

Total release size: 138.0 kB

Release files / falseok-0.3.0.tar.gz

Download URL falseok-0.3.0.tar.gz
Size 83.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9d236217dc62d58f5a0a16b927d460d6172432e8b9bebad24bea9f7dbfcdfcb3
BLAKE2b-256 checksum
How to use checksums
efb4723e7d51d6d1b693459e4293bd24cce437b5148ce51076e0676f922eaae7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Release files / falseok-0.3.0-py3-none-any.whl

Download URL falseok-0.3.0-py3-none-any.whl
Size 54.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a365068ddc53ea15c07e7861ad1137f73cac7de5bd5aa489c80a43910cbceda
BLAKE2b-256 checksum
How to use checksums
cbd957845f87d480c85b2a888caf68bb35cd86eb327c0f9f9af2297de5b1f26d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Security for falseok 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for falseok-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page