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

List archived snapshots and every known URL of any website from the Internet Archive's official CDX API. Date ranges, status and type filters, closest snapshot to a date, direct archive links. No login. Pay per snapshot.

- **URL**: https://apify.com/extas_corp/wayback-machine-scraper.md
- **Developed by:** [Extas Corp](https://apify.com/extas_corp) (community)
- **Categories:** Developer tools, SEO tools, Other
- **Security:** 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 snapshots

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: Archived Snapshots & URLs

Query the **Internet Archive's official CDX Server API** and get clean, flat snapshot records for any URL or domain. No login, no cookies, no browser, no proxies.

- **Snapshots over time**: every capture of a page, thinned out by hour / day / month / year or by content change
- **Closest snapshot** to a date (e.g. what did this site look like on 2020-06-15?)
- **All archived URLs** of a domain, host or path prefix (great for site migrations, SEO audits, link recovery)
- Filter by date range, HTTP status and MIME type
- Ready-to-open `archiveUrl` and raw `rawUrl` (original content without the Wayback toolbar)
- Paginated with resume keys, so you can pull tens of thousands of rows
- **$0.50 per 1,000 snapshots.** Failed lookups are never charged.

### Input examples

```json
{ "mode": "snapshots", "urls": ["example.com/pricing"], "collapse": "month", "from": "2020", "maxItems": 200 }
```

```json
{ "mode": "closest", "urls": ["apify.com", "openai.com"], "closestTo": "2020-06-15" }
```

```json
{ "mode": "urls", "urls": ["crawlee.dev"], "matchType": "domain", "mimeType": "text/html", "maxItems": 5000 }
```

### Output

`type` (`snapshot` or `error`), `url`, `timestamp` (YYYYMMDDhhmmss), `date` (ISO 8601 UTC), `statusCode`, `mimeType`, `digest` (content hash: same digest = unchanged page), `length`, `archiveUrl`, `rawUrl`, `source`.

### Notes

- This Actor returns snapshot metadata and links; it does not download the archived pages.
- Domain-wide queries on very large sites can be slow on the Archive's side; the Actor retries automatically, and a lower *Max results* helps.
- Items with `type: error` are free.

### Pricing

| Event | Price |
| --- | --- |
| Snapshot | $0.0005 |

Data comes from the Internet Archive's public API. Please keep request volumes reasonable.

### Example output

```json
{
  "type": "snapshot",
  "url": "https://crawlee.dev/",
  "date": "2022-08-04T21:57:09Z",
  "statusCode": 200,
  "mimeType": "text/html",
  "archiveUrl": "https://web.archive.org/web/20220804215709/https://crawlee.dev/",
  "rawUrl": "https://web.archive.org/web/20220804215709id_/https://crawlee.dev/"
}
```

### Use cases

- **SEO and migrations**: list every archived URL of a domain to rebuild redirects or recover content.
- **Research and legal evidence**: find how a page looked on a given date (`closestTo`).
- **Link recovery**: find dead pages that still have inbound links.

### Integrations

Python (Apify client):

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("extas_corp/wayback-machine-scraper").call(run_input={"mode": "snapshots", "urls": ["example.com"], "maxItems": 20})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["date"], item["archiveUrl"])
```

**Make, Zapier, n8n**: add the Apify app, choose *Run Actor* (or *Run Actor and get dataset items*), set the Actor to `extas_corp/wayback-machine-scraper` and map the JSON input. The same Actor can be started on a schedule from Apify itself, with a webhook to your own endpoint when the run finishes.

### FAQ

**Does it download page content?** It returns snapshot records with ready-to-open `archiveUrl` and raw `rawUrl`. Fetch the raw content from there or feed it to Website to Markdown.

**Do I need to pay to try it?** New Apify accounts include free monthly platform credit (about $5 on the free plan at the time of writing), so you can run the example input above and many more items before paying anything. You only pay the per-event price listed under Pricing; runs that return nothing or fail are not charged for the failed items.

# Actor input Schema

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

Snapshots of a page over time, the closest snapshot to a given date, or every unique URL the archive knows for a site.

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

A page URL (example.com/pricing) or a domain (example.com). Use 'Match' to include subpaths or subdomains.

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

Exact URL, everything under a path prefix, a whole host, or a domain with all subdomains. Defaults: exact for snapshots, domain for 'All archived URLs'.

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

Earliest capture: 2020, 2020-06 or 2020-06-15.

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

Latest capture: 2024, 2024-06 or 2024-06-15.

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

Date to approach, e.g. 2020-06-15. Returns the nearest capture for each URL.

## `collapse` (type: `string`):

Thin out the timeline: keep one snapshot per hour, day, month or year, or only snapshots whose content changed.

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

Only captures with this status code (200, 301, 404...). Type 'any' to keep everything.

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

Optional filter, e.g. text/html, application/pdf, image/png.

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

Maximum snapshots (or URLs) for each entry. You are charged per result.

## Actor input object example

```json
{
  "mode": "snapshots",
  "urls": [
    "example.com"
  ],
  "collapse": "none",
  "statusFilter": "200",
  "maxItems": 20
}
```

# 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("extas_corp/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("extas_corp/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 extas_corp/wayback-machine-scraper --silent --output-dataset

```

## MCP server setup

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