# Archive.org Scraper: Items, Metadata, Wayback Captures (`capable_coach/internet-archive-scraper`) Actor

Three modes in one actor: search Internet Archive items, pull full metadata and file lists for given identifiers, or list Wayback Machine captures for any URL or domain. One flat dataset, CSV or Excel ready, no account or key. $0.80 per 1,000 rows plus $0.05 per run.

- **URL**: https://apify.com/capable_coach/internet-archive-scraper.md
- **Developed by:** [jules imbert](https://apify.com/capable_coach) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 result rows

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

Read the public Internet Archive and Wayback Machine services into one flat dataset: search archive items, pull one item's full metadata and file list, or list the Wayback captures of any URL or domain.

### What you get

- `search` mode: one row per archive item with identifier, title, URL, media type, creator, dates, language, collections, subjects, downloads, size and description.
- `item` mode: the full metadata of the identifiers you list, with an optional file list (name, format, size, SHA-1, MD5, download URL).
- `wayback` mode: one row per capture with timestamp, status code, MIME type, content digest, length and a playable `waybackUrl`.
- The query and 1-based position that produced each row, plus a `SUMMARY` record with per-query counts and failures.

Real output shape (trimmed):

```json
{
  "recordType": "item",
  "source": "advancedsearch",
  "identifier": "information_for_social_change",
  "title": "Information for Social Change Journal and Historical Archives",
  "url": "https://archive.org/details/information_for_social_change",
  "mediatype": "texts",
  "creator": "Information for Social Change",
  "year": 2020,
  "language": "eng",
  "collections": ["zines_inbox", "zines"],
  "subjects": ["Libraries", "Librarianship"],
  "downloads": 22150,
  "query": "mediatype:texts AND subject:\"librarianship\"",
  "position": 1
}
```

### Who it's for

- **Researchers and librarians** building lists of archive items by subject, collection or media type.
- **SEO and domain analysts** listing all archived versions of a page or site, one per distinct content.
- **Developers and data teams** needing the file list and checksums of an item without writing a client.
- **Journalists and compliance teams** checking what a page said at a given date through the capture list.

### How to use

1. Choose the `mode`: `search`, `item` or `wayback`.
2. `search`: add Lucene `queries` (`subject:librarianship`, `mediatype:texts`, `collection:nasa`). `item`: list `identifiers`. `wayback`: list `urls` (a domain, a page, or a prefix ending in `*`) with optional `from` / `to`.
3. Run it and export JSON, CSV or Excel. Wayback captures are listed oldest first; `collapse: digest` keeps one row per distinct content.

Example input:

```json
{
  "mode": "wayback",
  "urls": ["example.com/about"],
  "from": "2024",
  "limit": 100,
  "collapse": "digest",
  "filterStatus": "200"
}
```

### Pricing

Pay per event, no subscription: **$0.05 per run start** (one event per GB of memory, minimum one) plus **$0.0008 per row** written to the dataset.

| Volume (Free plan) | Cost |
|---|---|
| 100 rows | $0.13 |
| 1,000 rows | $0.85 |

The $0.05 run fee is charged only when the run delivers at least one row; a zero-result run costs nothing. A search run of 1,000 rows takes about 25 seconds.

Set the run's *Maximum cost per run* in Apify to cap spending in advance.

### FAQ

**Do I need an account or an API key?**
No. The actor reads public Internet Archive endpoints: advanced search, item metadata and the Wayback CDX index.

**Does it download the archived pages or files?**
No. It lists items, metadata and captures; the Wayback Machine serves the captures themselves through `waybackUrl`.

**Can I list every capture of a whole domain?**
Yes: pass the domain (`example.com`) and the actor returns the archived URLs under it. Wide domain queries over many years can take up to a minute on the Archive's side.

**How many items per query?**
Up to 5,000 rows per query. The Archive refuses to page past 10,000 rows for one query, and the run then stops with an explicit message.

**What happens with a Lucene syntax error?**
The Archive returns it as HTTP 200 with an error body; the actor reports the server message and the offending query instead of returning an empty result.

**Why is `downloads` null in item mode?**
The metadata endpoint does not return a download counter; use `search` mode for `downloads`.

### Limits

- Requests are sequential, at most one per second, with three attempts and a 60-second timeout.
- At most 10,000 rows per query because of the Archive's paging limit.
- `downloads` is available in search mode only.
- A missing identifier fails only that identifier; the failure appears in `SUMMARY`.
- Not affiliated with the Internet Archive.

# Changelog

This Actor's version history is a separate document: https://apify.com/capable_coach/internet-archive-scraper/changelog.md

# Actor input Schema

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

Search runs a query and returns item rows. Item returns the full metadata of the identifiers you list. Wayback lists the archived captures of the URLs you list.

## `queries` (type: `array`):

Search mode only. One row set per query, run one after another. Any query the archive.org advanced search understands works: keywords, field searches such as `subject:librarianship`, `mediatype:texts`, `collection:nasa`, and AND/OR/NOT with quotes.

## `maxResults` (type: `integer`):

Search mode only. Rows per query, 1 to 5000. The archive caps paging at 10000 rows per query; above that the run stops with a clear message.

## `sort` (type: `string`):

Search mode only. `downloads desc` puts the most consulted items first; `addeddate desc` puts the freshest uploads first.

## `identifiers` (type: `array`):

Item mode only. Archive identifiers, the last segment of an item page such as `goody` in archive.org/details/goody. A missing identifier fails that item with a clear message and the other identifiers still run.

## `includeFiles` (type: `boolean`):

Item mode only. Adds a `files` array to each item: name, format, size, sha1, md5 and download URL.

## `maxFiles` (type: `integer`):

Item mode only, used when the file list is included. Some items carry thousands of files; the row keeps the first N and `filesCount` always reports the real total.

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

Wayback mode only. A domain (`example.com`) returns every archived URL under it, a page (`example.com/about`) only that page, and a trailing `*` opens the prefix (`example.com/*`).

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

Wayback mode only. Captures kept per URL, oldest first.

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

Wayback mode only, optional. Year, year-month or full date: `2024`, `2024-06`, `2024-06-15`. Empty means no lower bound.

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

Wayback mode only, optional, same format as `from`. Empty means no upper bound.

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

Wayback mode only. `digest` drops identical re-captures of the same content, which is the shortest useful list; `none` returns every capture.

## `filterStatus` (type: `string`):

Wayback mode only. A three-digit status such as `200` keeps only those answers, `all` keeps every capture including redirects and errors.

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "mediatype:texts AND subject:\"librarianship\"",
    "mediatype:audio AND collection:librivoxaudio"
  ],
  "maxResults": 50,
  "sort": "downloads desc",
  "identifiers": [
    "goody",
    "nasa"
  ],
  "includeFiles": false,
  "maxFiles": 200,
  "urls": [
    "example.com/",
    "apify.com/pricing"
  ],
  "limit": 100,
  "collapse": "digest",
  "filterStatus": "200"
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per archive item or Wayback capture, with the input that produced it.

## `summary` (type: `string`):

Per-query counts and the list of failures, if any.

# 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 = {
    "queries": [
        "mediatype:texts AND subject:\"librarianship\"",
        "mediatype:audio AND collection:librivoxaudio"
    ],
    "identifiers": [
        "goody",
        "nasa"
    ],
    "urls": [
        "example.com/",
        "apify.com/pricing"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("capable_coach/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 = {
    "queries": [
        "mediatype:texts AND subject:\"librarianship\"",
        "mediatype:audio AND collection:librivoxaudio",
    ],
    "identifiers": [
        "goody",
        "nasa",
    ],
    "urls": [
        "example.com/",
        "apify.com/pricing",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("capable_coach/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 '{
  "queries": [
    "mediatype:texts AND subject:\\"librarianship\\"",
    "mediatype:audio AND collection:librivoxaudio"
  ],
  "identifiers": [
    "goody",
    "nasa"
  ],
  "urls": [
    "example.com/",
    "apify.com/pricing"
  ]
}' |
apify call capable_coach/internet-archive-scraper --silent --output-dataset

```

## MCP server setup

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