# Wayback Machine Snapshot Finder (bulk URLs, CDX API) (`imethkat/wayback-snapshot-finder`) Actor

Find archived versions of any URL on the Wayback Machine in bulk: snapshot history or closest capture to a date. Retries, clean JSON/CSV output.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Snapshot Finder

Look up archived versions of web pages on the **Internet Archive Wayback Machine** in bulk. Give it a list of URLs and it returns, for each one, either the full snapshot history or the single snapshot closest to a date you choose. It uses the Internet Archive's public CDX index, so no login, API key or proxy is needed.

### What you can use it for

- **Check what a page looked like on a given date** (evidence for disputes, pricing history, terms-of-service changes).
- **Build a timeline of captures** for a competitor page, product page or policy page.
- **Recover lost content**: list every captured URL under a domain or path (`prefix` / `domain` match) and open the archived copy.
- **Monitor link rot**: find the last good capture of URLs that now return 404.
- **Feed other tools**: every row includes a ready-to-open Wayback link and a `rawArchiveUrl` (the original page without the Wayback toolbar).

### Input

| Field | What it does |
|---|---|
| `urls` | URLs, domains or prefixes, one per line. |
| `mode` | `history` (list snapshots) or `closest` (one snapshot per URL nearest `targetDate`; latest if empty). |
| `fromDate` / `toDate` | History mode: date range, `YYYY-MM-DD`. |
| `matchType` | `exact`, `prefix`, `host` or `domain`. |
| `collapse` | `none`, `hour`, `day`, `month`, `year`: at most one capture per period. |
| `onlyStatus200` | Skip redirects, 404s and errors (default on). |
| `maxSnapshotsPerUrl` | Hard cap per URL (default 100). Also caps your cost. |

Example input:

```json
{
  "urls": ["https://example.com/pricing", "https://www.abc.net.au"],
  "mode": "history",
  "fromDate": "2023-01-01",
  "toDate": "2024-12-31",
  "collapse": "month",
  "maxSnapshotsPerUrl": 24
}
```

### Output

One dataset row per snapshot:

```json
{
  "inputUrl": "https://example.com",
  "found": true,
  "snapshotDate": "2023-01-01T00:08:11+00:00",
  "timestamp": "20230101000811",
  "statusCode": 200,
  "mimeType": "text/html",
  "archiveUrl": "https://web.archive.org/web/20230101000811/https://example.com/",
  "rawArchiveUrl": "https://web.archive.org/web/20230101000811id_/https://example.com/",
  "originalUrl": "https://example.com/",
  "length": 1341,
  "digest": "O2XBZT4EZOUL6RS37E7DQFWAWWBEVGVJ",
  "error": null
}
```

Export as JSON, CSV, Excel or via the API.

### Pricing

Pay per event: **US$1.50 per 1,000 snapshots returned** (US$0.0015 each), plus Apify platform fees shown on the run page. You are **not charged** for rows where nothing was found or the lookup failed (those rows have `found: false` and an `error` message). Set a maximum cost per run in the run options and the Actor stops when it is reached.

### Good to know

- Results depend on what the Internet Archive has captured. A page that was never archived returns `found: false`.
- The Internet Archive rate-limits heavy use. The Actor runs 2 lookups at a time and retries with backoff on HTTP 429/5xx; if the service is still unavailable the row is returned with the error and is not charged.
- This Actor only reads the Internet Archive's public index. It does not download the archived page bodies. Use `rawArchiveUrl` to fetch them yourself.
- Not affiliated with the Internet Archive. Please follow its [terms of use](https://archive.org/about/terms.php).

### Feedback

Found a bug or need a field added? Open an issue on this Actor's page in the Apify Store; issues are read and fixed.

# Actor input Schema

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

Pages, domains or URL prefixes to look up on the Wayback Machine, one per line. Example: https://example.com/pricing

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

'history' lists archived snapshots over time. 'closest' returns the single snapshot nearest to the target date for each URL.

## `targetDate` (type: `string`):

Date as YYYY-MM-DD. Used only in 'closest' mode. Leave empty for the most recent snapshot.

## `fromDate` (type: `string`):

Only snapshots on or after this date (YYYY-MM-DD). Optional.

## `toDate` (type: `string`):

Only snapshots on or before this date (YYYY-MM-DD). Optional.

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

exact = this URL only; prefix = every URL starting with it; host = the whole host; domain = host plus all subdomains.

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

Keep at most one snapshot per period for each URL. 'none' returns every capture.

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

Skip redirects, 404s and errors in history mode.

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

Upper limit of snapshots returned per input URL (history mode). Also caps your cost.

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ],
  "mode": "history",
  "matchType": "exact",
  "collapse": "day",
  "onlyStatus200": true,
  "maxSnapshotsPerUrl": 100
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset with the result rows (view as table, export JSON/CSV/Excel).

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

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

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

```

## MCP server setup

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

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/MnPHmlwTKya07kjEc/builds/ftXlQSqaYD5k2iRZV/openapi.json
