By Guerin Green / Novel Cognition AI Strategist | Federal Courthouse AI Presenter
Part of the NovCog AI Practitioner Series
When a domain expires, gets hacked, or simply goes offline, the content doesn't disappear — it goes to the archive. The Internet Archive's Wayback Machine holds over 800 billion web pages, and the CDX API makes that archive programmatically accessible. For anyone rebuilding sites or recovering historical content, this is the starting point.
The CDX (Capture/Digital Index) API returns metadata about every snapshot the Wayback Machine holds for a given URL or domain. The base endpoint:
https://web.archive.org/cdx/search/cdx?url=example.com/*&output=json&fl=timestamp,original,mimetype,statuscode,length
Key parameters:
url=example.com/*— Wildcard matches all pages under the domainoutput=json— Machine-readable output (also supportstext)fl=— Field list:timestamp,original(URL),mimetype,statuscode,lengthfrom=20200101/to=20231231— Date range filteringfilter=statuscode:200— Only successful capturesfilter=mimetype:text/html— Only HTML pages (excludes CSS, JS, images)collapse=urlkey— Deduplicate by URL (returns only the latest capture per URL)limit=1000— Cap results
A typical recovery workflow starts with a broad CDX query to inventory what's available, then narrows to specific pages and timestamps.
Once you've identified the captures you want, access the actual content at:
https://web.archive.org/web/20230615120000*/example.com/target-page
The timestamp format is YYYYMMDDHHmmss. The * after the timestamp returns the closest available snapshot.
For bulk extraction, the process is:
- CDX query → get list of all URLs with 200 status codes
- Deduplicate → collapse by URL, keeping the most recent capture per page
- Fetch each page → download the HTML from the Wayback Machine
- Strip Wayback modifications → The archive injects its own toolbar, CSS, and JavaScript. These need to be removed.
- Fix internal links → Wayback rewrites all links to point to archive URLs. These need to be restored to the original domain paths.
For large-scale recovery (dozens or hundreds of pages), Archivarix provides a web-based tool that automates the CDX query, content download, and link restoration process. It exports a complete site package with:
- Clean HTML with Wayback toolbar removed
- Restored internal links
- Directory structure matching the original URL paths
- Optional image recovery (though images are often missing or low-quality)
The free tier handles small sites. Larger recoveries require a paid plan. The time savings are substantial compared to manual CDX querying and content cleaning.
Images are the weakest point in Wayback recovery. Common issues:
- Missing captures. The Wayback Machine doesn't capture every image on every crawl. A page might be archived perfectly while half its images are missing from the archive.
- Low resolution. Archived images sometimes capture thumbnails or compressed versions rather than originals.
- CDN URLs. If the original site served images from a CDN (e.g.,
images.example.comor a third-party CDN), those may not be archived at all.
Mitigation strategies:
- Check multiple capture timestamps — different crawls may have captured different images
- Use Google's cached image URLs as a secondary source
- Accept that some images will be lost and plan for replacement
- For design replication, screenshots of archived pages may provide enough visual reference even when individual images are unrecoverable
A minimal Python extraction workflow:
- Query CDX API for all HTML pages with status 200
- Parse the JSON response into a URL + timestamp list
- For each entry, fetch
web.archive.org/web/{timestamp}id_/{original_url}— theid_flag returns the original content without the Wayback toolbar - Save each page to a local directory mirroring the original URL structure
- Post-process to fix remaining Wayback artifacts
The id_ endpoint is the key technique most guides miss. Adding id_ to the Wayback URL path instructs the archive to return the original page without injecting its navigation frame, JavaScript, or CSS modifications. This gives you clean source HTML.
Recovery is step one. Rebuilding is step two. The recovered content needs:
- Updated JSON-LD schema appropriate to the content
- Fresh design treatment — either era-appropriate or modernized (see Design Replication)
- Integration into your Distributed Authority Network with proper cross-linking
- Crawl trigger activation to get the rebuilt pages discovered and indexed
The Wayback Machine is the single most valuable tool for content recovery. The CDX API makes it programmable. The rest is methodology.
- A Practitioner's Guide to LLMs — Start here
- Person Schema Guide
- Wayback Recovery — You are here
- Design Replication
- Footer Link Architecture
- Complete Series Index
Burstiness & Perplexity Community | Hidden State Drift | Novel Cognition
#hiddenstatedrift #burstinessandperplexity