# Wayback Machine Scraper & Archive.org API: Snapshot History (`stazis/wayback-snapshots-api`) Actor

Get every archived URL of a domain, path or page from the Internet Archive's Wayback Machine (CDX index): capture date, HTTP status, MIME type, digest and a direct snapshot link. Date, status and MIME filters, de-duplication, domain age. No API key.

- **URL**: https://apify.com/stazis/wayback-snapshots-api.md
- **Developed by:** [Stanislav](https://apify.com/stazis) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 snapshot results

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 URLs & Snapshot History

Query the **Internet Archive's Wayback Machine** CDX index at scale. Get **every archived URL of a domain** (or a host, a path prefix or a single page) and the **full capture history of a page**, with capture date, HTTP status, MIME type, content digest and a direct `web.archive.org` snapshot link.

- **Who it's for:** SEO site migrations and redirect maps, recovering lost pages, competitor history, OSINT and research.
- **Source:** the Internet Archive's public CDX API, queried politely (one request at a time). No API key, no login; capture metadata only, no page content copied.
- **Filters:** date range, HTTP status, MIME type, collapse by URL, day, month or content.
- **Output:** JSON, CSV or Excel; pay per capture returned (see the Pricing tab).

### Quick start (one click)

Open the Actor and press **Start**: the form is prefilled with this input.

```json
{
  "urls": [
    "apify.com"
  ],
  "maxResults": 20
}
```

Sample output (one row, more fields in the dataset):

| target | url | timestamp | capturedAt | statusCode |
|---|---|---|---|---|
| example.com | https://www.example.com/ | 20200101213728 | 2020-01-01T21:37:28Z | 200 |

### Use cases

**Redirect map after a site migration.** List every URL the old site ever had, once each, then map them to new URLs.

```json
{"urls": ["example.com"], "matchType": "domain", "collapse": "url", "maxResults": 5000}
```

**Track changes to a competitor's pricing page.** One capture per month, skipping captures whose content did not change.

```json
{"urls": ["https://example.com/pricing"], "matchType": "exact", "collapse": "month", "from": "2022"}
```

**Find lost PDFs and dead pages.** Archived PDFs of a site, or pages that returned 404.

```json
{"urls": ["example.com"], "matchType": "domain", "mimeType": "application/pdf", "collapse": "url"}
```

**Domain age check.** The first capture date is a good proxy for how long a site has existed.

```json
{"urls": ["example.com"], "matchType": "exact", "maxResults": 1}
```

### What can you do with it?

- **Archived URL extraction**: list every URL of a domain the Wayback Machine has seen (`matchType: domain`, `collapse: url`). Useful for SEO audits, finding dead pages and redirect mapping after a migration, recovering lost content, and security reconnaissance on your own assets.
- **Page history**: every capture of one page over time, or one per day/month/year, to track pricing, terms-of-service or competitor page changes.
- **Content-change detection**: `collapse: content` skips captures whose content didn't change.
- **Find files**: filter by MIME type (`application/pdf`, `image/jpeg`) or HTTP status (`200`, `404`, `3..`).
- **Domain age**: the first capture date is a good proxy for how long a site has existed.

### Input example

```json
{"urls": ["example.com"], "matchType": "exact", "collapse": "content", "statusCode": "200", "from": "2020", "maxResults": 100}
```

### Output example (real row, cloud run dvlsfgXGp0w8sPgkb)

```json
{"target": "example.com", "url": "https://www.example.com/", "timestamp": "20200101213728", "capturedAt": "2020-01-01T21:37:28Z", "archiveUrl": "https://web.archive.org/web/20200101213728/https://www.example.com/", "statusCode": "200", "mimeType": "text/html", "digest": "JI6OR3QR4CI526JD6TMMNZNV4QPMPQCH", "length": 1248}
```

### Honest limits

- **Domain-wide searches of very large sites can time out on the Internet Archive's side** (its CDX server answers HTTP 504 after about 60 s, e.g. `matchType: domain` on a big domain). The actor retries with backoff and stops cleanly before your run timeout with a clear message; nothing is charged per capture if nothing came back. Use `exact` or `prefix`, or add `from`/`to`, for big sites.
- Capture metadata only, not page content.
- Domain-wide and prefix queries on big sites are slow because the Internet Archive's CDX API is rate-limited; use `from`/`to`, `collapse` and `maxResults`, or give the run a longer timeout.
- If the Archive returns HTTP 429 or is down, the run backs off and stops with a clear message.

### How much does it cost?

Pay per result: **$0.002 per capture row** plus a small start fee. 10,000 archived URLs cost about $20, and you can cap spend with `maxResults`. No subscription.

### Fair use of the Internet Archive

The actor uses the public CDX API as documented by the Internet Archive and is deliberately polite: one request at a time, at least 2 seconds apart, large pages with resume keys (so fewer requests), automatic back-off on HTTP 429, and a descriptive User-Agent. It returns **capture metadata only**: it does not download or republish archived page content. Archived pages stay on web.archive.org; respect the rights of the original site owners when you open them. Consider [donating to the Internet Archive](https://archive.org/donate) if it is useful to you.

### FAQ

**Why fewer results than the Wayback website shows?** Filters, the date range and `collapse` reduce rows; very recent captures can take time to be indexed.

**Why is a domain-wide query slow?** Domain/prefix queries with filters or dedupe are scanned server-side by the Internet Archive and can take a minute or more per page; the actor logs each page.

**Can it get the page text?** No, by design. Open `archiveUrl` to view a capture.

**Can I run it on a schedule?** Yes, through Apify schedules, the API, Make, Zapier or Google Sheets.

### Use it from code, AI agents and automations

The same input as the form above works everywhere. Results are the run's dataset (JSON, CSV, Excel). You need an Apify API token (Console → Settings → API & Integrations).

**Python** (`pip install apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("stazis/wayback-snapshots-api").call(run_input={
  "urls": [
    "apify.com"
  ],
  "maxResults": 20
})
for item in client.dataset(run.default_dataset_id).iterate_items():  # apify-client < 3: run["defaultDatasetId"]
    print(item)
```

**JavaScript / TypeScript** (`npm i apify-client`)

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('stazis/wayback-snapshots-api').call({
  "urls": [
    "apify.com"
  ],
  "maxResults": 20
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**HTTP, one call** (waits for the run, up to 5 minutes, and returns the items)

```bash
curl -X POST "https://api.apify.com/v2/acts/stazis~wayback-snapshots-api/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"urls": ["apify.com"], "maxResults": 20}'
```

**AI agents (MCP).** This Actor runs with limited permissions, so AI agents can use it through the hosted Apify MCP server (Claude, Cursor, VS Code, Codex and other MCP clients). Add this to your MCP client config and sign in with Apify on first use:

```json
{ "mcpServers": { "wayback-snapshots-api": { "url": "https://mcp.apify.com?tools=stazis/wayback-snapshots-api" } } }
```

Agents without an Apify account can pay per run in USDC through [agi.apify.com](https://agi.apify.com) (x402). Pricing is pay-per-event, so an agent pays only for the results it gets.

**LangChain** (`pip install langchain-apify`, set `APIFY_TOKEN`): `from langchain_apify import ApifyActorsTool` and `tool = ApifyActorsTool("stazis/wayback-snapshots-api")` gives your agent this Actor as a tool.

**No-code and scheduling:** use the Apify app in Make, n8n or Zapier ("Run an Actor", then pick `stazis/wayback-snapshots-api`), or create a Schedule in Apify Console to run it daily and send results to a webhook, Slack or Google Drive through Apify integrations.

### Related actors by stazis

Domain RDAP/WHOIS API, VIN Decoder API, SEC EDGAR Filings API, OpenAlex API.

# Actor input Schema

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

Pages, paths or domains to look up, e.g. 'example.com' or 'example.com/blog/'.

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

How to match each entry. 'domain' lists every archived URL on the domain and its subdomains.

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

Collapse adjacent captures. 'One row per unique URL' is the classic archived-URL extractor.

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

Earliest capture, YYYY, YYYY-MM or YYYY-MM-DD.

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

Latest capture, YYYY, YYYY-MM or YYYY-MM-DD.

## `statusCode` (type: `string`):

Keep only captures with this status, e.g. '200'. Regex allowed, e.g. '\[23]..'.

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

Keep only this MIME type, e.g. 'text/html' or 'application/pdf'.

## `maxPerUrl` (type: `integer`):

Stop each entry after this many rows (0 = no per-entry limit).

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

Stop the whole run after this many rows (controls cost).

## `pageSize` (type: `integer`):

CDX page size (max 10,000). Requests are sent one at a time, at least 2 s apart, to respect archive.org limits.

## Actor input object example

```json
{
  "urls": [
    "apify.com"
  ],
  "matchType": "exact",
  "collapse": "none",
  "maxPerUrl": 0,
  "maxResults": 20,
  "pageSize": 5000
}
```

# 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": [
        "apify.com"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("stazis/wayback-snapshots-api").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"],
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("stazis/wayback-snapshots-api").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"
  ],
  "maxResults": 20
}' |
apify call stazis/wayback-snapshots-api --silent --output-dataset

```

## MCP server setup

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

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/781MBMBUchKfy2EiP/builds/8pWgJBHExtg7EH0jf/openapi.json
