# Internet Archive Scraper (`ludoe11/internet-archive-scraper`) Actor

Fast, lightweight scraper for Internet Archive (archive.org). Extract metadata, collections, media files, and item URLs using Lucene queries directly into JSON, CSV, or Excel with zero browser overhead.

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

## Pricing

$0.20 / 1,000 internet archive records

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 API

Extract structured metadata, collections, books, movies, audio recordings, and archived items from [Internet Archive (archive.org)](https://archive.org) using flexible search queries.

This Actor connects directly to Internet Archive's cursor-based search engine. It runs without headless browser overhead, ensuring maximum speed, minimal compute costs, and zero bot detection issues.

***

### Features

- **Blazing Fast & Lightweight:** Uses raw HTTP extraction (no Puppeteer/Playwright). Runs reliably on **256 MB RAM**.
- **Full Lucene Search Support:** Filter by collection, creator, date, media type, language, or license.
- **Deep Pagination:** Automatically traverses cursor-based pagination beyond the typical 10,000-item API limits.
- **Clean Normalization:** Automatically generates direct item URLs (`https://archive.org/details/{identifier}`) for every result.
- **Export Ready:** Output structured data directly to JSON, CSV, XML, or Excel.

***

### Input Parameters

| Parameter | Type | Required | Default | Description |
| :--- | :--- | :--- | :--- | :--- |
| `query` | String | **Yes** | `"collection:nasa"` | Lucene search query. |
| `fields` | Array | No | `["identifier", "title", "mediatype", "creator", "date", "downloads"]` | Specific metadata attributes to extract per record. |
| `maxItems` | Integer | No | `1000` | Maximum number of records to collect before stopping. |
| `batchSize` | Integer | No | `1000` | Results requested per API batch (range: 100–10,000). |

***

### Query Syntax & Examples

Internet Archive queries follow standard Lucene syntax. You can combine terms with `AND`, `OR`, `NOT`, and field qualifiers:

| Target Use Case | Example Query |
| :--- | :--- |
| **Specific collection** | `collection:nasa` |
| **Books published in a specific year** | `mediatype:texts AND year:2023` |
| **Audio files by a specific artist** | `mediatype:audio AND creator:"Grateful Dead"` |
| **High-download historical items** | `downloads:[10000 TO *] AND year:[1900 TO 1950]` |
| **Keyword search in titles** | `title:apollo AND mediatype:movies` |

***

### Output Format

Each row in the dataset contains the requested fields along with a generated `itemUrl`:

````json
[
  {
    "identifier": "00-042-71",
    "title": "Space Shuttle Cockpit exhibit",
    "mediatype": "image",
    "creator": "NASA/Stennis Space Center",
    "date": "2000-01-01T00:00:00Z",
    "downloads": 4832,
    "itemUrl": "[https://archive.org/details/00-042-71](https://archive.org/details/00-042-71)"
  },
  {
    "identifier": "00-042-154",
    "title": "International Space Station exhibit",
    "mediatype": "image",
    "creator": "NASA/Stennis Space Center",
    "date": "2000-05-26T00:00:00Z",
    "downloads": 1385,
    "itemUrl": "[https://archive.org/details/00-042-154](https://archive.org/details/00-042-154)"
  }
]



# Actor input Schema

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

Lucene query (e.g., 'collection:nasa', 'mediatype:texts AND year:2020')
## `fields` (type: `array`):

Metadata fields to return per item
## `maxItems` (type: `integer`):

Maximum number of records to fetch
## `batchSize` (type: `integer`):

Results per API request (100 to 10000)

## Actor input object example

```json
{
  "query": "collection:nasa",
  "fields": [
    "identifier",
    "title",
    "mediatype",
    "creator",
    "date",
    "downloads"
  ],
  "maxItems": 1000,
  "batchSize": 1000
}
````

# Actor output Schema

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

Summary of the scraping run

# 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": "collection:nasa"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ludoe11/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 = { "query": "collection:nasa" }

# Run the Actor and wait for it to finish
run = client.actor("ludoe11/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 '{
  "query": "collection:nasa"
}' |
apify call ludoe11/internet-archive-scraper --silent --output-dataset

```

## MCP server setup

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