# Snapshot History for the Wayback Machine: URLs & Domains (`forgeloop/wayback-snapshots`) Actor

List archived snapshots of URLs and domains from the Internet Archive Wayback Machine: date, archive link, status code, MIME type, digest and size. Filter by date, status and type, keep one per day, month or year, or get the one closest to a date. Pay per snapshot.

- **URL**: https://apify.com/forgeloop/wayback-snapshots.md
- **Developed by:** [Markus Heiß](https://apify.com/forgeloop) (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 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

## Snapshot History for the Wayback Machine: URLs & Domains

List the archived snapshots of a URL, a folder, a host or a whole domain from the Internet Archive Wayback Machine. Get back one row per snapshot with the capture date, the archived URL, a link to the archived copy, the status code, the MIME type, the content digest and the size. Or ask for the one snapshot closest to a date.

Built for domain history checks, due diligence, content research, SEO recovery of old URLs and evidence of how a site looked in the past. The Actor reads only the index of the archive through the official public APIs. It does not download archived pages.

Not affiliated with the Internet Archive. All snapshot data comes from the [Internet Archive Wayback Machine](https://web.archive.org).

### What it does

- **Lists snapshots** through the Wayback CDX Server API: for one URL (`exact`), all URLs under a path (`prefix`), a host (`host`) or a domain with all subdomains (`domain`).
- **Filters** by date range (`from`, `to`), HTTP status codes (`200`, `3xx`) and MIME types (`text/html`, `application/pdf`, `image/*`).
- **Collapses** results to one snapshot per hour, day, month or year, one per unique URL, or only the snapshots whose content changed (same digest is dropped).
- **Finds the closest snapshot** to a date for each URL through the Wayback Availability API, then reads its MIME type, digest and size from the CDX index. When the Availability API answers with no snapshot, the Actor asks the CDX index once more.
- **Pages through large results** with the CDX resume key, up to 100,000 snapshots per target. When the limit stops a query, the summary holds the resume key to continue in a later run.
- **Summary per target** in the key-value store: first seen, last seen, number of snapshots, unique URLs and snapshots per year.
- **Gentle with the archive:** at most 1 request per second for the whole run, exponential backoff (2, 4, 8, 16 s) on HTTP 429 and 5xx answers, and it waits longer when the archive sends Retry-After. When the archive stays down, the target gets a clear error item and the run skips the rest instead of hammering the service.

### Use cases

- **Domain history:** see when a domain was first archived, how often and in which years, before you buy it or work with it.
- **Due diligence:** check how long a company website has existed and how it changed.
- **Content research:** list all archived pages under a folder, find old PDFs or press releases with the MIME type filter.
- **SEO recovery:** find old URLs of a site from its archive (`domain` match, collapse `urlkey`, status `200`) to set up redirects after a migration or to recover lost content.
- **Legal evidence of past site states:** get the snapshot closest to a date, with its exact capture time and the archive link to cite.

### Input

| Field | Description | Default |
|---|---|---|
| URLs or domains | `example.com`, `https://www.python.org/about/`, `*.example.com` (domain), `example.com/blog/*` (prefix) | |
| Mode | `snapshots` or `closest` | `snapshots` |
| Match type | `exact`, `prefix`, `host` or `domain` | `exact` |
| From date, To date | Date range like `2015`, `2015-06` or `2015-06-01` | all |
| Collapse | `none`, `digest`, `urlkey`, `hour`, `day`, `month`, `year` | `none` |
| Max snapshots per target | 1 to 100,000, oldest first | 100 |
| Status codes | Like `200`, `301`, `3xx` | all |
| MIME types | Like `text/html`, `application/pdf`, `image/*` | all |
| Closest to date | Closest mode: date to search around. Empty means the newest snapshot. | |
| Summary per target | Store the summary under `OUTPUT` | on |
| Resume key | Continue an earlier query that hit the limit | |
| Timeout | Seconds per request, 10 to 300 | 90 |

Example, one snapshot per year of all HTML pages on python.org and its subdomains:

```json
{
  "targets": ["python.org"],
  "matchType": "domain",
  "collapse": "year",
  "statusCodes": ["200"],
  "mimeTypes": ["text/html"],
  "limit": 30
}
```

Example, the snapshot of each page closest to 1 June 2015:

```json
{
  "targets": ["https://www.python.org/about/", "example.com"],
  "mode": "closest",
  "closestTo": "2015-06-01"
}
```

### Output

One dataset item per snapshot:

```json
{
  "target": "apify.com",
  "matchType": "exact",
  "mode": "snapshots",
  "timestamp": "20070531101538",
  "capturedAt": "2007-05-31T10:15:38Z",
  "original": "http://www.apify.com:80/",
  "archiveUrl": "https://web.archive.org/web/20070531101538/http://www.apify.com:80/",
  "rawArchiveUrl": "https://web.archive.org/web/20070531101538id_/http://www.apify.com:80/",
  "statusCode": 200,
  "mimeType": "text/html",
  "digest": "EE6FCHP3MKBC3EV5D5Q4WQJNZNVUTNU6",
  "lengthBytes": 1013,
  "urlkey": "com,apify)/",
  "requestedDate": null,
  "error": null
}
```

- `timestamp` is the raw 14 digit Wayback timestamp (UTC), `capturedAt` the same as ISO date.
- `archiveUrl` opens the snapshot in the Wayback Machine. `rawArchiveUrl` (the `id_` form) returns the archived file as it was captured, without the Wayback toolbar and without rewritten links.
- `statusCode` is the HTTP status the site answered with at capture time. It is `null` for revisit records (`mimeType` `warc/revisit`), where the archive stored only a pointer to an earlier identical capture.
- `lengthBytes` is the compressed size of the record in the archive, not the size of the page.
- `digest` is the SHA-1 content hash in base32. The same digest means the same content.
- `requestedDate` is the date you asked for in closest mode.
- A target without snapshots or with an error returns one item with `error` set, for example `No archived snapshots found for this target and these filters.`

The key-value store record `OUTPUT` holds one summary per target:

```json
{
  "target": "apify.com",
  "matchType": "exact",
  "snapshots": 100,
  "uniqueUrls": 1,
  "firstSeen": "2007-05-31T10:15:38Z",
  "lastSeen": "2018-05-30T11:58:49Z",
  "years": { "2007": 3, "2008": 1, "2011": 3, "2012": 2, "2013": 2, "2014": 2, "2015": 2, "2016": 4, "2017": 28, "2018": 53 },
  "query": "https://web.archive.org/cdx/search/cdx?url=apify.com&output=json&fl=urlkey%2Ctimestamp%2Coriginal%2Cmimetype%2Cstatuscode%2Cdigest%2Clength&limit=100&showResumeKey=true",
  "limitReached": true,
  "nextResumeKey": "eJxLzs_VSSzITKvU1FcwMjC0MDA1NjA0NLUwsQQAaT8GzA",
  "error": null
}
```

The summary counts the snapshots delivered in this run. When `limitReached` is `true`, more snapshots exist: raise the limit, or run again with the same settings and `nextResumeKey` as the resume key.

Export the dataset as JSON, CSV or Excel, or read it through the Apify API.

### Pricing

Pay per snapshot: 0.001 USD per delivered snapshot, so 1.00 USD per 1,000 snapshots. Targets without snapshots, invalid inputs and errors are free. Set Max snapshots per target or the maximum charge in Apify to cap the cost of a run. Use collapse to get fewer, more useful rows.

Each run also has a start fee of 0.00005 USD per GB of memory, which Apify shows as Actor Start.

### Limits

- Speed depends on the Internet Archive. A query for one URL takes about a second. `domain` and `prefix` queries on large sites can take a minute. The Actor sends at most 1 request per second, so many targets take a while.
- Very large `prefix`, `host` or `domain` queries (for example every URL ever archived under `example.com`) can time out at the archive with HTTP 504. The Actor tries such a query 3 times, then returns an error item. Narrow the target or add a date range.
- Results are sorted by URL and then by capture time, oldest first.
- Collapse compares each capture with the one before it in the result list. For one URL this gives exactly one snapshot per period. With `prefix`, `host` and `domain` matching the list holds many URLs in a row, so a capture is also dropped when the previous URL has a capture in the same period. Use `urlkey` to get one row per unique URL.
- Sites that asked to be excluded from the Wayback Machine return an error item (HTTP 403).
- In closest mode the Availability API decides which capture is the closest. The Actor does not check this choice against the CDX index.
- The Internet Archive sometimes slows down or blocks automated traffic during load peaks. The Actor then retries with growing pauses and reports an error item if the service stays unavailable.
- Metadata only. The Actor never downloads archived pages or files.

### Data source, permitted use and legal

- **Data source:** The index of the [Internet Archive Wayback Machine](https://web.archive.org), read through its public [CDX Server API](https://github.com/internetarchive/wayback/tree/master/wayback-cdx-server) and [Availability API](https://archive.org/help/wayback_api.php). All credit for the archive goes to the Internet Archive. This Actor is not affiliated with or endorsed by the Internet Archive.
- **Metadata only:** The Actor returns capture dates, URLs, status codes, MIME types, digests and sizes from the index. It does not download, copy or store archived content. Archived pages remain subject to the rights of their owners and the terms of the Internet Archive.
- **Snapshot:** Results show the archive index at the time of the run. We do not guarantee that they are complete, current or correct.
- **For business use:** This Actor is offered to businesses only, not to consumers.
- **Permitted use:** Look up only URLs and domains you have a legitimate reason to check. Respect the [terms of use of the Internet Archive](https://archive.org/about/terms).
- **Your responsibility:** You choose the targets and decide what happens with the results. If your input or the results contain personal data, you are the controller and need your own legal basis. Archived URLs can contain names or other personal data from the original sites.
- **No circumvention:** The Actor uses public, unauthenticated endpoints only. It does not bypass rate limits, blocks or access restrictions.
- **Request volume:** At most 1 request per second for the whole run, exponential backoff on HTTP 429 and 5xx, and it stops when the archive stays unavailable. Do not use it to put excessive load on the Internet Archive.
- **Provider:** forgeloop, Markus Heiss, Austria. [Imprint](https://devhem.github.io/forgeloop-legal/imprint.html), [Privacy Notice](https://devhem.github.io/forgeloop-legal/privacy.html), [Terms of Use](https://devhem.github.io/forgeloop-legal/terms.html).

### Questions and issues

Open an issue on the Actor page.

# Actor input Schema

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

URLs or domains to look up, like "example.com" or "https://www.python.org/about/". A value like "*.example.com" uses domain matching and "example.com/blog/*" uses prefix matching, whatever the match type below says. Duplicates are removed. Format: a list of strings.

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

snapshots: list the archived snapshots of each target. closest: return the one snapshot of each URL closest to the date below, or the newest one when the date is empty.

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

Snapshots mode only. exact: only this URL. prefix: all URLs that start with this URL, for example a folder. host: all URLs on this host name. domain: all URLs on the domain and its subdomains.

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

Snapshots mode only. First capture date to include, like 2015, 2015-06 or 2015-06-01. Empty means from the start.

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

Snapshots mode only. Last capture date to include, like 2020, 2020-12 or 2020-12-31. Empty means up to today.

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

Snapshots mode only. Keep one snapshot per hour, day, month or year, one per unique URL, or only snapshots whose content changed (digest). Collapsing compares each capture with the one before it in the list. The README explains how this works with prefix, host and domain matching.

## `limit` (type: `integer`):

Snapshots mode only. Stop after this many snapshots per target, oldest first. Every snapshot is one charged result, so this also caps the cost.

## `statusCodes` (type: `array`):

Snapshots mode only. Keep only snapshots with these HTTP status codes, like 200, 301 or 3xx. Empty keeps all.

## `mimeTypes` (type: `array`):

Snapshots mode only. Keep only snapshots of these types, like text/html, application/pdf or image/\*. Empty keeps all.

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

Closest mode only. Date to search around, like 2010, 2010-06-15 or 20100615. Empty returns the newest snapshot.

## `includeSummary` (type: `boolean`):

Store first seen, last seen, count and snapshots per year for each target in the key-value store under OUTPUT. Free.

## `resumeKey` (type: `string`):

Continue an earlier query that hit the limit. Copy nextResumeKey from the summary of that run and keep the single target and all other settings the same.

## `timeoutSecs` (type: `integer`):

Give up on one request after this many seconds without an answer. Large domain queries can take a minute. Failed requests are retried with a growing pause.

## Actor input object example

```json
{
  "targets": [
    "apify.com",
    "https://www.python.org/about/"
  ],
  "mode": "snapshots",
  "matchType": "exact",
  "collapse": "none",
  "limit": 100,
  "includeSummary": true,
  "timeoutSecs": 90
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "targets": [
        "apify.com",
        "https://www.python.org/about/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgeloop/wayback-snapshots").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": [
        "apify.com",
        "https://www.python.org/about/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("forgeloop/wayback-snapshots").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": [
    "apify.com",
    "https://www.python.org/about/"
  ]
}' |
apify call forgeloop/wayback-snapshots --silent --output-dataset

```

## MCP server setup

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

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/a30hpuBjHMUGKpowr/builds/t2N4XIqWgfXkH51bX/openapi.json
