# Wayback Machine Scraper - Archived URLs & Snapshots (`launchgrade/wayback-url-exporter`) Actor

Export every URL the Internet Archive has captured for a domain, host or path, or every snapshot with timestamps, status codes and MIME types, using the official Wayback Machine CDX API. Find deleted pages, old URLs for redirects, expired-domain history and content changes.

- **URL**: https://apify.com/launchgrade/wayback-url-exporter.md
- **Developed by:** [LaunchGrade](https://apify.com/launchgrade) (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

$0.50 / 1,000 result exporteds

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/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 URLs & snapshots (official CDX API)

Export the **full archive history of any website** from the Internet Archive's Wayback Machine. List **every unique URL ever archived** for a domain, or **every snapshot** of a single page, with capture dates, HTTP status codes, MIME types, content digests and direct Wayback links. Uses the Internet Archive's official **CDX API**.

### Use cases

- **SEO and site migrations**: recover old URLs that need 301 redirects, find lost pages and backlink targets.
- **Expired and aged domains**: check what a domain used to host before you buy it (spam, adult content or a real business?).
- **Content recovery**: find deleted blog posts, PDFs and product pages.
- **Competitive research**: see when a competitor launched pages, pricing or products.
- **OSINT and compliance**: document how a page looked on a given date.

### What you get

| Field | Description |
|---|---|
| `url` | The archived URL |
| `capturedAt` / `timestamp` | Capture time (ISO and Wayback format) |
| `statusCode` | HTTP status at capture (empty for de-duplicated "revisit" captures) |
| `mimeType` | e.g. `text/html`, `application/pdf` |
| `archiveUrl` | Direct link to the snapshot on web.archive.org |
| `digest`, `lengthBytes` | Content hash (spot changes between snapshots) and size |
| `firstCaptureOnly` | `true` in "unique URLs" mode (each URL's first capture) |

A per-target summary (results by year and by status code) is saved to the key-value store as `SUMMARY`. Export as CSV, Excel or JSON, or call from the API, Zapier, Make, n8n or an AI agent via Apify MCP.

### How to use it

1. Add domains (`example.com`), sections (`example.com/blog`) or exact URLs.
2. Pick **Every unique URL** or **Every snapshot**, and how to match (domain incl. subdomains, host, prefix or exact).
3. Optionally filter by date range, status code (e.g. `200`) and MIME type (e.g. `text/html` or `application/pdf`).
4. Set **Max results per target** as your cost cap and click **Start**.

```json
{
  "targets": ["python.org/about"],
  "mode": "uniqueUrls",
  "matchType": "domain",
  "from": "2015",
  "to": "2020",
  "statusFilter": "200",
  "mimeFilter": "text/html",
  "maxResultsPerTarget": 5000
}
```

### Example input

```json
{
  "targets": [
    "python.org/about"
  ],
  "matchType": "prefix",
  "maxResultsPerTarget": 20
}
```

### Example output (one dataset row from a real run)

```json
{
  "target": "python.org/about",
  "url": "http://www.python.org:80/about/",
  "timestamp": "20040818095427",
  "capturedAt": "2004-08-18T09:54:27+00:00",
  "statusCode": "404",
  "mimeType": "text/html",
  "digest": "ZAGT3UYDPRU2TZQIBZEOHTKWGKHECVIY",
  "lengthBytes": 1962,
  "archiveUrl": "https://web.archive.org/web/20040818095427/http://www.python.org:80/about/",
  "firstCaptureOnly": true
}
```

### Pricing

**$0.0005 per result** ($0.50 per 1,000 archived URLs or snapshots). Each target stops at **Max results per target**, and the run stops at your Apify max-charge setting.

#### Pricing examples

- 100 results: $0.05
- 1,000 results: $0.50
- 10,000 results: $5.00

You pay only for results delivered, and the run stops at your max cost per run.

### Fair use

Requests are sent one at a time with pauses and automatic back-off, following the Internet Archive's guidance for the CDX API. Very large domains can take a while; results stream into the dataset as they arrive. Data comes from the Internet Archive; please support their work at archive.org/donate.

### FAQ

**Why are some status codes empty?** The Wayback Machine stores unchanged re-captures as "revisits" without a status code.

**Can it download the archived page content?** This version exports the index (URLs, dates, links). Open `archiveUrl` to view any snapshot.

### More tools from LaunchGrade

Website audits, link checking, domain research, lead lists and data exporters, all pay-per-result: [apify.com/launchgrade](https://apify.com/launchgrade).

# Actor input Schema

## `targets` (type: `array`):

Domains (example.com), sections (example.com/blog) or exact page URLs.

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

Unique URLs: one row per distinct archived URL. Snapshots: one row per capture.

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

For 'Every snapshot', Domain is treated as Exact URL.

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

Optional. YYYY, YYYYMM or YYYYMMDD.

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

Optional. YYYY, YYYYMM or YYYYMMDD.

## `statusFilter` (type: `string`):

Optional regex, e.g. 200 or \[45].. for errors.

## `mimeFilter` (type: `string`):

Optional regex, e.g. text/html or application/pdf.

## `maxResultsPerTarget` (type: `integer`):

Stops each target here so a run can't cost more than you expect.

## Actor input object example

```json
{
  "targets": [
    "python.org/about"
  ],
  "mode": "uniqueUrls",
  "matchType": "prefix",
  "maxResultsPerTarget": 20
}
```

# Actor output Schema

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

One row per archived URL or snapshot from the Wayback Machine CDX API.

## `summary` (type: `string`):

JSON summary of 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 = {
    "targets": [
        "python.org/about"
    ],
    "matchType": "prefix",
    "maxResultsPerTarget": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("launchgrade/wayback-url-exporter").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 = {
    "targets": ["python.org/about"],
    "matchType": "prefix",
    "maxResultsPerTarget": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("launchgrade/wayback-url-exporter").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 '{
  "targets": [
    "python.org/about"
  ],
  "matchType": "prefix",
  "maxResultsPerTarget": 20
}' |
apify call launchgrade/wayback-url-exporter --silent --output-dataset

```

## MCP server setup

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

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/6bheudjxaYaGa3a6A/builds/PToeswt26fnnxDilD/openapi.json
