# Wayback Machine API - Snapshot History & Archive Links (`scrape_api/wayback-machine`) Actor

Search Wayback Machine snapshots for URLs and domains. Get capture dates, original URLs, status codes, MIME types, content digests and archive links, with filters, pagination and optional exact-URL summaries.

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

## Pricing

from $1.00 / 1,000 wayback machine 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 API

The Wayback Machine API returns archived snapshot references for URLs and domains. Collect capture timestamps, original URLs, HTTP status codes, MIME types, content digests and working archive links in a structured dataset. Add an optional history summary for the exact input URL when you need its first and last capture and all-time capture counts.

Use the results for expired-domain research, historical content inventories, link audits, public-source investigations and preparing references for a document review. Each snapshot row points to an archived capture. The actor returns metadata and links; it does not download the archived page body or certify the accuracy of historical content. Open the capture and verify its context before relying on it.

### Wayback Machine API input

Provide `urls` as a list of URLs or domains. A string with one entry per line or entries separated by commas also works. The singular `url` field is an alias when `urls` is absent. A run accepts up to 100 entries and removes repeated identical inputs. Use a list when a URL itself contains a comma.

This input uses the same public URL as the included source response:

```json
{"urls":["example.com"],"max_items":5}
```

`match_type` defaults to `exact`. Choose `prefix` for URLs beginning with a path, `host` for one hostname or `domain` to include subdomains. Exact searches are generally faster. Broad searches can be slow, and results are ordered by the archive's URL index key and then capture time. A domain search is therefore not a globally chronological history: its first row does not establish the domain's oldest capture.

Set `date_from` and `date_to` to inclusive boundaries in `YYYY`, `YYYY-MM`, `YYYY-MM-DD` or the archive's 14-digit timestamp form. Invalid dates and reversed ranges are rejected. `status_filter` accepts a specific status or status family, including `200`, `2xx`, `9xx`, `999`, `!404` and `!4xx`. Selecting `200` excludes `warc/revisit` entries whose source status is missing. `mime_filter` accepts a MIME type such as `text/html` or a wildcard such as `text/*`.

`collapse` supports `none`, `digest`, `url`, `hour`, `day`, `month` and `year`. These are archive-side grouping choices. Digest grouping combines consecutive equal digests; it does not promise one globally unique content digest across an entire site. Exact duplicate snapshot records are removed independently of this setting.

Use `latest_only: true` only with `match_type: "exact"`. It selects the newest capture records, with at most 5,000 source records per input URL and no continuation within that URL. Use ordinary pagination when you need more of the history. `max_items` defaults to 1,000 and limits the total delivered rows across all inputs, including summaries. The maximum requested total is 200,000; the archive may have fewer matching records.

### Output and export

Every snapshot has `record_type: "snapshot"` and `_type: "web_snapshot"`. The core fields are `source`, `provider`, `fetched_at`, `original_url`, `captured_at` and `archive_url`. Additional fields include the original `timestamp`, `urlkey`, `status_code`, `mimetype`, `digest`, `length`, `raw_url`, `input_url` and stable `record_id`.

The real first capture in the included `example.com` response looks like this:

```json
{
  "source": "wayback-machine",
  "provider": "wayback_machine",
  "fetched_at": "2026-11-06T13:14:25.983Z",
  "_type": "web_snapshot",
  "record_type": "snapshot",
  "record_id": "snapshot:52ebbb1717c26860ec7f0359cb59f4f1938274e9d34818aa556a0d851e1e919e",
  "input_url": "example.com",
  "timestamp": "20020120142510",
  "captured_at": "2002-01-20T14:25:10Z",
  "original_url": "http://example.com:80/",
  "urlkey": "com,example)/",
  "mimetype": "text/html",
  "digest": "HT2DYGA5UKZCPBSFVCV3JOBXGW2G5UUA",
  "length": 1792,
  "status_code": 200,
  "archive_url": "https://web.archive.org/web/20020120142510/http://example.com:80/",
  "raw_url": "https://web.archive.org/web/20020120142510id_/http://example.com:80/"
}
```

The `raw_url` adds `id_` after the timestamp to request the original representation. The `record_id` is stable across runs, so the same capture keeps the same identity when you re-run the input.

A revisit record can have `status_code: null`; this means the archive did not supply a status, not that the status was zero. Status codes are passed through exactly as the source reports them, including non-standard values such as 999. `length` is the compressed archive record size in bytes, not the uncompressed page length. Source MIME labels such as `unk` or `unknown` remain unchanged. Archived URLs are preserved as supplied, so review exported URLs before redistributing them.

Enable `include_summary` for a row with `record_type: "summary"` and `_type: "web_snapshot_summary"` before the snapshots of each input. Its `scope` is always `url`: even in a domain search, it describes the exact input URL rather than every page on the domain. The summary covers all available history and ignores snapshot date, status and MIME filters. It contains first and last capture times and, when available, `total_captures` and `captures_by_year`. When counting is unavailable, a fallback can return the capture boundaries without totals. Missing totals are omitted, never invented as zero.

Results appear in the default dataset and can be exported using Apify's dataset formats. The `OUTPUT` record contains collection status and any remaining continuation cursor. Large jobs are collected in pages automatically. If a run stops early, retain `next_cursor` and repeat the same input with that value as `cursor`. Keep filters, input ordering and `max_items` unchanged.

### Use cases for the Wayback Machine API

**Expired-domain research.** Before buying a dropped domain, list its captures and see when the site went offline, which status codes it returned near the end and whether it served malware pages or soft-404s. `date_to` narrows the run to the period you care about, and `status_filter: "!4xx"` separates working pages from error pages.

**Historical content inventories.** Site migrations lose URLs. Search the domain with `match_type: "domain"`, keep `original_url` and `captured_at`, and you have a dated list of every page the archive ever saw — including pages that were removed from the live site years ago. Combine `collapse: "url"` with a large `max_items` for a one-row-per-URL inventory.

**Link audits and reclamation.** Filter to `status_filter: "200"` for a domain and cross-reference it with your own outbound links to find which of them still resolve in the archive even though the target is dead now, or the other way around: pages on your own site that still earn links to URLs you deleted.

**Change history and drift detection.** Group with `collapse: "digest"` and compare digests over time: a repeated digest means the archive stored the same content twice, a new digest means the page changed. `captures_by_year` in the summary shows at a glance how actively a URL was archived.

**OSINT and legal evidence.** Each row carries the capture timestamp, the original URL, the status code, the content digest and the archive link, so a citation in a report or a filing points at one specific capture instead of "the Wayback Machine". The summary row gives first and last capture for the exact URL you asked about.

### Wayback Machine API compared with the alternatives

| What you could use | What you get | What you still have to do yourself |
|---|---|---|
| The archive's own index endpoint, called directly | Raw rows in the archive's own column order | Write and maintain the query loop, resume the cursor when a page stops, normalize timestamps, deduplicate, and turn the result into a dataset you can export |
| A Python or Node client library (for example `waybackpy` or the CDX client in the `wayback` package) | The same index behind a function call | Pagination, retries, filtering and result caps live in your script; every archive-side change becomes your maintenance |
| Other Wayback Machine actors in the Apify Store | A runnable actor with its own field set and its own pricing per result | You compare field coverage first: not every actor exposes `status_code`, `digest` and `length` alongside the archive link |
| The Wayback Machine website, one URL at a time | A human-readable page per capture | Nothing that scales: no bulk list, no date range, no export |

This actor is the middle row of that table with the Store in front of it: one run takes up to 100 URLs or domains, applies date, status and MIME filters before delivery, resumes from `next_cursor` when a run stops, and pushes stable, typed rows into an Apify dataset with optional summaries — without you maintaining a query loop against an endpoint that changes without notice.

### Pricing and result limits

The pricing tab on this actor is the authority for current rates. Snapshot rows use the `snapshot` event; optional summary rows use `domain_summary`. Only delivered rows are counted, after deduplication and the applicable result cap. A summary counts toward `max_items` and the run's row limit. Overlapping inputs (for example a domain search plus one of its subdomains) match some of the same captures: those rows are delivered and charged once, so the unique total can be lower than `max_items`. Empty results produce no row charges. Any platform start fee shown in the pricing tab is separate.

Non-paying users receive at most 10 rows per run. This cap includes summary rows and preserves their position before snapshots. A partial result or a warning identifies source information that could not be collected; it does not make up missing history.

### FAQ

#### Does a domain search return the oldest snapshot first?

No. Broad searches follow URL index order, then time within each indexed URL. Use an exact URL search for a chronological sequence and inspect archive links when comparing captures.

#### Does the summary cover every page on a domain?

No. Its explicit `scope: "url"` applies to the exact URL supplied. It is an all-time URL summary, independent of the snapshot filters. It must not be presented as a complete domain-wide first or last capture.

#### Can this actor download all archived HTML?

It delivers capture metadata and links. Open `archive_url` for the replay or use `raw_url` for the original representation. Bulk content downloading is outside this actor's output.

#### Why can an archived site return no rows or a restriction?

The selected date or status filters can exclude all captures. Some sites are restricted by the archive. Temporary archive failures may also prevent a page from completing. Warnings and error messages distinguish those cases, and a retained cursor lets you resume unfinished collection.

# Actor input Schema

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

One to 100 URLs or domains. Text accepts comma or newline separation.

## `url` (type: `string`):

Alias for one URL when urls is absent.

## `match_type` (type: `string`):

exact is fastest; domain includes subdomains and is slower. Broad results follow URL-key order, then time.

## `date_from` (type: `string`):

Inclusive start: YYYY, YYYY-MM, YYYY-MM-DD or a 14-digit archive timestamp.

## `date_to` (type: `string`):

Inclusive end: YYYY, YYYY-MM, YYYY-MM-DD or a 14-digit archive timestamp.

## `status_filter` (type: `string`):

HTTP status selection: 200, 2xx, 9xx, 999, !404 or !4xx. The source itself reports 999 on some captures. A 200 filter excludes revisit records.

## `mime_filter` (type: `string`):

MIME selection such as text/html or text/\*. Raw regular expressions are not accepted.

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

Source-side grouping; digest groups consecutive identical digests only.

## `latest_only` (type: `boolean`):

Return newest captures of an exact URL, at most 5000 source records per URL, without CDX continuation.

## `max_items` (type: `integer`):

Total delivered rows across all inputs, including optional summaries. Continuations must preserve this value. Overlapping inputs deliver shared captures once, so the unique total can be lower than requested.

## `include_summary` (type: `boolean`):

Add an all-time summary of each exact input URL before its snapshots. Summary ignores snapshot filters and match_type; scope is always url.

## `cursor` (type: `string`):

Opaque next_cursor from the preceding response. Resend the same input, including max_items.

## Actor input object example

```json
{
  "urls": [
    "example.com"
  ],
  "match_type": "exact",
  "collapse": "none",
  "latest_only": false,
  "max_items": 1000,
  "include_summary": false
}
```

# Actor output Schema

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

One row per snapshot or optional exact-URL summary.

## `output` (type: `string`):

Run counts, warnings and any remaining continuation cursor.

## `errors` (type: `string`):

Redacted errors when a source request could not complete.

# 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("scrape_api/wayback-machine").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("scrape_api/wayback-machine").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 scrape_api/wayback-machine --silent --output-dataset

```

## MCP server setup

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

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/mBeOfaOv7g4ombu4n/builds/Fx6cfHJlf5giGcaif/openapi.json
