# Wayback Machine Scraper - Snapshots, URLs, History & Content (`martin10291/wayback-machine-scraper`) Actor

Wayback Machine data in one table. No API key, no login, no proxy: official open API. Snapshot timeline of any page (only content changes), every archived URL of a domain with file-type filters, domain history (age, captures per year, gaps), archived page text as Markdown.

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

## Pricing

from $0.70 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 - Snapshots, URLs, History & Content

Get **Internet Archive Wayback Machine** data in one clean table: the **snapshot timeline of any page** (only the versions where the content changed), **every archived URL of a domain** (with file-type filters), a **domain history summary** (first and last capture, age, captures per year, gaps), and the **text of any archived page as clean Markdown**, ready for AI and LLMs.

It uses only the **official Internet Archive APIs** (CDX and availability API): no login, no API key, no browser. Polite rate limits, automatic retries when the archive is busy.

### What you get

- **Snapshots**: capture time, URL, HTTP status, MIME type, content hash, size, the Wayback link and the raw (no toolbar) link. Collapse to **one per content change**, hour, day, month or year.
- **All archived URLs of a domain**: every unique page and file the archive has ever seen, with first capture date, status and MIME type. Filter by **file extension** (pdf, xml, js, json, zip...), MIME type and date. Tracking parameters are removed automatically.
- **Domain history**: first and last capture, years on the archive, days with captures, distinct versions, **captures per year**, **years without captures** (dark periods), status code breakdown and links to every year. Perfect for **vetting expired domains** before you buy.
- **Archived page content**: the version closest to any date (or the latest), with title, meta description, canonical URL, language, H1s, **Markdown text** (headings, paragraphs, lists), word count and optional outgoing links.
- **Only-new mode**: each snapshot or URL is returned and paid for once. Schedule it to get alerts when the archive captures new versions or new pages.

### Use cases

- **SEO**: recover lost pages and old URLs for redirect maps, find content that ranked before a migration, check the history of an expired domain.
- **Content recovery**: get the text of deleted pages, old blog posts, discontinued product pages and dead websites.
- **Competitor research**: see how a competitor's pricing page, homepage or product copy changed over the years.
- **OSINT, legal and compliance**: prove what a page said on a given date, with archive links as evidence.
- **AI and RAG**: feed historical web content to LLMs as clean Markdown, not raw HTML.
- **Security research**: list old endpoints, JS files and documents of your own domains.

### Input examples

**Every content change of a pricing page since 2020:**

```json
{ "mode": "snapshots", "urls": ["https://www.notion.so/pricing"], "collapse": "changes", "dateFrom": "2020" }
```

**All archived PDF files of a domain:**

```json
{ "mode": "urls", "urls": ["example.com"], "fileExtensions": ["pdf"] }
```

**Expired domain check (bulk):**

```json
{ "mode": "history", "urls": ["domain-one.com", "domain-two.net"] }
```

**Text of a page as it looked in 2015:**

```json
{ "mode": "content", "urls": ["https://www.python.org/about/"], "snapshotDate": "2015-06-01" }
```

Wayback links work as input too, for example `https://web.archive.org/web/2012/http://digg.com/`.

### Output example (content mode)

```json
{
  "url": "https://www.python.org/about/",
  "capturedAt": "2015-06-27T14:07:07Z",
  "archiveUrl": "https://web.archive.org/web/20150627140707/https://www.python.org/about/",
  "title": "About Python™ | Python.org",
  "metaDescription": "The official home of the Python Programming Language",
  "wordCount": 393,
  "markdown": "..."
}
```

### Pricing

**$1.00 per 1,000 results.** A domain history summary or one archived page counts as one result.

### Tips

- Very large domains (millions of archived URLs) are slow on the archive side: roughly 500 URLs every 5-40 seconds. Use `maxItems` and date filters to keep runs short.
- For huge domains the archive may refuse a subdomain-wide query. The actor then falls back to the main host automatically and notes it in `RUN_SUMMARY`.
- `RUN_SUMMARY` in the key-value store shows counts, URLs that are not archived and the last error.

### FAQ

**Is it legal?** The actor reads public data through the Internet Archive's official, documented APIs, at a polite rate.

**Do I need an archive.org account or API key?** No.

**Can I use it from AI agents?** Yes. Every Apify Actor is also available as an MCP tool via mcp.apify.com.

### Use it as an integration (chain it after another actor)

This actor can run automatically after any actor whose results contain a website or domain.

1. Open the source actor in Apify Console and go to the **Integrations** tab.
2. Click **Add integration** -> **Actor**, pick this actor and set **Dataset** to `{{resource.defaultDatasetId}}` (leave `urls` empty). Set your other options and save.
3. When the source run finishes, this actor reads its dataset and processes every row. The field is detected automatically; set **Dataset field** if your column has another name.

You can also start it by hand with `datasetId` (pick a dataset or paste its ID) to process an existing dataset.

Good sources to chain from:

- compass/crawler-google-places (Google Maps Scraper)
- martin10291/local-business-leads-osm
- martin10291/domain-whois-dns-lookup
- any list of domains

# Actor input Schema

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

Snapshots of a page, every archived URL of a domain, a domain history summary (first/last capture, captures per year, gaps), or the text of an archived page as Markdown.

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

Pages or domains, e.g. apify.com, https://example.com/pricing. Wayback links (web.archive.org/web/...) work too.

## `dateFrom` (type: `string`):

Only captures from this date: 2020, 2020-05 or 2020-05-17. Empty = from the first capture.

## `dateTo` (type: `string`):

Only captures up to this date: 2023, 2023-12 or 2023-12-31. Empty = until today.

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

'Content change' returns only versions whose content changed (best for change tracking). Day/month/year return at most one capture per period.

## `onlySuccessful` (type: `boolean`):

Skip redirects, 404s and errors (snapshots and URLs modes).

## `includeSubdomains` (type: `boolean`):

On = every archived URL on the domain and all subdomains. Off = only URLs that start with the given URL (path prefix).

## `ignoreQueryStrings` (type: `boolean`):

On = one row per page path (drops duplicates like ?utm_source=... or session IDs). Off = every distinct URL including query strings.

## `fileExtensions` (type: `array`):

Only URLs ending with these extensions, e.g. pdf, xml, js, json, zip. Empty = all.

## `maxScannedRows` (type: `integer`):

Safety limit: max archived rows read per URL in URLs mode. Large sites are read from the compressed index page by page (a few thousand rows each).

## `maxSeconds` (type: `integer`):

URLs mode stops after this many seconds and returns what it found (large sites are sampled across the whole archive index). Raise it for fuller lists of huge domains.

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

Regex on the MIME type, e.g. text/html or application/pdf. Empty = all.

## `snapshotDate` (type: `string`):

Return the capture closest to this date, e.g. 2019-06-01. Empty = the latest capture.

## `maxContentChars` (type: `integer`):

Maximum length of the Markdown text per page.

## `includeLinks` (type: `boolean`):

Add the list of outgoing links found on the archived page (original URLs, not archive URLs).

## `onlyNew` (type: `boolean`):

Return only snapshots/URLs not returned by earlier runs with the same Monitor ID. Schedule the Actor to get alerts about new captures or newly archived URLs.

## `monitorId` (type: `string`):

Name for the only-new memory, so several monitors can run independently.

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

Stop after this many results in total.

## `datasetId` (type: `string`):

Optional. Pick a dataset (or paste its ID) to read the input from, for example the result of Google Maps Scraper. When this actor runs as an integration, the dataset of the triggering run is used automatically (payload.resource.defaultDatasetId), so you can leave this empty. If set, the values found in the dataset replace the main input list.

## `datasetField` (type: `string`):

Optional. The item field that holds the value, for example website, url or videoUrl (dot paths like author.url work). Empty = detected automatically.

## `datasetMaxItems` (type: `integer`):

Upper limit of unique values taken from the dataset, to keep the cost under control.

## Actor input object example

```json
{
  "mode": "snapshots",
  "urls": [
    "apify.com"
  ],
  "collapse": "changes",
  "onlySuccessful": true,
  "includeSubdomains": true,
  "ignoreQueryStrings": true,
  "maxScannedRows": 20000,
  "maxSeconds": 70,
  "maxContentChars": 50000,
  "includeLinks": false,
  "onlyNew": false,
  "monitorId": "default",
  "maxItems": 1000,
  "datasetMaxItems": 1000
}
```

# Actor output Schema

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

Wayback snapshots, archived URLs, domain history or archived page content.

# 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 = {
    "mode": "snapshots",
    "urls": [
        "apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("martin10291/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 = {
    "mode": "snapshots",
    "urls": ["apify.com"],
}

# Run the Actor and wait for it to finish
run = client.actor("martin10291/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 '{
  "mode": "snapshots",
  "urls": [
    "apify.com"
  ]
}' |
apify call martin10291/wayback-machine-scraper --silent --output-dataset

```

## MCP server setup

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