# Wayback Machine Scraper — Archived Snapshots & Old URLs (`jeffev/wayback-machine-scraper`) Actor

Get Internet Archive (Wayback Machine) data for any URL or domain: full capture history with dates, status codes and archive links; every URL ever archived for a domain (find old pages for SEO and audits); or the closest snapshot to a date. Filter by date range, status and file type.

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

## Pricing

from $0.14 / 1,000 records

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 Scraper — Archived Snapshots & Old URLs

Get **Internet Archive (Wayback Machine)** data for any URL or domain, from the official CDX API:

- **Capture history** of each page: every snapshot (or one per day, month or year) with date, HTTP status, file type, size and the archive link, plus a raw-content link.
- **All archived URLs of a domain**: every page the Wayback Machine has ever seen, with its first capture. Great for recovering old pages, redirects and backlinks after a migration.
- **Closest snapshot** to a date for each URL.

Filter by date range, successful captures only and file type (HTML, PDF, images...).

Built for **SEO and site migrations, competitor history research, content recovery, compliance and journalism**.

### Why this one

- **Three modes** in one actor: history, all URLs of a domain, closest to a date.
- **Fast and cheap**: thousands of records in seconds, no browser.
- **Raw links** (`id_` URLs) that return the original archived file without the Wayback toolbar.

### Input

All archived HTML pages of a domain:

```json
{
  "urls": ["example.com"],
  "mode": "urls",
  "mimeType": "text/html",
  "maxResultsPerUrl": 20000
}
```

One snapshot per year of a page:

```json
{
  "urls": ["nytimes.com/section/technology"],
  "mode": "snapshots",
  "onePer": "year"
}
```

### Output

| Field | Description |
|---|---|
| `input`, `url` | requested URL or domain, archived URL |
| `timestamp`, `capturedAt` / `firstCapturedAt` | capture date |
| `statusCode`, `mimeType`, `sizeBytes`, `digest` | capture details |
| `archiveUrl`, `rawArchiveUrl` | links to the archived page |

### Example output

One real item from a test run (long texts and lists shortened):

```json
{
  "type": "snapshot",
  "url": "apify.com",
  "timestamp": "20141216192636",
  "capturedAt": "2014-12-16T19:26:36Z",
  "statusCode": "200",
  "archiveUrl": "http://web.archive.org/web/20141216192636/http://apify.com/",
  "requestedDate": "20150101"
}
```

### Feedback

Found a problem or need a field? Open an issue in the **Issues** tab: every issue is read and answered. If the actor helped you, a review on the Store helps a lot.

### How much does it cost?

You pay only for results delivered, at a fixed price per item. **Apify platform usage is included** in that price, so there are no compute costs on top. Errors and items that couldn't be found are free.

| What you get | Price | Example |
|---|---|---|
| Record | $0.0002 each | 1,000 records = $0.20 |

The Apify **Free plan includes $5 of monthly credit**, enough for about **25,000 records** per month at no cost. You can also set a maximum spend per run.

On paid Apify plans it gets cheaper automatically: **10% off on Starter, 20% on Scale and 30% on Business**.

# Actor input Schema

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

Pages (example.com/pricing) or domains (example.com).

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

What to return.

## `maxResultsPerUrl` (type: `integer`):

Limit per URL or domain.

## `onePer` (type: `string`):

Capture history mode: keep at most one capture per period.

## `dateFrom` (type: `string`):

YYYY-MM-DD (or just YYYY).

## `dateTo` (type: `string`):

YYYY-MM-DD (or just YYYY).

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

Skip redirects and errors.

## `mimeType` (type: `string`):

e.g. text/html, application/pdf, image/jpeg.

## `closestTo` (type: `string`):

Closest mode: the date to look for (YYYY-MM-DD).

## Actor input object example

```json
{
  "urls": [
    "apify.com"
  ],
  "mode": "snapshots",
  "maxResultsPerUrl": 200,
  "onePer": "none",
  "onlySuccessful": true
}
```

# Actor output Schema

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

Wayback Machine captures or URLs.

# 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"
    ],
    "maxResultsPerUrl": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("jeffev/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": ["apify.com"],
    "maxResultsPerUrl": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("jeffev/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": [
    "apify.com"
  ],
  "maxResultsPerUrl": 200
}' |
apify call jeffev/wayback-machine-scraper --silent --output-dataset

```

## MCP server setup

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