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

Everything the Wayback Machine offers, in one actor: every saved copy of a website, every archived page of a site, what a page said on any date, and saving pages today. Also covers Common Crawl, a second web archive. No login needed, except to save pages.

- **URL**: https://apify.com/dead00/wayback-machine-scraper.md
- **Developed by:** [Dead](https://apify.com/dead00) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 snapshot founds

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 Scraper

Everything the Wayback Machine offers, in one actor: every saved copy of a website, every archived page of a site, what a page said on any date, and saving pages today. Also covers Common Crawl, a second web archive. No login needed, except to save pages.

### What it does

Pick one in **What do you want?**:

| Option | What you get | Like the Wayback Machine's… |
|---|---|---|
| **Snapshot history** | Every saved copy of a URL or a whole site, with date, status and links | Calendar and Changes views |
| **Archived URL list** | Every page of a site, with first and last capture, number of captures and versions | URLs tab |
| **Page content** | What a page said: title, description, headings, clean text and links. One date, or every version over time | Viewing a saved copy |
| **Save pages** | Archive pages today and get their Wayback links | Save Page Now |

### Filters

For snapshot history and the URL list:

- **Which pages:** one exact URL, everything under a URL, the whole site, or the whole site including subdomains
- **Date and End date**
- **Status codes:** working pages, redirects, not-found errors, server errors
- **File types:** web pages, PDFs, images, CSS, JavaScript, JSON/XML, video, audio, Office documents
- **URL contains:** e.g. `/blog/` or `.pdf`
- **Show:** every copy, only when the page changed, or one copy per day, month or year

### Examples

**Recover every page of an old website**
Archived URL list, URL `example.com`, Which pages `Whole site`, Status codes `Working pages`, File types `Web pages`. Then use Page content with **Save the full HTML** to download each page.

**See how a page changed from 2010 to 2020**
Page content, URL `example.com/pricing`, Date `2010`, End date `2020`, turn on **Every version in the date range**.

**Find every PDF a site ever published**
Archived URL list, URL `example.com`, Which pages `Whole site`, File types `PDFs`.

**Archive your pages today** (for proof or citations)
Save pages, add your URLs and your free archive.org keys.

### Output examples

**Archived URL list**

```json
{
  "url": "http://example.com/about",
  "mimeType": "text/html",
  "firstCaptured": "2010-01-01T00:00:00Z",
  "lastCaptured": "2020-01-01T00:00:00Z",
  "captureCount": 30,
  "uniqueVersions": 3,
  "firstSnapshotUrl": "https://web.archive.org/web/20100101000000/http://example.com/about",
  "lastSnapshotUrl": "https://web.archive.org/web/20200101000000/http://example.com/about"
}
```

**Page content**

```json
{
  "status": "found",
  "capturedAt": "2012-05-01T08:30:00Z",
  "waybackUrl": "https://web.archive.org/web/20120501083000/http://example.com/about",
  "title": "About Us",
  "metaDescription": "Family-run shop since 1998",
  "h1": ["About Us"],
  "wordCount": 412,
  "text": "About Us We are a family-run shop...",
  "links": [{ "url": "http://example.com/contact", "text": "Contact" }],
  "htmlUrl": "https://api.apify.com/v2/key-value-stores/.../records/page-000001-20120501083000.html"
}
```

Only successful results are charged. Rows marked `not_archived`, `blocked`, `not_saved`, `still_saving` or `error` are free.

### Saving pages

Saving uses your own free archive.org account:

1. Create an account at archive.org.
2. Open archive.org/account/s3.php and copy your **access key** and **secret key**.
3. Paste them into the Save pages options.

Options: skip pages already saved recently, also save linked pages, take a screenshot, or save error pages.

### Pricing

You pay only for results. Platform costs are included.

| Event | Price per 1,000 |
|---|---|
| Snapshot found | $0.40 |
| Archived URL found | $0.60 |
| Archived page extracted | $4.00 |
| Page saved | $5.00 |
| Actor start (per run) | $0.00005 |

Set a **Maximum cost per run** in Run options. When it is reached, the actor stops and keeps everything collected so far.

### Good to know

- **Common Crawl** is a second web archive with different copies. Choose **Both** for more coverage. Without a Date, Common Crawl covers the last 12 months.
- **Old pages are decoded correctly**, including pre-UTF-8 encodings used by many sites from the 1990s and 2000s.
- **Speed:** the Internet Archive allows about 30 history searches per minute. The actor follows this automatically, so very large sites take a few minutes.
- **Blocked sites:** some site owners exclude their site from the Wayback Machine. These return `blocked`.
- Looking for books, videos or software on archive.org? Use the **Internet Archive Scraper**.

# Actor input Schema

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

Snapshot history = every saved copy with its date (the Wayback calendar). Archived URL list = every page of a site, with first and last capture (the Wayback 'URLs' tab). Page content = the text, title and links of saved copies. Save pages = archive pages now (Save Page Now).

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

One per line, e.g. example.com or https://example.com/about. You can also paste a Wayback link.

## `date` (type: `string`):

Start of the date range. For page content, the copy closest to this date. Format 2015, 2015-06 or 2015-06-01. Leave empty for all dates or the latest copy.

## `endDate` (type: `string`):

End of the date range, e.g. 2018 or 2018-12-31. Leave empty for up to today.

## `maxResults` (type: `integer`):

How many rows to collect for each URL. With Archive set to Both, this applies to each archive.

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

For the URL list, pick Whole site or everything under a URL.

## `source` (type: `string`):

Snapshot history and page content. Common Crawl is a second web archive with different copies. Without a Date, Common Crawl covers the last 12 months. The URL list and Save pages use the Wayback Machine.

## `groupBy` (type: `string`):

Snapshot history only. Group copies like the Wayback calendar, or keep only new versions.

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

Only include copies with these responses. Leave empty for all.

## `fileTypes` (type: `array`):

Only include these kinds of files. Leave empty for all.

## `urlContains` (type: `string`):

Only include URLs containing this text, e.g. /blog/ or .pdf. Case-sensitive.

## `allVersions` (type: `boolean`):

Get the content of every different version of the page between Date and End date, instead of one copy. Uses the Wayback Machine. Max results limits how many versions.

## `includeHtml` (type: `boolean`):

Also save each archived page's complete HTML as a file and add its link (htmlUrl). Useful for rebuilding an old site.

## `archiveAccessKey` (type: `string`):

Needed only to save pages. Free: create an account at archive.org, then copy your keys from archive.org/account/s3.php.

## `archiveSecretKey` (type: `string`):

The secret key from the same page.

## `skipIfArchivedWithin` (type: `string`):

Don't save a page again if the Wayback Machine already has a copy this recent.

## `saveOutlinks` (type: `boolean`):

Also archive the pages the URL links to.

## `saveScreenshot` (type: `boolean`):

Also save a full-page screenshot of each page.

## `saveErrorPages` (type: `boolean`):

Save the page even if it returns an error (404, 500).

## Actor input object example

```json
{
  "mode": "snapshots",
  "urls": [
    "example.com"
  ],
  "maxResults": 100,
  "matchType": "exact",
  "source": "wayback",
  "groupBy": "all",
  "allVersions": false,
  "includeHtml": false,
  "skipIfArchivedWithin": "never",
  "saveOutlinks": false,
  "saveScreenshot": false,
  "saveErrorPages": false
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("dead00/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("dead00/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 dead00/wayback-machine-scraper --silent --output-dataset

```

## MCP server setup

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