# Wayback Machine Scraper: Snapshot History & Archive Dates (`techliondev/wayback-machine-scraper`) Actor

List Wayback Machine snapshots for any URL or domain: capture dates, status codes, file types and archive links. Closest capture to a date and first/last capture. No login.

- **URL**: https://apify.com/techliondev/wayback-machine-scraper.md
- **Developed by:** [TechLion Dev](https://apify.com/techliondev) (community)
- **Categories:** Developer tools, SEO 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.20 / 1,000 snapshot saveds

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

### 🕰️ What is Wayback Machine Scraper?

**Wayback Machine Scraper** lists the **archived snapshots of any web page or domain** kept by the Internet Archive's Wayback Machine (archive.org). For every capture you get the date, the HTTP status code, the file type, a content fingerprint and a ready-to-open archive link. It uses the Archive's official public CDX (capture index) and availability endpoints with plain HTTP: no browser, no login and no proxy.

It is for SEO (search engine optimization) specialists, domain investors, journalists and researchers, lawyers collecting evidence of past web content, brand and competitor analysts, and AI (artificial intelligence) agents that need the history of a website.

- **See how a site changed:** one capture per month or year, or only captures where the content really changed.
- **Check a domain's past:** first capture, last capture and every year that has captures (great before buying an expired domain).
- **Find lost pages:** list every archived URL under a domain or path, then open the archive link for each.
- **Prove what a page said on a date:** get the capture closest to any date you choose.

#### What data does it extract?

| | |
| --- | --- |
| 🔗 Archived page address and your query | 📅 Capture date and time (UTC) and year |
| 🚦 HTTP status code (200, 301, 404...) | 📄 File type (HTML, PDF, image...) |
| 🔑 Content fingerprint (same value = same content) | 📦 Archived size in bytes |
| 👁️ Link to view the capture | 🧾 Link to the raw capture without the archive toolbar |

#### Three modes

- **Snapshots:** one row per capture, with filters and a maximum per URL.
- **Closest:** one row per URL and date, the capture nearest to that date.
- **Summary:** one row per URL with first capture, last capture and the years that have captures.

#### Why this scraper?

- **Cheap and simple:** $0.30 per 1,000 rows, plus a tiny start fee. Filters are free.
- **Official endpoints:** the same public index the Archive documents. It reads politely at about one request per second and backs off automatically when the Archive asks it to slow down.
- **Many URLs per run:** domain, host or path-prefix matching covers whole sites.
- **Control your cost:** a maximum per URL, and the Actor stops cleanly at your maximum cost per run.

### ⬇️ Input

- **URLs or domains:** one per line, such as `example.com` or `example.com/pricing`. Empty runs a sample for example.com.
- **Mode:** Snapshots, Closest or Summary.
- **Match type:** Exact URL, Prefix (everything under a path), Host, or Domain (including subdomains).
- **From date / To date:** limit the period (`2020`, `2020-06` or `2020-06-15`).
- **Status codes / File types:** for example `200`, or `text/html`.
- **Collapse near-duplicates:** keep one capture per day, month or year, or only when the content changed.
- **Newest first:** list recent captures first.
- **Max snapshots per URL:** a cap on rows (and cost) for each URL.
- **Closest to dates:** only for Closest mode.

Invalid entries are skipped with a warning; if nothing valid is left, the run stops with a clear message.

#### Example input

```json
{
    "urls": ["example.com"],
    "mode": "snapshots",
    "collapse": "year",
    "statusCodes": ["200"],
    "maxSnapshotsPerUrl": 25
}
```

### ⬆️ Output

One row per capture. You can download the dataset as JSON, CSV, Excel, XML or HTML, or read it through the API. A `RUN_SUMMARY` record lists each URL, how many captures were seen and saved, and any error.

```json
{
    "query": "example.com",
    "url": "http://example.com/",
    "timestamp": "2020-01-01T00:00:12Z",
    "timestampRaw": "20200101000012",
    "year": 2020,
    "statusCode": 200,
    "mimeType": "text/html",
    "digest": "HT2DYGA5UKZCPBSFVCV3JOBXGW2G5UUA",
    "sizeBytes": 1792,
    "snapshotUrl": "(archive link to view the capture)",
    "rawUrl": "(archive link to the raw capture)"
}
```

### 💰 Pricing

Pay per event: **$0.0003 per saved row** (Bronze to Diamond plan discounts apply) plus a very small start event. A run with 1,000 rows costs about $0.30. Rows removed by your filters are not charged. Set a maximum cost per run and the Actor stops cleanly when it is reached.

### ▶️ How to use it

1. Open the Actor in Apify Console and paste a URL or domain (or keep the example.com sample).
2. Pick a mode: Snapshots (full history), Closest (nearest capture to a date), or Summary (first/last capture and years covered).
3. Click **Start**. A short list finishes in a few seconds.
4. Download the dataset as CSV, Excel or JSON, or follow the archive links to view a capture.
5. To run it on a schedule or from your own code, use the Apify API or an integration (see below).

### 🎯 Use cases

- Audit how a landing page or pricing page changed over time for SEO or a competitor review.
- Check an expired or newly purchased domain's archive.org history before you invest.
- Recover a lost page: list every archived URL under a domain or path, then open the capture.
- Collect evidence of what a public page said on a given date (closest-capture mode).
- Feed Wayback Machine snapshot dates and links into a research or AI pipeline.

### 🔌 Integrations

You can run this Actor from a schedule, a webhook, Zapier, Make, Google Sheets, or your own code with the Apify API. Results can be sent to another Actor, a cloud bucket or a dataset another of your Actors already uses.

### 💻 Use it from code (API)

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('techliondev/wayback-machine-scraper').call({
    urls: ['example.com'],
    mode: 'snapshots',
    collapse: 'year',
    statusCodes: ['200'],
    maxSnapshotsPerUrl: 25,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((row) => `${row.timestamp} ${row.snapshotUrl}`));
```

### ❓ FAQ

**Does it download the archived pages?** No. It lists captures and gives you links. The raw link lets you fetch the original content yourself.

**Why do I get fewer rows than expected?** Filters, the maximum per URL and the Archive's own index decide the count. Try Collapse set to none, or remove status filters.

**Is it legal?** It reads public index data. Archived pages may be copyrighted; check your use before republishing content.

**What if the Archive is slow?** It retries with growing waits. A URL that still fails is reported in `RUN_SUMMARY` while other URLs continue.

# Actor input Schema

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

Web pages or domains, one per line (for example example.com or example.com/pricing). With Match type set to Domain or Prefix you can cover whole sites. When you leave this empty, the Actor runs a sample for example.com.

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

Snapshots lists captures (one row each). Closest finds the capture nearest to each date in Closest to dates. Summary gives one row per URL with first and last capture and the years that have captures.

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

Used by Snapshots and Summary. Exact returns captures of that single address. Host, Domain and Prefix return captures of many different pages, so combine them with Collapse and a maximum.

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

Earliest capture to include: 2020, 2020-06 or 2020-06-15. Leave empty for no start limit.

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

Latest capture to include, same formats. Leave empty for no end limit.

## `statusCodes` (type: `array`):

Keep only captures with these HTTP status codes, for example 200 or 404. Leave empty to keep all (captures with no recorded status are always skipped).

## `mimeTypes` (type: `array`):

Keep only these file types, for example text/html, application/pdf or image/jpeg. Leave empty for all types.

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

Reduce repeated captures. One per month or year is a quick way to see a site's history; Only when content changed shows real edits.

## `newestFirst` (type: `boolean`):

List the most recent captures first (and keep the newest ones when the maximum cuts the list). Off means oldest first.

## `maxSnapshotsPerUrl` (type: `integer`):

Stops reading a URL after this many captures. Each saved capture is one billed result, so this is also your cost cap per URL.

## `closestTo` (type: `array`):

Only for the Closest mode: dates like 2018, 2018-06 or 2018-06-15. Each date gives the nearest capture for each URL. When empty, the current year is used.

## Actor input object example

```json
{
  "urls": [
    "example.com"
  ],
  "mode": "snapshots",
  "matchType": "exact",
  "collapse": "none",
  "newestFirst": false,
  "maxSnapshotsPerUrl": 100
}
```

# Actor output Schema

## `items` (type: `string`):

Dataset with one row per capture

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

Sources, apps seen and saved, plus any errors

# 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": [
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("techliondev/wayback-machine-scraper").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": ["example.com"] }

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

```

## MCP server setup

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

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/DVQCOYhY6RwgBFtVv/builds/Z83LbhGPxe2OE1gP6/openapi.json
