# Wayback Machine Snapshots & Website History (`klyve1/wayback-machine-snapshots`) Actor

List the Internet Archive Wayback Machine captures of any URL or domain: first and last snapshot, captures per year, status codes and direct archive links. Uses the official CDX API.

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

## Pricing

from $0.50 / 1,000 snapshot or summary rows

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 Snapshots & Website History

List the captures that the **Internet Archive Wayback Machine** holds for any URL or domain, using the official CDX API. Get every version of a page with its date, status code, size and a direct link to the archived copy, or a one row summary per site: first capture, last capture, years archived and age of the website.

### Who uses it

- **SEO and domain investors**: check the history and age of an expired domain before buying it.
- **Researchers and journalists**: find every version of a page and when it changed.
- **Marketers**: follow how a competitor's pricing or home page evolved.
- **Data teams**: get archive links to recover lost content of their own site.

### Example output (snapshots mode)

```json
{
  "input": "apify.com",
  "url": "https://apify.com/",
  "timestamp": "20200109130705",
  "capturedAt": "2020-01-09T13:07:05Z",
  "statusCode": 200,
  "mimeType": "text/html",
  "sizeBytes": 29306,
  "contentDigest": "D4P2GPUK3PEGEFYQFUENG7MNTQI3ZRN4",
  "archiveUrl": "https://web.archive.org/web/20200109130705/https://apify.com/",
  "rawUrl": "https://web.archive.org/web/20200109130705id_/https://apify.com/"
}
```

### Example output (summary mode)

```json
{
  "input": "apify.com",
  "firstCapturedAt": "2007-05-31T10:15:38Z",
  "lastCapturedAt": "2026-11-21T14:19:23Z",
  "yearsArchived": ["2007", "2008", "2011", "...", "2026"],
  "yearsCount": 18,
  "ageYears": 19.5,
  "lastStatusCode": 200,
  "calendarUrl": "https://web.archive.org/web/*/apify.com"
}
```

### Input

| Field | Description |
|---|---|
| URLs or domains | Pages or domains to look up. |
| Output | One row per snapshot, or one summary row per URL. |
| Match | exact URL, prefix, whole host, or domain with subdomains. |
| Max snapshots per URL | Limit of rows per input. |
| Only content changes | Skip identical consecutive captures (on by default). |
| Only HTTP 200 captures | Ignore archived redirects and errors (on by default). |
| Newest first | Return the latest captures first. |
| From / To | Date range as YYYY, YYYYMM or YYYYMMDD. |

### Pricing

Pay per result: **$0.0005 per snapshot row or summary row**. Inputs with no capture are free.

### Good to know

- Data comes from the public Wayback Machine CDX API of the Internet Archive. The Actor sends polite, sequential requests.
- `rawUrl` gives the original archived file without the Wayback toolbar, handy for text extraction.
- Very large domains in prefix or domain mode can have millions of captures: keep a sensible maximum.

# Actor input Schema

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

Pages or domains to look up in the Internet Archive, one per line (for example apify.com or https://example.com/pricing).

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

Snapshots: one row per capture. Summary: one row per URL with first and last capture, years archived and age.

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

Exact: only this URL. Prefix: every URL that starts with it. Host: all pages of this host. Domain: the host and all its subdomains.

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

Maximum number of snapshot rows per input (snapshots mode).

## `onlyContentChanges` (type: `boolean`):

Skip consecutive captures with identical content, so each row is a new version of the page.

## `onlySuccessful` (type: `boolean`):

Ignore redirects and error pages that the archive recorded.

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

Return the most recent snapshots instead of the oldest ones.

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

Optional start, as YYYY, YYYYMM or YYYYMMDD.

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

Optional end, as YYYY, YYYYMM or YYYYMMDD.

## Actor input object example

```json
{
  "urls": [
    "apify.com"
  ],
  "mode": "snapshots",
  "matchType": "exact",
  "maxSnapshotsPerUrl": 20,
  "onlyContentChanges": true,
  "onlySuccessful": true,
  "newestFirst": false,
  "from": "2020"
}
```

# Actor output Schema

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

All rows produced by the run.

# 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"
    ],
    "maxSnapshotsPerUrl": 20,
    "from": "2020"
};

// Run the Actor and wait for it to finish
const run = await client.actor("klyve1/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 = {
    "urls": ["apify.com"],
    "maxSnapshotsPerUrl": 20,
    "from": "2020",
}

# Run the Actor and wait for it to finish
run = client.actor("klyve1/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 '{
  "urls": [
    "apify.com"
  ],
  "maxSnapshotsPerUrl": 20,
  "from": "2020"
}' |
apify call klyve1/wayback-machine-snapshots --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,klyve1/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/uGEFROOQF2EZsbLGs/builds/bUcjsn33oTJQP0T6K/openapi.json
