# Wayback Machine Scraper – Snapshots and History (`martinvarelaa/wayback-machine-snapshots`) Actor

Wayback Machine snapshots for any URL or domain with no 10,000-row cap, at $2 per 1,000. Closest capture to a date, a one-row domain history, and archived text when you ask.

- **URL**: https://apify.com/martinvarelaa/wayback-machine-snapshots.md
- **Developed by:** [Martin Varela](https://apify.com/martinvarelaa) (community)
- **Categories:** SEO tools, Developer tools, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 snapshots

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

Wayback Machine snapshots for any URL or domain at $2 per 1,000, with no 10,000-row cap. Find the capture closest to a date, get one row that says when a site first and last appeared, or download the archived text when you ask for it.

### Who it is for

- **SEO and migration teams** recovering old URLs, titles and redirects after a site move.
- **Researchers, lawyers and journalists** who need to show what a page said on a given date.
- **Competitor monitoring**: a daily schedule that returns only the captures added since the previous run.
- **AI agents** that need a page as it was, not as it is now.

### What you get

- Snapshot time, original URL, HTTP status, MIME type, content digest, and a direct archive link.
- Rows past the usual 10,000 capture cap. A wide query that times out is split by year and continued.
- The capture closest to a date, for "what did this page say then?".
- One domain-history row: first and last capture, years with snapshots, missing years, and the longest gap.
- Archived text, Markdown, or HTML only when you turn on Fetch archived page content. The archive toolbar is removed and each downloaded page is charged on its own.

### Sample output

A real row from the daily check on example.com:

```json
{
  "type": "snapshot",
  "target": "https://example.com",
  "originalUrl": "http://example.com:80/",
  "timestamp": "20020120142510",
  "archivedAt": "2002-01-20T14:25:10Z",
  "statusCode": 200,
  "mimeType": "text/html",
  "digest": "HT2DYGA5UKZCPBSFVCV3JOBXGW2G5UUA",
  "changed": false,
  "snapshotUrl": "https://web.archive.org/web/20020120142510/http://example.com:80/"
}
```

A URL with no captures returns one `empty` row and the run still succeeds. That row is free. A domain history is a `domain-summary` row.

### How to use

1. Paste one URL. Leave the defaults: exact match, one capture per year, 10 rows.
2. For a legal date, switch the mode to closest snapshot and set the date, for example 2015-01-01.
3. For a daily schedule, turn on "Only snapshots since the previous run". Each run then asks only for captures after the last one this Actor already returned for the same targets and filters.

```json
{
  "targets": ["https://example.com"],
  "maxSnapshots": 10
}
```

### Input

| Field | Default | What it does |
|---|---|---|
| Mode | List snapshots | List, closest date, or one history row per domain. |
| URLs or domains | https://example.com | One URL or domain per line. |
| Match type | Exact URL | Exact, prefix, host, or domain including subdomains. |
| Collapse duplicates | One per year | Digest keeps a row only when the content hash changes. |
| Maximum snapshots | 10 | No hidden 10,000 cap. Raise it when you need the full history. |
| Fetch archived page content | off | Downloads the page. Charged separately. |
| Only snapshots since the previous run | off | Use this on a schedule. |

### Pricing

You pay for rows that come back, not for an empty site.

| You get | You pay |
|---|---|
| 10 snapshots | $0.02 |
| Those 10 with archived text | $0.07 |
| 1 domain history | $0.005 |
| 1,000 snapshots | $2.00 |

| Event | Free | Bronze | Silver | Gold, Platinum, Diamond |
|---|---|---|---|---|
| Snapshot | $0.002 | $0.0018 | $0.0016 | $0.0014 |
| Archived page | $0.005 | $0.0045 | $0.004 | $0.0035 |
| Domain history | $0.005 | $0.0045 | $0.004 | $0.0035 |

A run stops when it hits the maximum charge you set, and the rows already delivered stay in the dataset.

### Use with AI agents (MCP)

The input is a short list of URLs and a mode. The dataset is one record per snapshot, or one domain summary. Call `martinvarelaa/wayback-machine-snapshots` from the Apify MCP server. Leave page download off unless the agent needs the words on the page. Turn on "since the previous run" when the agent checks the same URL every day.

### Use via API

```bash
curl -X POST "https://api.apify.com/v2/acts/martinvarelaa~wayback-machine-snapshots/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"targets":["https://example.com"],"maxSnapshots":10}'
```

### FAQ

#### Why is the default run so small?

The default is one URL, ten yearly captures, and no page download, so a first try costs about $0.02. Domain-wide history and page downloads are opt-in because they are slower.

#### Is there a 10,000 snapshot limit?

No. Wide queries are split by year and continued, so you can raise Maximum snapshots to the full history of a domain.

#### What happens if a site was never archived?

You get one free `empty` row and a successful run. If archive.org answers for none of your targets, the run fails, so you never get a silent empty success.

#### Does it return personal data?

This Actor does not add emails, phone numbers, or account names. Usernames and passwords embedded in an old URL are removed before the row is saved. Archived pages keep their original copyright.

### Other actors

- [Sitemap URL Extractor](https://apify.com/martinvarelaa/sitemap-url-extractor) lists every URL in a sitemap.xml file.
- [SEO Page Audit](https://apify.com/martinvarelaa/seo-page-audit) scores pages and checks sitemap URLs and AI-crawler rules.
- [Clutch.co Scraper](https://apify.com/martinvarelaa/clutch-agency-scraper) builds agency lead lists with rates, team size and published contacts.

### Changelog

- 0.1: snapshots with no 10,000-row cap, closest capture to a date, one-row domain history, optional archived text and incremental daily runs.

# Changelog

This Actor's version history is a separate document: https://apify.com/martinvarelaa/wayback-machine-snapshots/changelog.md

# Actor input Schema

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

List snapshots, the capture closest to a date, or one history row per domain.

## `targets` (type: `array`):

One URL or domain per line, for example https://example.com or example.com/pricing.

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

Exact URL is the reliable default. Domain-wide lists often time out at archive.org; use Domain history summary for a whole site.

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

First day to include. YYYY, YYYY-MM, or YYYY-MM-DD. Example: 2015-01-01.

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

Last day to include. YYYY, YYYY-MM, or YYYY-MM-DD. Example: 2015-12-31.

## `closestTo` (type: `string`):

Used in closest mode. Example: 2015-01-01.

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

Year keeps the default run short. Digest keeps a row only when the archived content changed.

## `statusFilter` (type: `string`):

200 keeps successful captures. 3xx and 4xx use the CDX status prefix.

## `mimeFilter` (type: `string`):

Example: text/html. Leave empty to keep every MIME type.

## `maxSnapshots` (type: `integer`):

Stop after this many snapshot rows. There is no hidden 10,000 cap.

## `fetchContent` (type: `boolean`):

Download the archived page and return text, Markdown, or HTML. Charged per downloaded page.

## `contentFormat` (type: `string`):

Used only when Fetch archived page content is on.

## `maxContentPages` (type: `integer`):

Cap on archived pages downloaded in the run, even if Maximum snapshots is higher.

## `onlyChanged` (type: `boolean`):

Keep the first capture of each URL and later captures whose content digest changed.

## `includeSnapshots` (type: `boolean`):

In domain history mode, also return snapshot rows. Those rows are charged separately.

## `sinceLastRun` (type: `boolean`):

On a daily schedule, continue after the last snapshot already returned for the same targets and filters.

## Actor input object example

```json
{
  "mode": "list-snapshots",
  "targets": [
    "https://example.com"
  ],
  "matchType": "exact",
  "collapse": "year",
  "statusFilter": "200",
  "mimeFilter": "text/html",
  "maxSnapshots": 10,
  "fetchContent": false,
  "contentFormat": "text",
  "maxContentPages": 10,
  "onlyChanged": false,
  "includeSnapshots": false,
  "sinceLastRun": false
}
```

# Actor output Schema

## `rows` (type: `string`):

One row per snapshot, empty target, error, or domain summary.

## `runStats` (type: `string`):

Estimated platform cost, revenue and Diamond margin.

# 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 = {
    "targets": [
        "https://example.com"
    ],
    "maxSnapshots": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("martinvarelaa/wayback-machine-snapshots").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 = {
    "targets": ["https://example.com"],
    "maxSnapshots": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("martinvarelaa/wayback-machine-snapshots").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 '{
  "targets": [
    "https://example.com"
  ],
  "maxSnapshots": 10
}' |
apify call martinvarelaa/wayback-machine-snapshots --silent --output-dataset

```

## MCP server setup

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

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/90TCbwzs1xUpfrCp3/builds/9lVU5WUy4Qz6FvdWc/openapi.json
