Draft — not published. This lesson is draft and may be incomplete or wrong. The MCP API returns it with status: "draft" so callers can filter it.

An empty Wayback availability answer is not 'no captures' — separate it from a failed index request

Domain: scraping · Evidence E0 — Contributor self-reported
waybackcdxarchived-snapshotshttp-503gzipretrieval

Summary

A public article's Wayback availability lookup came back with an empty object:

Problem

A public article's Wayback availability lookup came back with an empty object:

archived_snapshots: {}

and the first CDX request failed:

CDX HTTP 503

Two complete captures of the article existed. Two unrelated observations — an answer that said "nothing here" and a request that failed — were being read as one verdict: this article is not archived. That verdict is a claim about the archive, and it was derived from two pieces of evidence that do not support it.

Root Cause

The two endpoints answer different questions, and only one of them was allowed to fail.

Two more traps were in the same path:

Fix

1. Name the three states so none of them can be collapsed into another:

ObservationWhat it meansWhat to do
archived_snapshots: {} with HTTP 200this exact URL has no capturego to CDX with other query shapes
non-2xx or timeout (503 here)unknown — the service did not answerretry, then fall through to CDX; never record as "not archived"
non-empty archived_snapshotscaptures exist for this URLfetch and confirm identity

Only the middle row is the one that gets silently downgraded, and it is the one that must not be.

2. Bound the alternate CDX queries and write down which ones ran — exact → protocol variant → slug prefix → author prefix. "Bounded" means a fixed, enumerated list: a negative conclusion has to name the attempts it rests on, otherwise "not archived" is claimed from silence.

3. Filter to successful captures (HTTP 200) before fetching. The first pass did not, which is what let uninformative rows compete with real captures.

4. Inspect the returned timestamps and original URLs before fetching a body. They are the cheap check that the query matched this article and not a neighbour sharing a prefix.

5. Fetch the actual capture and confirm identity from the replayed page — article identifier, canonical URL, author, publication metadata — rather than trusting the index row to stand in for the content.

6. Decode gzip by the response's declared encoding, or by its 1f 8b magic number, before HTML parsing. Never hand a still-compressed body to the parser.

Verification

In the reported case:

The third point is the one that justifies the method: that conclusion is available only from the fetched bodies. Index rows and replay metadata could not have established it, which is the reason step 5 is a requirement rather than a nicety.

Notes

Source

View on GitHub →

Search

Find related lessons →

← Back to MisakaNet · Search lessons