# Internet Archive & Wayback Machine Scraper 🏛️ (`environmental_audio/internet-archive-scraper`) Actor

Scrape Wayback Machine historical snapshots, domain archives, past website copy, and CDX timeline metadata without API keys.

- **URL**: https://apify.com/environmental_audio/internet-archive-scraper.md
- **Developed by:** [Rahul Kasturiya](https://apify.com/environmental_audio) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

## Internet Archive & Wayback Machine Scraper 🏛️

Extract historical website snapshots, page content, title tags, metadata, and CDX timeline indexes from the **Internet Archive Wayback Machine** without needing an API key.

### What does Internet Archive Scraper do?

The **Internet Archive & Wayback Machine Scraper** lets you retrieve historical captures of any website or specific URL. It connects directly to the Internet Archive's CDX index server and Wayback playback system, extracting:

- **Historical Snapshots Timeline**: Timestamp, HTTP status code (200, 301, 404), MIME type, content length, and digest.
- **Direct Wayback Links**: Interactive archive URLs and raw playback links without archive banners.
- **On-Page Content Diffing**: Extracted page titles, meta descriptions, and cleaned content text from past versions.
- **Domain Scope Auditing**: Supports exact URL, sub-path prefix, or entire domain-level matching.

### Why use Internet Archive Scraper?

- **SEO & Domain Due Diligence**: Inspect expired domains or historical 301 redirect paths before purchasing.
- **Brand & Legal Compliance**: Gather historical records, past terms of service, and copy changes for legal evidence or auditing.
- **Content Recovery**: Restore lost blog posts, deleted landing pages, or legacy documentation.
- **Competitive Analysis**: Track competitor positioning, pricing changes, and offer evolutions over months and years.

### How to use

1. Enter the **Target URL or Domain** (e.g. `https://apify.com` or `example.com/pricing`).
2. Set the snapshot **Limit** (e.g., 20 snapshots).
3. Optionally filter by **From Year** / **To Year** and choose a **Collapse** mode (e.g., `timestamp:6` for 1 snapshot per month).
4. Click **Start** to run the Actor.
5. Export your structured dataset in **JSON, CSV, Excel, or HTML**.

### Input Parameters

| Field | Type | Description | Default |
|---|---|---|---|
| `targetUrl` | String | Target domain or URL to audit | `"https://apify.com"` |
| `limit` | Integer | Maximum snapshots to retrieve | `20` |
| `fromYear` | String | Earliest year/timestamp (e.g. `2018`) | `""` |
| `toYear` | String | Latest year/timestamp (e.g. `2025`) | `""` |
| `collapse` | String | Collapse duplicates (`timestamp:6` for monthly, `timestamp:8` for daily) | `"timestamp:6"` |
| `matchType` | String | `exact`, `prefix`, `host`, or `domain` | `"exact"` |
| `fetchContent` | Boolean | Whether to fetch snapshot HTML to extract page title and text | `true` |

### Output Example

```json
{
  "timestamp": "20200115120000",
  "formattedDate": "2020-01-15 12:00:00 UTC",
  "originalUrl": "https://apify.com/",
  "archiveUrl": "https://web.archive.org/web/20200115120000/https://apify.com/",
  "rawArchiveUrl": "https://web.archive.org/web/20200115120000id_/https://apify.com/",
  "statusCode": 200,
  "mimeType": "text/html",
  "digest": "XYZ123456789...",
  "contentLength": 45120,
  "pageTitle": "Apify: Web Scraping and Automation Platform",
  "metaDescription": "Turn websites into APIs. Extract data from websites with ease.",
  "textSnippet": "Apify is a cloud platform for web scraping and data extraction..."
}
```

### Pricing & Cost

- **Free Tier Compatible**: Runs fast on minimal memory (512 MB to 1024 MB).
- **No Third-Party API Keys**: Uses public Internet Archive infrastructure directly.
- **Estimated Run Cost**: A 50-snapshot run typically consumes less than **$0.002** in Apify Compute Units.

### Tips & Best Practices

- **Avoid Duplicates**: Use `collapse: "timestamp:6"` when looking for historical trends so you get one representative snapshot per month rather than dozens of repeated captures on the same day.
- **Domain-Wide Discovery**: Set `matchType: "domain"` or `matchType: "prefix"` if you want to discover all historical URLs archived under a company's website.

### Disclaimers & Support

This tool interacts with the public Internet Archive CDX server and Wayback Machine API in accordance with archive fair use. Please respect archive.org rate limits. For feature requests or custom automation, contact via Apify Console Issues or reach out to `contact@primuez.in`.

# Actor input Schema

## `targetUrl` (type: `string`):

Target website or URL to retrieve historical snapshots for (e.g. https://apify.com or example.com).

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

Maximum number of snapshots to fetch.

## `fromYear` (type: `string`):

Start timestamp in YYYY or YYYYMMDD format (e.g. 2015 or 20200101). Leave empty for earliest.

## `toYear` (type: `string`):

End timestamp in YYYY or YYYYMMDD format (e.g. 2025 or 20241231). Leave empty for latest.

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

Collapse granularity to reduce duplicate records (e.g. timestamp:6 for one per month, timestamp:8 for one per day).

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

Match scope for the URL in CDX.

## `fetchContent` (type: `boolean`):

Whether to fetch the snapshot page to extract page title, meta description, and cleaned text snapshot.

## Actor input object example

```json
{
  "targetUrl": "https://apify.com",
  "limit": 20,
  "fromYear": "",
  "toYear": "",
  "collapse": "timestamp:6",
  "matchType": "exact",
  "fetchContent": true
}
```

# Actor output Schema

## `dataset` (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 = {
    "targetUrl": "https://apify.com",
    "limit": 20,
    "fromYear": "",
    "toYear": "",
    "collapse": "timestamp:6"
};

// Run the Actor and wait for it to finish
const run = await client.actor("environmental_audio/internet-archive-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 = {
    "targetUrl": "https://apify.com",
    "limit": 20,
    "fromYear": "",
    "toYear": "",
    "collapse": "timestamp:6",
}

# Run the Actor and wait for it to finish
run = client.actor("environmental_audio/internet-archive-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 '{
  "targetUrl": "https://apify.com",
  "limit": 20,
  "fromYear": "",
  "toYear": "",
  "collapse": "timestamp:6"
}' |
apify call environmental_audio/internet-archive-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,environmental_audio/internet-archive-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/veC0TDveLffxYqkaG/builds/nh6fGCxrEEoSQqcTi/openapi.json
