# HathiTrust Digital Library Scraper - Books, Editions & Rights (`ninhothedev/hathitrust-scraper`) Actor

$0.5/1K 🔥 HathiTrust scraper! 18M+ digitized books — editions, rights & holding libraries by ISBN or OCLC. No key. JSON, CSV, Excel or API in seconds. Power library & book research ⚡

- **URL**: https://apify.com/ninhothedev/hathitrust-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## HathiTrust Digital Library Scraper

Look up **HathiTrust's 18M+ digitized volumes** by ISBN, OCLC, LCCN, ISSN, HathiTrust item ID (HTID) or catalog record number — and get back clean, structured bibliographic data: titles, editions, publication dates, cross-linked identifiers, holding libraries, item-level HathiTrust IDs and **US copyright rights status**.

No API key. No login. No proxy required.

HathiTrust is one of the largest digital preservation repositories in the world — a shared collection of books digitized by Google, the Internet Archive and 60+ research libraries including Michigan, California, Harvard, Princeton and the Library of Congress. This actor turns its Bibliographic API into a dataset you can actually work with.

***

### What you get

One row per HathiTrust **catalog record**, with all of its digitized items rolled up:

| Field | Description |
|---|---|
| `query` | The identifier that was looked up (e.g. `isbn:0226458075`) |
| `record_id` | HathiTrust catalog record number |
| `title` | Primary title |
| `all_titles` | Every title variant on the record |
| `isbns` / `oclcs` / `lccns` / `issns` | All cross-linked identifiers — great for ID reconciliation |
| `publish_dates` | Publication year(s) |
| `record_url` | Link to the HathiTrust catalog record |
| `item_count` | How many digitized copies/volumes exist |
| `htids` | HathiTrust item IDs (up to 20) |
| `item_urls` | Direct page-turner links (up to 10) |
| `rights_codes` | Unique rights codes across items (`pd`, `ic`, `und`, `pdus`, …) |
| `us_rights` | Human-readable US access status (e.g. `Full view`, `Limited (search-only)`) |
| `source_libraries` | Which institutions contributed the scans |
| `last_update` | Most recent item update, ISO-8601 |
| `marc_xml` | Full MARC-XML record (only when *Fetch full records* is enabled) |
| `source`, `scraped_at` | Provenance |

#### Sample output

```json
{
  "query": "isbn:0226458075",
  "record_id": "003112209",
  "title": "The structure of scientific revolutions",
  "isbns": ["9780226458083", "9780226458076"],
  "oclcs": ["34548541"],
  "lccns": ["96013195"],
  "publish_dates": ["1996"],
  "record_url": "https://catalog.hathitrust.org/Record/003112209",
  "item_count": 1,
  "htids": ["uc1.31822031154305"],
  "item_urls": ["https://babel.hathitrust.org/cgi/pt?id=uc1.31822031154305"],
  "rights_codes": ["ic"],
  "us_rights": "Limited (search-only)",
  "source_libraries": ["University of California"],
  "last_update": "2013-08-10",
  "source": "hathitrust"
}
```

***

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | select | `lookup` | Resolve identifiers into volume records |
| `idType` | select | `isbn` | `isbn`, `oclc`, `lccn`, `issn`, `htid` or `recordnumber` |
| `ids` | array | — | The identifiers to look up (all of the chosen type) |
| `useFullRecords` | boolean | `false` | Fetch full records including MARC-XML |
| `maxItems` | integer | `200` | Cap on dataset rows (max 2000) |

```json
{
  "mode": "lookup",
  "idType": "isbn",
  "ids": ["9780195079630", "0226458075"],
  "useFullRecords": false,
  "maxItems": 200
}
```

***

### Pricing

Roughly **$0.5 per 1,000 volumes**. The actor packs **20 identifiers into a single API request** using HathiTrust's multi-lookup syntax, so a 1,000-ISBN list is just 50 HTTP calls — fast and cheap. Runs on 512 MB.

***

### Use cases

- **Library metadata enrichment** — take a shelf list or acquisitions file of ISBNs and enrich it with authoritative catalog data, OCLC/LCCN cross-references and holdings counts.
- **Book research** — check which scholarly editions and printings exist for a work, when they were published, and which institutions hold them.
- **Digitization coverage checks** — before scanning a collection, find out which titles are *already* digitized in HathiTrust and by whom, so you don't duplicate effort.
- **Rights clearance** — bulk-check US copyright status (`pd` public domain vs `ic` in-copyright) across a catalog to determine what can be opened up to full view.

Also useful for ID reconciliation between ISBN, OCLC and LCCN namespaces, and for building union-catalog datasets.

***

### Notes & limitations

- Coverage is strongest for **academic, scholarly and older public-domain titles**. Recent trade paperbacks are frequently absent — an identifier with no HathiTrust holdings returns an empty result and is skipped (and counted in the log).
- All identifiers in a single run must be of the **same type**. Run the actor twice if you have a mixed set.
- The actor reads bibliographic metadata only. It does not download page images or full text.
- The run fails loudly (`RuntimeError`) if *no* identifier matched anything — that usually means a wrong `idType`.

***

### Related actors

- [Open Library Book Scraper](https://apify.com/ninhothedev/open-library-book-scraper) — editions, authors and covers from Open Library
- [Google Books Scraper](https://apify.com/ninhothedev/google-books-scraper) — Google Books search and volume metadata
- [Project Gutenberg Scraper](https://apify.com/ninhothedev/project-gutenberg-scraper) — 70k+ free public-domain ebooks
- [Crossref Scraper](https://apify.com/ninhothedev/crossref-scraper) — DOI and scholarly publication metadata

***

### Legal

This actor reads HathiTrust's public Bibliographic API, which is provided for programmatic access to catalog metadata and requires no authentication. Only bibliographic metadata is collected — no copyrighted page content. Respect HathiTrust's [terms of use](https://www.hathitrust.org/terms) and keep request volumes reasonable.

# Actor input Schema

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

Scraping mode. 'lookup' resolves a list of bibliographic identifiers into HathiTrust volume records (title, editions, holdings and rights).

## `idType` (type: `string`):

Which kind of identifier the 'Identifiers' list contains. All values in that list must be of this same type. ISBN and OCLC give the widest coverage; HTID targets a single digitized item; record number targets a HathiTrust catalog record directly.

## `ids` (type: `array`):

The identifiers to look up, all of the type chosen above. Up to 20 are packed into each API request. Identifiers with no HathiTrust holdings are skipped and reported in the log. Older / academic / public-domain titles have far better coverage than recent trade paperbacks.

## `useFullRecords` (type: `boolean`):

Use the API's 'full' level instead of 'brief'. Full records add the complete MARC-XML bibliographic record (authors, subjects, publisher, physical description) to the 'marc\_xml' field. Slower and much larger payloads — leave off unless you need MARC data.

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

Hard cap on how many volume records are written to the dataset. Use it to bound cost and runtime on long identifier lists.

## Actor input object example

```json
{
  "mode": "lookup",
  "idType": "isbn",
  "ids": [
    "9780195079630",
    "0226458075",
    "0195079639"
  ],
  "useFullRecords": false,
  "maxItems": 200
}
```

# 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 = {
    "ids": [
        "9780195079630",
        "0226458075",
        "0195079639"
    ],
    "maxItems": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/hathitrust-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 = {
    "ids": [
        "9780195079630",
        "0226458075",
        "0195079639",
    ],
    "maxItems": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/hathitrust-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 '{
  "ids": [
    "9780195079630",
    "0226458075",
    "0195079639"
  ],
  "maxItems": 200
}' |
apify call ninhothedev/hathitrust-scraper --silent --output-dataset

```

## MCP server setup

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