# Internet Archive Scraper: Search, Metadata, Wayback CDX (`firebrick_zamia/internet-archive-search`) Actor

Internet Archive scraper using only official APIs: search archive.org items, get item metadata with file lists and download links, or list Wayback Machine snapshots (CDX). Metadata and links only, no file downloads. Polite rate limit, retries.

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

## Pricing

from $1.00 / 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.

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

## Internet Archive Scraper: Search Items, Metadata and Wayback Snapshots

**Search archive.org, fetch item metadata with file lists and download links, or list Wayback Machine snapshots of any URL, using only the Internet Archive's official public APIs. One clean dataset row per item or snapshot. Metadata and links only, no bulk downloading.**

### What you get

- **Search mode**: items matching a query, with title, media type, creator, date, description, subjects, collections, language, licence URL, download count, size and the item page link.
- **Details mode**: full metadata for identifiers you already know, plus the file list (name, format, size, MD5, SHA-1, modified time and a direct download URL per file).
- **Snapshots mode**: Wayback Machine captures of a URL, domain or path prefix: capture time, HTTP status, MIME type, content digest, size and ready-made snapshot links (normal and raw `id_`).

### Use cases

- Build a list of public-domain books, films, audio or software on a topic, with licence and download counts.
- Look up the files in a known item and get checksums and links for your own, permitted download.
- Track how a web page changed over time (collapse identical captures to see only the changes).
- Find the first and last archived capture of a URL, or the available captures in a date range, for research, journalism or due diligence.
- Feed an AI agent or research assistant citable archive.org links (callable through Apify's MCP server, https://mcp.apify.com).

### What it does

Official endpoints only, no HTML scraping, no login:

- Search: `https://archive.org/advancedsearch.php?q=...&fl[]=...&rows=&page=&output=json`
- Details: `https://archive.org/metadata/{identifier}`
- Snapshots: `https://web.archive.org/cdx/search/cdx?url=...&output=json&from=&to=&limit=&filter=&collapse=digest`

Polite by design: sequential requests at most 1 per second, an identifying User-Agent, retries with exponential backoff on HTTP 429 and 5xx (honouring `Retry-After`), and a clear failure message otherwise. It never uses proxies or workarounds. **It does not download item files**: respect the Internet Archive's terms of use and each item's licence or rights statement when you use the links it returns.

### Input

| Field | Meaning |
|---|---|
| `mode` | `search` (default), `details` or `snapshots` |
| `query` | Search query, Lucene syntax accepted (`creator:nasa AND subject:moon`) |
| `mediatype`, `collection` | Search filters (texts, movies, audio, software, image, data, web, ...) |
| `dateFrom`, `dateTo` | Item date range in search mode; capture date range in snapshots mode (`YYYY`, `YYYY-MM` or `YYYY-MM-DD`) |
| `sort` | Relevance (default), most downloaded, newest or oldest, recently added |
| `maxItems` | 1-10,000 items in search mode (default 50) |
| `identifiers` | Details mode: identifiers or `archive.org/details/...` URLs (up to 500) |
| `includeFiles`, `includeDerivatives` | Details mode: file list on/off; derivative files off by default |
| `urls`, `matchType` | Snapshots mode: URLs or domains (up to 100); `exact`, `prefix`, `host`, `domain` |
| `collapseByDigest`, `statusCodeFilter`, `mimeTypeFilter`, `maxSnapshots` | Snapshots mode: skip unchanged captures (default on), keep only status `200` (default), MIME type, 1-10,000 captures per URL (default 100) |

### Example input and output

Input (bundled `test-input.json`): `{"mode": "search", "query": "apollo 11 mission audio", "mediatype": "audio", "dateFrom": "1969", "dateTo": "1970", "maxItems": 5}`.

The records below use **illustrative values only**; real results depend on what archive.org holds when you run it. Our tests use synthetic fixtures shaped like the documented API responses.

```json
{
  "kind": "item", "identifier": "example-apollo-audio", "title": "Example Apollo audio",
  "mediatype": "audio", "creator": ["NASA"], "date": "1969-07-20T00:00:00Z", "downloads": 1234,
  "collection": ["nasa"], "license_url": null,
  "item_url": "https://archive.org/details/example-apollo-audio",
  "metadata_url": "https://archive.org/metadata/example-apollo-audio"
}
```

```json
{
  "kind": "snapshot", "queried_url": "example.com", "original_url": "http://example.com/",
  "timestamp": "20200101120000", "captured_at": "2020-01-01T12:00:00Z", "status_code": "200",
  "mime_type": "text/html", "digest": "SAMPLEDIGEST", "length_bytes": 1234,
  "snapshot_url": "https://web.archive.org/web/20200101120000/http://example.com/"
}
```

### Limitations (read before relying on it)

- **Metadata is uploader-supplied** and often incomplete or inconsistent (dates in several formats, missing creators, free-text licences). Check rights before reuse; a link is not a licence.
- Advanced Search returns at most about 10,000 results per query; narrow the query with filters or dates for more. Counts and ranking are archive.org's.
- The Wayback CDX index lists captures it holds; it is not a guarantee that a page was captured on a given day, and recent captures can take time to appear. `limit` applies per URL after filtering and collapsing.
- Items that are dark, restricted or removed return limited or no metadata. Identifiers that are not found are skipped (listed in the run's `SUMMARY` record and the log), not billed.
- Details mode lists files of an item but never fetches them. Large items can have thousands of files per row.
- Archive.org can rate limit or be slow; the actor retries and then fails with a clear message rather than hammering the service. Not affiliated with or endorsed by the Internet Archive.

### Pricing (pay per result)

Pay-per-event with Apify's built-in dataset-item event: each item (search, details) or snapshot is one result. The live price is set in Apify Console and shown on the Store page. Planning figure in our notes: USD 1.00 per 1,000 results (not yet published).

### FAQ

**Does it need an API key?** No, the APIs are public and keyless.

**Can it download the files?** No. It returns metadata and links only, to respect the Internet Archive's terms and avoid bulk downloading.

**How do I see only the changes of a page over time?** Use snapshots mode with `collapseByDigest` on (default); identical consecutive captures are skipped.

**How do I get the snapshot as it was archived, without the Wayback toolbar?** Use `raw_snapshot_url` (the `id_` form).

**Can I search by creator or subject?** Yes, put Lucene syntax in `query`, for example `creator:"Library of Congress" AND subject:maps`.

**Why did an identifier return nothing?** It does not exist, was removed, or is dark. See the `SUMMARY` record.

# Actor input Schema

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

search: find archive.org items. details: metadata and file list for known identifiers. snapshots: list Wayback Machine captures of URLs.

## `query` (type: `string`):

Search mode: archive.org search query (Lucene syntax is accepted, e.g. creator:nasa AND subject:moon). Leave empty if you set a media type, collection or date filter.

## `mediatype` (type: `string`):

Search mode: restrict to one media type. Empty means any.

## `collection` (type: `string`):

Search mode: restrict to one collection identifier, for example nasa or prelinger. Empty means any.

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

Search mode: earliest item date, YYYY or YYYY-MM-DD. Snapshots mode: earliest capture date, YYYY, YYYY-MM or YYYY-MM-DD.

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

Search mode: latest item date, YYYY or YYYY-MM-DD. Snapshots mode: latest capture date, YYYY, YYYY-MM or YYYY-MM-DD.

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

Search mode: sort order of results. Relevance is the default of archive.org.

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

Search mode: maximum number of items to return (1 to 10,000). Each item is one billed result.

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

Details mode: archive.org identifiers or item URLs (https://archive.org/details/...), one per line, up to 500.

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

Details mode: add the list of files with sizes, checksums and download URLs. Files are never downloaded, only linked.

## `includeDerivatives` (type: `boolean`):

Details mode: also list files generated by archive.org (thumbnails, OCR text, conversions). Off lists only original uploads.

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

Snapshots mode: URLs, domains or URL prefixes to list Wayback Machine captures for, one per line, up to 100.

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

Snapshots mode: exact matches the URL only, prefix matches everything below the path, host matches one host, domain includes subdomains.

## `collapseByDigest` (type: `boolean`):

Snapshots mode: skip a capture when its content is identical to the previous one (same digest), so you only see changes.

## `statusCodeFilter` (type: `string`):

Snapshots mode: keep only captures with this HTTP status code, for example 200. Empty means any.

## `mimeTypeFilter` (type: `string`):

Snapshots mode: keep only captures with this MIME type, for example text/html. Empty means any.

## `maxSnapshots` (type: `integer`):

Snapshots mode: maximum captures returned for each URL (1 to 10,000). Each snapshot is one billed result.

## Actor input object example

```json
{
  "mode": "search",
  "query": "apollo 11 mission audio",
  "mediatype": "",
  "sort": "",
  "maxItems": 50,
  "identifiers": [
    "apollo-11-flight-journal"
  ],
  "includeFiles": true,
  "includeDerivatives": false,
  "urls": [
    "example.com"
  ],
  "matchType": "exact",
  "collapseByDigest": true,
  "statusCodeFilter": "200",
  "maxSnapshots": 100
}
```

# Actor output Schema

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

All result records.

# 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 = {
    "query": "apollo 11 mission audio",
    "identifiers": [
        "apollo-11-flight-journal"
    ],
    "urls": [
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("firebrick_zamia/internet-archive-search").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 = {
    "query": "apollo 11 mission audio",
    "identifiers": ["apollo-11-flight-journal"],
    "urls": ["example.com"],
}

# Run the Actor and wait for it to finish
run = client.actor("firebrick_zamia/internet-archive-search").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 '{
  "query": "apollo 11 mission audio",
  "identifiers": [
    "apollo-11-flight-journal"
  ],
  "urls": [
    "example.com"
  ]
}' |
apify call firebrick_zamia/internet-archive-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,firebrick_zamia/internet-archive-search"
        }
    }
}
```

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/HNcjkfwzD9yVk9Mz5/builds/yebvfwVICstZEV9sn/openapi.json
