# Wayback Machine API: Site History & Snapshots (`wrtcom/wayback-machine-history`) Actor

Wayback Machine (Internet Archive) data for many sites at once: first and last capture, captures per year, gaps, page versions with dates and status codes, all archived URLs of a domain. Wayback Machine scraper and CDX API alternative, JSON, no API key.

- **URL**: https://apify.com/wrtcom/wayback-machine-history.md
- **Developed by:** [WRTLabs](https://apify.com/wrtcom) (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

from $1.05 / 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 History: Site Summary, Snapshots & URLs

Get the **Internet Archive Wayback Machine history** of many websites in one run, as clean JSON:

- **Summary per site**: when the site was first and last archived, how many days were captured per
  year, which years are missing, the longest gap, the last HTTP status, and links into the archive.
- **Snapshots**: every version of a page (by default only captures where the content changed), with
  date, HTTP status, content type, size and a direct snapshot link.
- **Archived URLs**: every URL of a domain the archive has ever seen, with its first capture date.

Data comes from the Wayback Machine's public CDX index. No API key, no login, and **no personal
data** (see "How it behaves").

### What you get

Summary mode, one row per site (real run, 2026-11-07, trimmed):

```json
{
  "record_type": "summary",
  "target": "apify.com",
  "archived": true,
  "first_capture": "2007-05-31",
  "last_capture": "2026-11-04",
  "capture_days": 1158,
  "years_with_captures": 18,
  "missing_years": ["2009", "2010"],
  "capture_days_per_year": {"2007": 3, "2008": 1, "2011": 3, "...": "...", "2026": 111},
  "longest_gap_days": 874,
  "longest_gap_from": "2008-09-19",
  "longest_gap_to": "2011-02-10",
  "last_status_code": 200,
  "first_snapshot_url": "https://web.archive.org/web/20070531101538/apify.com",
  "calendar_url": "https://web.archive.org/web/*/apify.com"
}
```

Snapshots mode, one row per page version:

```json
{
  "record_type": "snapshot",
  "target": "apify.com/pricing",
  "url": "https://apify.com/pricing",
  "captured_at": "2023-01-29T23:10:04Z",
  "status_code": 200,
  "mime_type": "text/html",
  "length_bytes": 26863,
  "digest": "UISCCCKKCX2ZYSBM6HBEYHZOWEOPRS7S",
  "snapshot_url": "https://web.archive.org/web/20230129231004/https://apify.com/pricing",
  "raw_snapshot_url": "https://web.archive.org/web/20230129231004id_/https://apify.com/pricing"
}
```

| Field | Meaning |
|---|---|
| `record_type` | `summary`, `snapshot` or `url` |
| `target` | the site / page / prefix from your input |
| `first_capture`, `last_capture` | Summary: first and last day the archive captured the page. Archived URLs: `first_capture` = first capture of that URL |
| `capture_days`, `capture_days_ok`, `capture_days_per_year` | days with at least one capture (in total, with HTTP 200, per year) |
| `missing_years`, `longest_gap_days` (+ `_from`, `_to`) | years without any capture between the first and the last; the longest stretch without a capture |
| `url`, `url_key` | the archived URL and the archive's normalised key |
| `captured_at`, `timestamp` | capture time (UTC) |
| `status_code`, `mime_type`, `length_bytes`, `digest` | as recorded by the archive; same `digest` = same content |
| `snapshot_url`, `raw_snapshot_url` | the capture in the Wayback Machine (with / without the archive toolbar) |
| `licence`, `licence_url`, `attribution` | source terms, on every row |

Each run also saves `RUN_REPORT` (requests, records delivered, whether the run finished) and
`WAYBACK_REPORT` (sites read, sites refused with the reason, URLs withheld).

### Input

| Option | Default | |
|---|---|---|
| Websites or pages | - | `example.com`, `https://example.com/pricing`, or a prefix `example.com/blog/*` |
| What to get | Summary per site | `summary`, `snapshots` or `urls` |
| Match | Auto | exact URL (summary, snapshots) or domain + subdomains (archived URLs); or choose prefix / host / domain |
| From / To | all time | `2019`, `2019-05` or `2019-05-31` |
| Only content changes | on | snapshots: one row per page version instead of every capture |
| HTTP status codes, Content types | all | e.g. `200`; `text/html`, `application/pdf` |
| URL keywords | all | keep URLs that contain a word, e.g. `pricing` |
| Max results per site | no limit | so one huge domain does not use the whole run |
| Max results | 1000 (form starts at 50) | hard stop, so you control cost |
| Only new since last run | off | with a schedule: only new snapshots / URLs, a summary only when the site has new captures |

### Typical uses

- **Domain due diligence**: is a domain you want to buy really 15 years old, or did it go dark for years?
  Summary mode on a list of domains.
- **SEO and site migrations**: every URL a site ever had (archived URLs mode, status 200, `text/html`)
  to build a redirect map or recover lost pages.
- **Competitor and compliance history**: every version of a pricing, terms or product page with dates
  and links, to open the versions you care about.

### Pricing

Pay per result (see the Pricing tab): site summary $0.004, snapshot row $0.0015, archived URL row
$0.002. You pay only for rows delivered to your dataset; the Actor stops at your max cost per run.

### How it behaves

- **Honest pace.** One request at a time with a short pause, with an identifying user agent and no
  proxies: the Internet Archive is a non-profit and drops connections under parallel load. One request
  returns up to 2,000 rows, so 10,000 snapshots take a few minutes. A site summary takes from a few
  seconds to about 30 seconds for sites with thousands of archived days (2 sites in our test: 32 s).
- **Metadata only.** We return what the archive's index says about each capture and links to it, not
  the archived pages themselves.
- **No personal data.** Archived URLs that may point at a person (an email address or phone number
  in the URL, or a person page such as `/team/jane-doe`, `/author/...`, `/~user/`) are left out and
  counted in `WAYBACK_REPORT`. Social networks, profile and blog hosts and people-search sites
  (Facebook, LinkedIn, X, Instagram, GitHub, WordPress.com, Blogspot, ...), whole country domains and
  IP addresses are not accepted as targets. This is a rule set, not a guarantee.
- Every record is checked against the output schema before delivery. Broken records are dropped (you
  are not charged for them). If more than 5% fail, the run is marked **Failed**.

### Data source and terms

Capture metadata from the Internet Archive Wayback Machine (https://web.archive.org/). The archive's
own [Terms of Use](https://archive.org/about/terms.php) apply to your use of the archive and of the
archived pages you open through the snapshot links. **You are responsible for making sure your use of
the data and of the archived pages complies with those terms and with the law that applies to you.**
The Internet Archive is a non-profit library;
consider [donating](https://archive.org/donate) if this data is useful to you.

This Actor is not affiliated with or endorsed by the Internet Archive.

# Actor input Schema

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

Domains (example.com), pages (https://example.com/pricing) or a path prefix ending in \* (example.com/blog/\*). Summary mode returns one row per site. Social networks (person profiles) are not supported.

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

Summary = one row per site: first / last capture, days captured per year, missing years, longest gap. Snapshots = one row per capture of the page (only content changes by default). Archived URLs = every archived URL of the site with its first capture.

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

Which URLs count for a site. Auto = the exact URL for Summary and Snapshots, the whole domain with subdomains for Archived URLs. A trailing \* always means prefix.

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

First capture date: YYYY, YYYY-MM or YYYY-MM-DD. Empty = from 1996.

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

Last capture date: YYYY, YYYY-MM or YYYY-MM-DD. Empty = until today.

## `onlyChanges` (type: `boolean`):

Snapshots mode: skip captures whose content is identical to the previous one (same digest), so you get one row per page version.

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

Keep only captures with these HTTP statuses, e.g. 200 or 301. Empty = all.

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

Keep only these MIME types, e.g. text/html or application/pdf. Empty = all.

## `includeRevisits` (type: `boolean`):

Include warc/revisit rows (the archive saw the same content again and stored only a pointer). Off by default.

## `keywords` (type: `array`):

Snapshots / Archived URLs: keep only URLs containing any of these words (case-insensitive), e.g. pricing, blog. Empty = all.

## `maxRecordsPerUrl` (type: `integer`):

Snapshots / Archived URLs: stop each site after this many rows, so one big site does not use up the whole run. 0 = no limit.

## `maxItems` (type: `integer`):

Stop after this many results in total (you pay per result). The form starts at 50 for a quick test; default without a value is 1000.

## `onlyNew` (type: `boolean`):

Skip rows already returned by earlier runs on your account: new snapshots / new URLs only, and a site summary only when the site has new captures. Use with a schedule.

## Actor input object example

```json
{
  "urls": [
    "apify.com",
    "example.com"
  ],
  "mode": "summary",
  "matchType": "auto",
  "onlyChanges": true,
  "includeRevisits": false,
  "maxRecordsPerUrl": 0,
  "maxItems": 50,
  "onlyNew": false
}
```

# Actor output Schema

## `records` (type: `string`):

Type, site, URL, capture dates, HTTP status and a link to the archived snapshot.

## `summaries` (type: `string`):

Summary mode: first / last capture, days captured, missing years, longest gap per site.

## `allFields` (type: `string`):

Same records with every field.

## `runReport` (type: `string`):

Requests, records delivered, whether the run collected everything.

## `waybackReport` (type: `string`):

Mode, sites read, sites refused (with the reason), archived URLs withheld because they may point at a person (email, phone, person page path).

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

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

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

```

## MCP server setup

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

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/udS6QMz6wpJJyOnrV/builds/mjaipwdx2aIO7bpZn/openapi.json
