# Expired Domain Content Recovery from the Wayback Machine (`turboextract/wayback-site-recovery`) Actor

Restore every page of an expired, deleted or redesigned website from the Internet Archive as clean Markdown with titles, meta descriptions, headings and links. Built for SEOs, expired-domain investors and site owners recovering lost content.

- **URL**: https://apify.com/turboextract/wayback-site-recovery.md
- **Developed by:** [Moses Ndambuki](https://apify.com/turboextract) (community)
- **Categories:** SEO tools, Marketing
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 archived page recovereds

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

## Expired Domain Content Recovery from the Wayback Machine

**Restore every page of an expired, deleted or redesigned website from the Internet Archive as clean Markdown, with titles, meta descriptions, headings, links and images.** Built for SEOs rebuilding expired domains, domain investors checking a domain's past, and site owners who lost their content.

Give it a domain. Get the old site back as structured rows you can republish, audit or feed into an AI.

***

### Who this is for

- **SEOs and expired-domain buyers** rebuilding the original pages to keep backlinks and rankings
- **Domain investors** checking what a domain was used for before you buy it
- **Site owners and agencies** recovering content after a hack, a lost host or a botched migration
- **Content and AI teams** turning dead sites into training or research corpora
- **Journalists and researchers** documenting what a company's site said at a given date

***

### What you get per page

```json
{
  "domain": "paulgraham.com",
  "url": "http://paulgraham.com/95.html",
  "path": "/95.html",
  "snapshotDate": "2015-05-24",
  "archiveUrl": "https://web.archive.org/web/20150524101833/http://paulgraham.com/95.html",
  "firstArchived": "2014-12-26",
  "title": "Let the Other 95% of Great Programmers In",
  "metaDescription": null,
  "h1": [],
  "markdown": "December 2014\n\nAmerican technology companies want the government to make immigration easier...",
  "wordCount": 910,
  "internalLinks": ["http://paulgraham.com/index.html"],
  "externalLinks": ["http://www.garron.me/es/bitacora/95.html"],
  "images": [{ "src": "http://ep.yimg.com/ay/paulgraham/essays-1.gif", "alt": "" }]
}
```

***

### How it works

```mermaid
flowchart LR
    A[Domain + optional date] --> B[Wayback CDX index: every archived HTML page]
    B --> C[De-duplicate URLs, drop junk and query strings]
    C --> D[Fetch raw snapshot closest to your date]
    D --> E[Strip toolbar, scripts, styles]
    E --> F[Markdown + title, meta, H1, links, images]
    F --> G[One row per page in dataset]
```

The actor uses the Internet Archive's own index to find every page it ever saved for the domain, then downloads the original HTML (without the Wayback toolbar) and converts it to clean Markdown.

***

### Quick start

1. Click **Try for free**.
2. Enter a domain, e.g. `example.com`.
3. Optional: set **Restore the site as it was around** to the month before the domain expired.
4. Click **Start**, then export to JSON, CSV or Excel.

#### API

```bash
curl -X POST "https://api.apify.com/v2/acts/Turboextract~wayback-site-recovery/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domains": ["example.com"],
    "snapshotDate": "2021-03-01",
    "maxPagesPerDomain": 200,
    "pathContains": "/blog/"
  }'
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("Turboextract/wayback-site-recovery").call(run_input={
    "domains": ["example.com"],
    "maxPagesPerDomain": 100,
})
for page in client.dataset(run["defaultDatasetId"]).iterate_items():
    name = (page["path"].strip("/").replace("/", "_") or "index") + ".md"
    open(name, "w", encoding="utf-8").write(page["markdown"])
```

***

### Input

| Field | Default | What it does |
|---|---|---|
| `domains` | required | Domains to restore (subdomains included) |
| `snapshotDate` | latest | Restore the site as it was around this date |
| `maxPagesPerDomain` | 50 | Homepage and top-level pages first |
| `pathContains` | – | Only restore matching paths, e.g. `/blog/` |
| `skipQueryUrls` | true | Skip `?id=` style junk URLs |
| `includeHtml` | false | Also return the raw archived HTML |
| `concurrency` | 3 | Parallel downloads (keep low) |

***

### Pricing

**$0.005 per page recovered. Pages with no usable snapshot are free.** A 200-page site costs $1.

| Option | What you get for a 200-page site |
|---|---|
| **Expired Domain Content Recovery** | **$1**: clean Markdown, title, meta, H1, links, images per page |
| Wayback snapshot listers | Snapshot metadata only (timestamps, status codes), no page content |
| Wayback URL extractors | A list of URLs, at ~$0.0045 per URL |
| Desktop site rippers | Raw HTML files full of broken toolbar links, cleanup is on you |
| Manual copy and paste | 5+ hours of work |

***

### Tips

- Pick a `snapshotDate` a few weeks **before** the domain dropped, so you skip parking pages.
- Each page uses the snapshot closest to your date, which can be slightly after it. Check `snapshotDate` on each row.
- Start with 50 pages to check quality, then raise the limit.
- The Internet Archive index can be slow for large domains; the actor retries automatically.

***

### Pairs well with

- [Brand Availability Check](https://apify.com/Turboextract/brand-availability-check): check the name across domains, trademarks and social handles
- [Sitemap to AI Corpus](https://apify.com/Turboextract/sitemap-to-ai-corpus): the same clean output for live websites
- [AI Training Dataset Builder](https://apify.com/Turboextract/ai-training-dataset-builder): turn recovered pages into LLM-ready training data

***

### FAQ

**Is this legal?** The actor reads public Internet Archive snapshots. Republishing content you do not own may infringe copyright; restore your own content or check rights first.

**Why are some pages missing?** The Wayback Machine did not archive them, or only archived redirects and errors. Those are skipped and not charged.

**Does it download images?** It lists image URLs from each page. Images are not downloaded.

**Can it restore a whole site as files?** Each row has the path and Markdown, so a short script (see the Python example) writes one file per page.

***

### Support

- Docs and examples: https://github.com/andersonjames38phd-cpu/wayback-site-recovery
- Community Discord: https://discord.gg/8SrXSCpvgj

Built and maintained by [Turboextract](https://apify.com/Turboextract) on the Apify platform.

# Actor input Schema

## `domains` (type: `array`):

Bare domains, e.g. "example.com". Subdomains are included.

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

Optional. Only pages archived up to this date are listed, and each page uses the snapshot closest to it. Use the date before the domain expired. Empty = latest snapshot.

## `maxPagesPerDomain` (type: `integer`):

Homepage and top-level pages are recovered first.

## `pathContains` (type: `string`):

Optional, e.g. "/blog/" to restore only blog posts.

## `skipQueryUrls` (type: `boolean`):

Skips search, tracking and session URLs (?id=...). Recommended.

## `includeHtml` (type: `boolean`):

Adds the original HTML of each page (larger dataset).

## `concurrency` (type: `integer`):

Keep low (2 to 4) to stay within Internet Archive rate limits.

## Actor input object example

```json
{
  "domains": [
    "paulgraham.com"
  ],
  "maxPagesPerDomain": 50,
  "skipQueryUrls": true,
  "includeHtml": false,
  "concurrency": 3
}
```

# Actor output Schema

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

One row per recovered page with Markdown content, title, meta description, headings and links.

# 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 = {
    "domains": [
        "paulgraham.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("turboextract/wayback-site-recovery").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 = { "domains": ["paulgraham.com"] }

# Run the Actor and wait for it to finish
run = client.actor("turboextract/wayback-site-recovery").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 '{
  "domains": [
    "paulgraham.com"
  ]
}' |
apify call turboextract/wayback-site-recovery --silent --output-dataset

```

## MCP server setup

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

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/7Y11FtdADx4O78VBr/builds/HAvLkgI4xWWrJ2AeY/openapi.json
