# Wayback Machine Scraper (`leorochasantos/wayback-machine`) Actor

Search the Internet Archive's Wayback Machine for historical snapshots of any URL or domain. Filter by date range and get the timestamp, HTTP status, MIME type, and a direct archive link for every snapshot — no API key required.

- **URL**: https://apify.com/leorochasantos/wayback-machine.md
- **Developed by:** [Leonardo Santos](https://apify.com/leorochasantos) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.95 / 1,000 wayback machine 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Wayback Machine Scraper

Search the Internet Archive's Wayback Machine for historical snapshots of any URL or domain. Uses the CDX API for batch snapshot retrieval with Availability API fallback for the single closest snapshot. Returns clean typed JSON — no API key required.

### Why this actor?

- **CDX + Availability dual engine** — fast batch retrieval via CDX, with graceful fallback to the Availability API for edge cases
- **Per-snapshot billing** — pay only for the snapshots you actually receive ($0.003 each), not per-request
- **Full metadata** — timestamp, original URL, HTTP status code, MIME type, content digest, and length for every snapshot
- **Direct archive links** — every snapshot row includes a clickable `https://web.archive.org/web/TIMESTAMP/URL` link
- **Date filtering** — restrict to specific date ranges with `from`/`to` in YYYYMMDD format
- **No auth, open service** — the Wayback Machine is entirely public

### Use cases

- Change detection — monitor how a website's content has evolved over time
- Historical research — retrieve archived versions of defunct or changed pages
- Compliance and legal — produce timestamped evidence of web content at specific dates
- Content recovery — find cached copies of pages that are no longer live
- SEO analysis — audit historical versions of competitor pages

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `urls` | string\[] | (required) | One or more URLs or domains to search. Use `*.example.com` for domain wildcards. Capped at 1000, deduplicated. |
| `from` | string | — | Earliest snapshot date in `YYYYMMDD` format (e.g. `20200101`). |
| `to` | string | — | Latest snapshot date in `YYYYMMDD` format (e.g. `20231231`). |
| `limit` | integer | `100` | Max snapshots per URL (1–1000). This is a billing boundary. |
| `includeAvailability` | boolean | `true` | Fall back to Availability API when CDX returns no snapshots. |

#### Example

```json
{
  "urls": ["*.github.com", "example.com"],
  "from": "20230101",
  "to": "20231231",
  "limit": 50
}
```

### Output

Each dataset row is a flat snapshot object:

```json
{
  "input": "github.com",
  "timestamp": "20230615123456",
  "originalUrl": "https://github.com/",
  "statuscode": "200",
  "mimetype": "text/html",
  "digest": "ABC123DEF456...",
  "length": "54321",
  "snapshotUrl": "https://web.archive.org/web/20230615123456/https://github.com/",
  "error": null,
  "scraped_at": "2026-08-03T12:00:00.000Z"
}
```

Error items carry a non-null `error` field and are never charged.

### Pricing

Pay per event, and **the platform usage is on us** — the price you see is the price you pay, with no compute bill on top.

| Event | Price | What one charge buys |
|---|---|---|
| Wayback Machine snapshot | **$0.003** | Charged for each Wayback Machine snapshot returned. Empty results are never charged. Errors and parse failures are free. |
| Actor Start | **$0.002** | One run, whatever it returns. |

Higher Apify subscription tiers pay less on every event (Silver −20%, Gold −35%).

### Reliability

- **<2% failure rate target** over 30 days
- Dual-API architecture: CDX fails over to Availability API automatically
- All upstream parsing logic is isolated in `src/source.ts` for fast repair
- Wayback Machine has been operational since 2001 with no authentication required

### Limitations

- Not a real-time scraper — Wayback Machine snapshots may lag by hours to days
- Snapshot content is not extracted (links and metadata only)
- CDX API may return large result sets on busy domains; use `from`/`to` and `limit` to control volume

### FAQ

**What's the difference between CDX and Availability?** CDX returns ALL snapshots matching your query (great for batch retrieval). The Availability API returns the single closest snapshot (useful as a fallback when CDX returns nothing).

**How do I search an entire domain?** Prefix with `*.` — e.g. `*.example.com` returns all snapshots from any path on `example.com`.

**Are error items charged?** No. Items with a non-null `error` field are always free.

***

*This Actor is an independent tool and is not affiliated with the Internet Archive.*

# Actor input Schema

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

One or more URLs or domains to search for in the Wayback Machine. For domain-level searches, use '\*.example.com'. URLs are trimmed, deduplicated, and capped at 1000.

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

Earliest snapshot date in YYYYMMDD format (e.g. '20200101'). Leave empty for all snapshots.

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

Latest snapshot date in YYYYMMDD format (e.g. '20231231'). Leave empty for all snapshots.

## `limit` (type: `integer`):

Maximum number of snapshots to return per URL (1–1000). This is a billing boundary — you are only charged for the snapshots actually delivered.

## `includeAvailability` (type: `boolean`):

When the CDX API returns no snapshots, fall back to the Availability API for the single closest snapshot. Set to false to skip this fallback.

## `proxyConfiguration` (type: `object`):

Proxy to use for outgoing requests. The Wayback Machine is an open service with no auth; the default Apify datacenter proxy works.

## Actor input object example

```json
{
  "urls": [
    "*.github.com",
    "example.com"
  ],
  "limit": 100,
  "includeAvailability": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (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": [
        "*.github.com",
        "example.com"
    ],
    "from": "",
    "to": ""
};

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

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "*.github.com",
    "example.com"
  ],
  "from": "",
  "to": ""
}' |
apify call leorochasantos/wayback-machine --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=leorochasantos/wayback-machine",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gwyPQVyotA4LFHPS9/builds/ZIhPWJnBbQhBDZVK9/openapi.json
