Skip to content
OSINTblogs

Wayback Machine for OSINT: the CDX API and advanced techniques

The Wayback Machine holds far more than its calendar view shows. How to list every archived address for a site with the CDX API, filter by date, type and status, fetch raw original pages, find deleted pages and subdomains, track changes over time and use other archives.

· 7 min read

Most people use the Wayback Machine by pasting in an address and clicking a date on a calendar. That shows a small part of what the Internet Archive holds. Behind the calendar is an index of every address it has ever captured, searchable by pattern, date, file type and response code, and available through a free interface that needs no key.

This guide covers the queries that turn the archive from a way to look at one old page into a way to research a whole site's history.

How the archive is organised

Each capture is a stored copy of one address at one moment. It is identified by a 14-digit timestamp in UTC, in the form year, month, day, hour, minute, second, followed by the original address:

https://web.archive.org/web/20210315142233/https://example.com/about

Two things follow from that structure. First, a "page" as you see it is assembled from many captures. The HTML, each image and each script were captured separately, possibly months apart, and the archive stitches together the nearest ones. Second, you can ask for a capture near any time by editing the timestamp, and the archive redirects to the closest one it has.

Wildcards in the browser

Before the API, two address patterns are worth knowing:

https://web.archive.org/web/*/example.com/*
https://web.archive.org/web/2020*/example.com/staff*

The first lists every archived address under a domain, in a filterable table. The second restricts to captures from 2020 and to paths beginning /staff. The filter box on the results page narrows by text, which is the quickest way to find PDFs, old staff pages or a login panel.

The CDX API

The CDX server is the index itself. A query returns one line per capture.

# Every unique address ever captured under a domain
curl -s "https://web.archive.org/cdx/search/cdx?url=example.com/*&fl=original&collapse=urlkey" | sort -u

# Captures with details, as JSON
curl -s "https://web.archive.org/cdx/search/cdx?url=example.com/*&output=json&fl=timestamp,original,statuscode,mimetype,digest&limit=50"

The parameters that matter:

Parameter

Effect

Example

url

Address or pattern. A trailing /* matches everything beneath

url=example.com/blog/*

matchType

exact, prefix, host or domain. domain includes subdomains

matchType=domain

from, to

Date range, as partial timestamps

from=2019&to=202106

filter

Keep rows where a field matches. Prefix with ! to exclude

filter=statuscode:200

collapse

Drop adjacent rows with the same value in a field

collapse=digest

fl

Fields to return

fl=timestamp,original

limit

Maximum rows. A negative number returns the most recent

limit=-20

output

json for a JSON array

output=json

digest is a hash of the captured content. Two captures with the same digest are byte-for-byte identical, which is the basis for detecting change.

Large sites return millions of rows, so always set a limit or a filter while exploring. Be considerate: the service is run by a non-profit, and heavy automated use is rate-limited.

Recipes

Find every subdomain the archive has seen

curl -s "https://web.archive.org/cdx/search/cdx?url=example.com&matchType=domain&fl=original&collapse=urlkey" | awk -F/ '{print $3}' | sed 's/:.*//' | sort -u

This lists host names, including test, staging and retired systems that no longer resolve. It complements certificate logs and DNS methods in our guide to investigating a domain.

Find documents

curl -s "https://web.archive.org/cdx/search/cdx?url=example.com/*&filter=mimetype:application/pdf&fl=timestamp,original&collapse=urlkey"

Swap the type for spreadsheets, word-processor files or archives. Documents removed from the live site are often still retrievable, with their metadata intact. See document metadata.

See when a page changed

curl -s "https://web.archive.org/cdx/search/cdx?url=example.com/about&fl=timestamp,digest,statuscode&collapse=digest"

Collapsing on digest leaves one row for each distinct version. The timestamps are the first capture of each version, so they bracket when each change happened. The archive's built-in Changes view then highlights the differences between any two captures.

Find when a page appeared and disappeared

# First capture
curl -s "https://web.archive.org/cdx/search/cdx?url=example.com/team/jane-doe&fl=timestamp,statuscode&limit=1"

# Last few captures
curl -s "https://web.archive.org/cdx/search/cdx?url=example.com/team/jane-doe&fl=timestamp,statuscode&limit=-5"

A run of 200 responses followed by 404 or a redirect brackets the removal date.

Check quickly whether anything exists

curl -s "https://archive.org/wayback/available?url=example.com&timestamp=20200101"

The availability endpoint returns the closest capture to a date, or nothing.

Fetch the original, not the replay

The normal view rewrites links and adds a toolbar. For analysis you usually want the page as it was served. Add a modifier after the timestamp:

https://web.archive.org/web/20210315142233id_/https://example.com/about
  • id_ returns the original content, unmodified.

  • if_ returns the replayed page without the toolbar.

Use id_ when hashing a capture, extracting metadata from a document, or searching source code for identifiers. A typical use is recovering tracking codes a site used years ago:

curl -s "https://web.archive.org/web/2018id_/https://example.com/" | grep -oE "UA-[0-9]+-[0-9]+" | sort -u

Old analytics IDs link a site to others run by the same people at the time. See finding related websites.

What to look for in a site's history

  • Earlier ownership. Old "About", "Contact" and legal pages with names, addresses, phone numbers and company numbers since removed.

  • Former staff. Team pages before people left or were deleted.

  • A different business. A domain that sold shoes until last year and now offers investments.

  • Changed claims. Founding dates, client lists, accreditations and prices that have shifted.

  • Removed statements. Press releases, blog posts and terms that were quietly withdrawn.

  • robots.txt history. Paths a site asked crawlers to avoid are a list of what it considered sensitive.

  • Old technology. Scripts, tracking codes, embedded email addresses and comments in source.

  • Gaps. A domain with captures from 2012 to 2016, nothing until 2024, then a new site, was probably dropped and re-registered by someone else.

Limits to keep in mind

  • Coverage is uneven. Popular sites are captured daily. Small ones may have three captures in ten years. Absence from the archive does not mean a page did not exist.

  • Capture time is not publication time. A page first captured in March may have been published in January.

  • Composite pages. An image shown in a 2019 capture may have been captured in 2021. Check the timestamps of individual elements before making a claim about how a page looked on a date.

  • Dynamic content loaded by scripts, behind logins or after scrolling is often missing.

  • Removals. Site owners can ask for exclusion, and captures then become unavailable, sometimes for the whole domain.

  • Redirects and soft errors. A capture may be of an error page served with a success code. Open it and look.

  • Times are UTC.

For anything you will rely on, save your own copy of the capture and record its full address with the timestamp. See preserving web evidence.

Saving pages yourself

Submit an address at https://web.archive.org/save/ followed by the address, or use the Save Page Now form, which with a free account can also capture the pages it links to. Remember that this creates a public, permanent record and reveals that someone wanted one. See OPSEC for OSINT.

Other archives

No archive has everything, and they fail in different ways.

Archive

Notes

archive.today

Captures on request. Stores a rendered snapshot and screenshot. Handles some script-heavy pages well. Not removable by robots.txt

Common Crawl

Monthly crawls of billions of pages, with a public index queryable by address pattern. Useful as a second opinion on whether a page existed

National web archives

The UK Web Archive, Arquivo.pt in Portugal, and national libraries elsewhere hold deep collections of their own country's sites, some viewable only on site

Search engine caches

Google retired its public cache in 2024. Bing shows cached copies for some results

Archive-It

Curated collections kept by universities, governments and libraries

A memento aggregator, such as the Time Travel service, searches many archives at once for a given address and date.

A worked example

A company claims on its website to have been "trading since 2009".

  1. The CDX query for the domain's home page shows the first capture in 2011, with a different company's name in the title.

  2. Collapsing on digest shows that site unchanged until 2017, then no successful captures until 2023.

  3. The 2023 capture is the current business. Its "About" page then said "founded in 2022". A later version, first captured eight months on, says "trading since 2009".

  4. Registration data shows the domain was re-registered in 2022.

The finding: the domain has existed since at least 2011 under a different owner, the present business appears from 2023, and its claimed history changed between two archived versions. Each step is a dated capture that a reader can open.

Frequently asked questions

How do I see all archived pages of a website?

Open web.archive.org/web/*/example.com/* in a browser, or query the CDX API with url=example.com/* and collapse=urlkey for a full list.

What is the Wayback Machine CDX API?

A free interface to the archive's index. It returns a list of captures for an address or pattern, with timestamps, response codes, content types and content hashes.

Can I find deleted web pages?

If they were captured before deletion, yes. List the site's archived addresses and look for ones that now return an error on the live site.

How accurate are Wayback Machine dates?

The capture timestamp is exact, in UTC. It records when the archive fetched the page, not when the page was published, and parts of a displayed page may come from different dates.

Is there an alternative to the Wayback Machine?

Yes. archive.today, Common Crawl and national web archives hold captures the Wayback Machine lacks. Check more than one.

More from Dheeraj Yadav

Report this post