# Wayback Machine Scraper: Snapshot History & Archived URLs (`kayorama/wayback-machine-snapshot-history`) Actor

List every Wayback Machine capture of a URL or all archived URLs of a domain via the official CDX API. Dates, status, content changes, archive links, summary per site and only-new mode for schedules.

- **URL**: https://apify.com/kayorama/wayback-machine-snapshot-history.md
- **Developed by:** [Kayorama](https://apify.com/kayorama) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 snapshot or archived urls

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Wayback Machine Scraper: Snapshot History & Archived URLs

See how any web page looked over time, when it changed, and which pages a site used to have. This Actor reads the Internet Archive's official Wayback Machine CDX API and gives you clean rows with capture dates, HTTP status, content type, a content hash and ready-to-open archive links.

Two modes:

- **Capture history.** Every snapshot of a URL (or one per day, month or year, or one per real content change), newest first, with a `contentChanged` flag.
- **Archived URLs on a site.** Every distinct URL the archive holds for a domain, subdomain or path, with its first capture date. Broken links and tracking-parameter copies are skipped.

Each input also gets a summary row: total captures, first and last capture (including the first capture ever), unique content versions, status codes and captures per year.

### What you can use it for

- **Domain due diligence.** Check how old a site really is, how often it was online and what it used to be before you buy a domain or a website.
- **SEO and site migrations.** List old URLs from the archive, then redirect the ones that still get links. Recover pages lost in a redesign.
- **Competitor tracking.** Follow a competitor's pricing or product page. With content-change collapse and only-new mode, a scheduled run outputs only captures where the page actually changed.
- **Research and evidence.** Get exact capture timestamps and links to archived copies for reports, legal notes or journalism.
- **Content recovery.** `rawArchiveUrl` points at the original archived file without the Wayback toolbar, ready to download.

### Input examples

#### Monthly history of a homepage (the default)

```json
{ "urls": ["apify.com"] }
```

#### Only real content changes of a pricing page since 2025

```json
{
  "urls": ["https://github.com/pricing"],
  "collapse": "digest",
  "from": "2025-01-01",
  "onlyStatus200": true,
  "maxResultsPerTarget": 500
}
```

#### All archived blog URLs of a site

```json
{
  "urls": ["example.com/blog/*"],
  "mode": "archivedUrls",
  "onlyStatus200": true,
  "mimeType": "text/html",
  "maxResultsPerTarget": 5000
}
```

Use `*.example.com` for the domain and all subdomains, or `example.com/path/*` for everything under a path.

#### Daily monitor: only new captures where the page changed

```json
{
  "urls": ["https://competitor.com/pricing", "https://competitor.com/features"],
  "collapse": "digest",
  "trackChanges": true,
  "outputMode": "onlyNew",
  "stateStoreName": "competitor-pages"
}
```

Schedule it daily and send the dataset to Slack, email, Google Sheets, Make or Zapier with Apify integrations.

### Output

#### Snapshot rows (`type: "snapshot"`)

| Field | What it holds |
| --- | --- |
| `target` | The input this row belongs to |
| `url` | The URL as it was captured |
| `timestamp`, `capturedAt` | Wayback timestamp (`20261104105845`) and the same moment in ISO 8601 UTC |
| `statusCode`, `mimeType` | HTTP status and content type the archive saw |
| `digest`, `lengthBytes` | Content hash (SHA-1) and stored size |
| `contentChanged` | `true` when the content hash differs from the previous row for the same URL |
| `isNew` | `true` when the capture is newer than the last run (with Remember what was seen) |
| `archiveUrl` | Archived page in the Wayback Machine |
| `rawArchiveUrl` | Original archived file without the Wayback toolbar |

```json
{
  "type": "snapshot",
  "target": "apify.com",
  "url": "https://apify.com/",
  "timestamp": "20261104105845",
  "capturedAt": "2026-11-04T10:58:45.000Z",
  "statusCode": 200,
  "mimeType": "text/html",
  "digest": "BBMLY4D4RM52PGNNWBFVOSOO2QCBZUTM",
  "lengthBytes": 87934,
  "contentChanged": true,
  "isNew": null,
  "archiveUrl": "https://web.archive.org/web/20261104105845/https://apify.com/",
  "rawArchiveUrl": "https://web.archive.org/web/20261104105845id_/https://apify.com/"
}
```

#### Archived URL rows (`type: "archivedUrl"`)

`url`, `timestamp` and `capturedAt` of the first capture, `statusCode`, `mimeType`, `isNew` and `archiveUrl`.

#### Summary rows (`type: "summary"`)

| Field | What it holds |
| --- | --- |
| `capturesFound`, `rowsOutput`, `moreAvailable` | Captures matching your filters, rows written, and whether there are more than the row limit |
| `firstCapturedAt`, `lastCapturedAt` | First and last capture in your filtered set |
| `firstEverCapturedAt`, `lastEverCapturedAt` | First and last capture of the exact URL across all time |
| `daysSinceLastCapture` | How fresh the archive is for this URL |
| `uniqueContentVersions`, `uniqueUrls` | Distinct content hashes and URLs |
| `statusCodeCounts`, `capturesPerYear` | Counts by status code and by year |
| `newCaptures`, `firstRun` | Monitoring counts |
| `junkUrlsSkipped` | Broken or tracking-parameter URLs left out (archived URL mode) |
| `errorCode`, `error` | `BLOCKED_BY_ARCHIVE`, `BAD_QUERY`, `RATE_LIMITED`, `TIMEOUT`, `HTTP_503` and similar |

The dataset has two views: **Snapshots** and **Summary per URL**.

### Input reference

| Field | Default | Notes |
| --- | --- | --- |
| `urls` | `apify.com` | URLs, domains, `example.com/path/*` or `*.example.com` |
| `mode` | `snapshots` | `snapshots` or `archivedUrls` |
| `matchType` | exact (snapshots), domain (archived URLs) | `exact`, `prefix`, `host` or `domain` |
| `collapse` | `month` | `none`, `digest` (content change), `hour`, `day`, `month`, `year` |
| `order` | `newestFirst` | or `oldestFirst` |
| `maxResultsPerTarget` | 100 | Rows per input, up to 100,000 |
| `from`, `to` | none | `2020`, `2023-06` or `2023-06-01` |
| `onlyStatus200` | false | Skip redirects and errors |
| `mimeType` | none | For example `text/html` or `application/pdf` |
| `skipJunkUrls` | true | Archived URL mode |
| `includeArchiveRange` | true | First and last capture ever in the summary |
| `includeSummary` | true | Summary row per input |
| `trackChanges`, `outputMode`, `stateStoreName` | off, `all`, `wayback-history-state` | Monitoring between runs |
| `requestDelayMs` | 2500 | Pause between requests to the archive, 1000 minimum |

### Pricing

Pay per event, no start fee:

- **Snapshot**: $0.0004 per snapshot or archived URL row.
- **URL checked**: $0.001 per input looked up successfully.

Summary rows and failed lookups are free. Example: the monthly history of 100 domains (about 100 rows each) costs about $4.10.

### Good to know

- **Official API, polite pace.** The Actor only calls the public CDX API at web.archive.org, identifies itself as `WaybackHistoryBot`, waits 2.5 seconds between requests by default and backs off on 429 and 5xx answers. No proxies, no logins.
- **Big domains are slow on the archive side.** Domain-wide queries on very large sites can take minutes or time out. Use a path prefix like `example.com/blog/*` or a date range to narrow them.
- **Collapse and monitoring.** Month or year collapse keeps the first capture of each period. For change alerts use `digest` (content change) or `none`.
- **Excluded sites.** Some owners ask the archive to hide their site. Those inputs return `BLOCKED_BY_ARCHIVE` and are not charged.
- **No page content is downloaded.** You get metadata and links. Open `rawArchiveUrl` to fetch the archived file itself.

### FAQ

**How far back does it go?**
As far as the Wayback Machine does, back to 1996 for some sites. `firstEverCapturedAt` shows the oldest capture.

**Why are there fewer rows than captures?**
`collapse` thins the history (month by default) and `maxResultsPerTarget` caps rows. Set collapse to `none` and raise the limit to get every capture.

**Can I check if a domain existed before I buy it?**
Yes. Run capture history with `collapse: "year"` and look at `firstEverCapturedAt`, `capturesPerYear` and the archive links.

**Is this affiliated with the Internet Archive?**
No. It uses their public API. Please consider supporting the Internet Archive if you rely on it.

# Actor input Schema

## `urls` (type: `array`):

Pages or sites to look up in the Wayback Machine, for example apify.com, https://example.com/pricing, example.com/blog/\* (everything under a path) or \*.example.com (all subdomains).

## `mode` (type: `string`):

Capture history lists each archived snapshot of the URL. Archived URLs lists every distinct URL the archive holds under a domain or path, with its first capture.

## `matchType` (type: `string`):

Exact URL only, every URL that starts with it (prefix), the host, or the host plus all subdomains (domain). Capture history defaults to exact, archived URLs to domain.

## `collapse` (type: `string`):

Thin out the history. Month keeps the first capture of each month. Content change keeps a capture only when the page content differs from the one before it. Capture history only.

## `order` (type: `string`):

Newest captures first or oldest first. Capture history only.

## `maxResultsPerTarget` (type: `integer`):

Most snapshot or archived URL rows to output for each input.

## `from` (type: `string`):

Only captures on or after this date, for example 2020 or 2023-06-01.

## `to` (type: `string`):

Only captures on or before this date, for example 2024-12-31.

## `onlyStatus200` (type: `boolean`):

Skip captures of redirects, errors and missing pages.

## `mimeType` (type: `string`):

Only captures of this type, for example text/html or application/pdf.

## `skipJunkUrls` (type: `boolean`):

Archived URLs only. The archive also stores broken links found inside scripts and text (stray quotes, HTML, escaped newlines) and copies of pages that only differ by tracking parameters such as utm_source. Skip them so you get real pages.

## `includeArchiveRange` (type: `boolean`):

For exact URLs, the summary row also shows the very first and very last capture, even when you filter by date. Costs two extra requests per URL.

## `includeSummary` (type: `boolean`):

One row per input with capture counts, first and last capture, unique content versions, status codes and captures per year.

## `trackChanges` (type: `boolean`):

Save the latest capture (or the archived URLs) per input in a named key-value store, so the next run can mark new rows with isNew.

## `outputMode` (type: `string`):

All rows, or only captures and URLs that are new since the last run (needs Remember what was seen). For page change alerts use Content change in One capture per.

## `stateStoreName` (type: `string`):

Name of the key-value store that keeps the memory between runs. Use one name per monitor.

## `requestDelayMs` (type: `integer`):

Pause between requests to the Internet Archive. 1000 is the minimum, so we stay well inside its rate limits.

## Actor input object example

```json
{
  "urls": [
    "apify.com"
  ],
  "mode": "snapshots",
  "collapse": "month",
  "order": "newestFirst",
  "maxResultsPerTarget": 100,
  "onlyStatus200": false,
  "skipJunkUrls": true,
  "includeArchiveRange": true,
  "includeSummary": true,
  "trackChanges": false,
  "outputMode": "all",
  "stateStoreName": "wayback-history-state",
  "requestDelayMs": 2500
}
```

# Actor output Schema

## `snapshots` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kayorama/wayback-machine-snapshot-history").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["apify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("kayorama/wayback-machine-snapshot-history").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "apify.com"
  ]
}' |
apify call kayorama/wayback-machine-snapshot-history --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kayorama/wayback-machine-snapshot-history"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7LzDEBHyDfkhEXIFK/builds/K0GO60IkPfpgy2PaB/openapi.json
