# Open Library Scraper — Books, Authors & Subjects (`logiover/openlibrary-scraper`) Actor

Scrape Open Library by search query, subject, or author. Extract title, ISBN, ratings, cover, publisher, subjects, and edition count for research, cataloging, and book discovery. No API key, no login.

- **URL**: https://apify.com/logiover/openlibrary-scraper.md
- **Developed by:** [Logiover](https://apify.com/logiover) (community)
- **Categories:** Other
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Open Library Scraper — Books, Authors, Subjects & ISBN Data

Extract millions of book records from Open Library by search query, subject, author, or work ID. No API key, no login — 100% keyless, powered by the official Open Library REST API.

### What does Open Library Scraper do?

Open Library Scraper connects directly to the Open Library REST API (`openlibrary.org`) — the world's largest open catalog of books with over 20 million records — and extracts structured book data at scale. It operates in four modes: **search** (full-text query across all books), **bookDetail** (deep data for a specific work by ID), **subject** (browse books within a genre or topic), and **author** (search authors and their catalogs). The actor paginates through results page by page, collecting up to thousands of records per run. Each book record includes title, author names, ISBN, edition count, publishers, subjects, community ratings, language, and a direct cover image URL. The engine uses `got-scraping` with descriptive User-Agent headers and Apify proxy support. No authentication is required — Open Library's API is freely accessible.

### Who is it for?

- **Researchers and academics** who need large bibliographic datasets for corpus analysis, NLP training, or citation studies.
- **LibraryTech developers** building recommendation engines, reading apps, or catalog software.
- **Data scientists** working on book metadata, genre classification, or publication trend analysis.
- **Publishers and marketers** tracking author presence, edition counts, and reader ratings across a subject area.
- **Educators and librarians** compiling reading lists, subject bibliographies, or comparing publishers.

### Use cases

- Scrape all science fiction books with their ratings to build a genre recommendation dataset.
- Extract ISBNs and publisher info for a subject area to populate a catalog database.
- Collect author metadata (work count, top works, subjects) for author authority files.
- Pull cover image URLs and first-publish years for a book discovery website.
- Monitor edition counts and community ratings for a set of classic works.

### Why use Open Library Scraper?

- **Fully keyless**: No API key, account, or login — runs out of the box.
- **20+ fields per book**: title, authors, ISBN, edition count, publishers, subjects, ratings, language, cover image, and more.
- **Bulk pagination**: Paginate to thousands of results per run with configurable `maxResults`.
- **Four modes**: search, subject browse, author search, and per-work deep detail.
- **Flexible filters**: Filter by title keyword, author name, or subject within search mode.
- **Export anywhere**: Results available as JSON, CSV, or Excel via Apify dataset — or push to Google Sheets, Slack, Webhooks.

### What data can you extract?

Every book record includes the following fields:

| Field | Type | Description |
|---|---|---|
| `key` | string | Open Library work key (e.g. `/works/OL45804W`) |
| `title` | string | Full book title |
| `authors` | string | Comma-separated author names |
| `firstPublishYear` | number or null | Year the work was first published; unknown/invalid source sentinels are returned as `null` |
| `isbn` | string | Up to 5 ISBNs (ISBN-10 or ISBN-13) |
| `editionCount` | string | Total number of editions across all formats |
| `publishers` | string | Comma-separated publisher names |
| `subjects` | string | Up to 8 subject tags/genres |
| `ratingsAverage` | string | Community average rating (out of 5) |
| `ratingsCount` | string | Total number of community ratings |
| `language` | string | Language codes (e.g. `eng`, `fre`) |
| `coverUrl` | string | URL of the book's cover image (large) |
| `openLibraryUrl` | string | Direct link to the book's Open Library page |
| `description` | string | Book description (available in bookDetail mode) |
| `mode` | string | Scraping mode used for this record |

**Example output record:**

```json
{
  "key": "/works/OL27258W",
  "title": "The Hitchhiker's Guide to the Galaxy",
  "authors": "Douglas Adams",
  "firstPublishYear": 1979,
  "isbn": "9780345391803, 0345391802, 9780330508117",
  "editionCount": "487",
  "publishers": "Pan Books, Del Rey Books, Harmony Books",
  "subjects": "Science fiction, Humorous fiction, Space, Adventure, Comedy",
  "ratingsAverage": "4.21",
  "ratingsCount": "188432",
  "language": "eng",
  "coverUrl": "https://covers.openlibrary.org/b/id/8267040-L.jpg",
  "openLibraryUrl": "https://openlibrary.org/works/OL27258W",
  "description": "Seconds before the Earth is demolished to make way for a hyperspace bypass, Arthur Dent is plucked off the planet...",
  "mode": "search"
}
```

### How to use

#### Option A — Search by keyword

The most common usage: search all books by a free-text query. Optionally filter by title or author name.

1. Set `mode` to `search`.
2. Enter your `query` (e.g. `"machine learning"` or `"tolkien fantasy"`).
3. Optionally set `title` or `author` to narrow results.
4. Set `maxResults` (default 200, up to 5000).

**Input example:**

```json
{
  "mode": "search",
  "query": "science fiction",
  "maxResults": 500
}
```

#### Option B — Browse by subject

Get all books within a subject/genre category. Subject slugs use underscores (e.g. `science_fiction`, `history`, `cookbooks`).

1. Set `mode` to `subject`.
2. Enter a `subject` slug (from openlibrary.org/subjects).
3. Set `maxResults`.

**Input example:**

```json
{
  "mode": "subject",
  "subject": "mystery_and_detective_stories",
  "maxResults": 300
}
```

#### Option C — Author search

Search for authors and their bibliographic data.

1. Set `mode` to `author`.
2. Enter `query` (the author name).
3. Set `maxResults`.

**Input example:**

```json
{
  "mode": "author",
  "query": "Isaac Asimov",
  "maxResults": 50
}
```

#### Option D — Book detail by work ID

Get full detail for specific works including description, subjects, and edition data.

1. Set `mode` to `bookDetail`.
2. Enter `workIds` array (e.g. `["OL45804W", "OL27258W"]`).

**Input example:**

```json
{
  "mode": "bookDetail",
  "workIds": ["OL27258W", "OL45804W", "OL262238W"]
}
```

### Input parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | Scraping mode: `search`, `bookDetail`, `subject`, or `author` |
| `query` | string | — | Free-text search query (used in `search` and `author` modes) |
| `title` | string | — | Filter by title keyword (used in `search` mode) |
| `author` | string | — | Filter by author name (used in `search` mode) |
| `subject` | string | — | Subject slug to browse (used in `subject` mode) |
| `workIds` | array | — | Array of Open Library work IDs for `bookDetail` mode |
| `maxResults` | integer | `200` | Maximum results to return (1–5000) |
| `proxyConfiguration` | object | Apify Proxy | Proxy settings (datacenter recommended) |

**Full input JSON:**

```json
{
  "mode": "search",
  "query": "artificial intelligence",
  "title": "",
  "author": "",
  "subject": "",
  "workIds": [],
  "maxResults": 1000,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

### Output example

```json
{
  "key": "/works/OL25368500W",
  "title": "Deep Learning",
  "authors": "Ian Goodfellow, Yoshua Bengio, Aaron Courville",
  "firstPublishYear": 2016,
  "isbn": "9780262035613, 0262035618",
  "editionCount": "12",
  "publishers": "MIT Press",
  "subjects": "Machine learning, Neural networks, Deep learning, Artificial intelligence",
  "ratingsAverage": "4.35",
  "ratingsCount": "4821",
  "language": "eng",
  "coverUrl": "https://covers.openlibrary.org/b/id/8228691-L.jpg",
  "openLibraryUrl": "https://openlibrary.org/works/OL25368500W",
  "description": null,
  "mode": "search"
}
```

### Tips for best results

- Use the **search mode with a broad query** first to gauge result volume; then narrow with `title` or `author` filters.
- Subject slugs must use underscores: `science_fiction` not `science fiction`. Browse `openlibrary.org/subjects` to find valid slugs.
- Set `maxResults` to 1000+ for research datasets — the actor paginates automatically.
- Open Library has best coverage of English-language books. For non-English works, add the language name to your query (e.g. `"french poetry"`).
- Work IDs in `bookDetail` mode can be in any format: `OL27258W`, `/works/OL27258W`, or just the numeric part.
- Ratings are community-sourced and only present on popular works. Expect `null` on obscure titles.
- Cover images are available in three sizes: replace `-L.jpg` with `-M.jpg` (medium) or `-S.jpg` (small).
- For ISBN lookups, use `search` mode with a query like `isbn:9780345391803` to find a book by ISBN.
- The actor respects Open Library's public API — no auth token needed, no rate-limit workarounds required.
- To get description text, use `bookDetail` mode with the work's ID. Search mode does not return descriptions.

### Integrations

Connect Open Library Scraper to your workflow with these Apify-native integrations:

- **Google Sheets**: Use Apify's Google Sheets integration to stream book records directly into a spreadsheet for sharing or further analysis.
- **Slack**: Get a Slack notification with result count and a sample record every time a scheduled run completes.
- **Zapier / Make**: Trigger downstream automations — add books to Notion, Airtable, or a custom database.
- **Webhooks**: Configure a webhook URL to receive the full result dataset as a JSON payload after each run.
- **Schedule**: Run on a weekly schedule to monitor new arrivals in a subject area or track rating changes over time.

### API usage

**cURL:**

```bash
curl -X POST "https://api.apify.com/v2/acts/logiover~openlibrary-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"search","query":"science fiction","maxResults":200}'
```

**Node.js (Apify client):**

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('logiover~openlibrary-scraper').call({
  mode: 'search',
  query: 'science fiction',
  maxResults: 200,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python:**

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")
run = client.actor("logiover~openlibrary-scraper").call(run_input={
    "mode": "search",
    "query": "science fiction",
    "maxResults": 200,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["title"], item["authors"])
```

### Use with AI agents (MCP)

Open Library Scraper is available as an MCP (Model Context Protocol) tool. You can instruct an AI agent: *"Use the Open Library scraper to find 500 science fiction books published after 2000 and return their titles, authors, and average ratings."* The actor returns structured JSON that AI agents can filter, rank, or summarize directly — ideal for building reading recommendation bots, literature review assistants, or dataset-building pipelines.

### FAQ

#### Does this actor require an API key?

No. Open Library's API is completely public and keyless. You can run this actor immediately without signing up for anything on Open Library's side.

#### How many books does Open Library have?

Open Library catalogs over 20 million book records. The search mode can return up to 5000 results per run, and subject browsing can surface thousands of titles per category.

#### What's the difference between a "work" and an "edition"?

A **work** is the canonical entry for a book (e.g. *Harry Potter and the Sorcerer's Stone*). An **edition** is a specific physical version — hardcover 2000, paperback 2003, etc. This actor returns work-level data by default; `bookDetail` mode also fetches edition data (ISBNs, publishers, languages).

#### Why are some fields null?

Open Library's coverage is community-driven. Lesser-known books may lack ISBNs, ratings, or cover images. Ratings are only shown when at least one user has rated the work. Use `bookDetail` mode for the most complete data on a specific work.

#### I got zero results — what should I try?

First check that your query is spelled correctly. For subject mode, make sure the slug uses underscores and is a valid Open Library subject (verify at `openlibrary.org/subjects/<slug>.json`). For author mode, try a partial name. If the problem persists, check Open Library's server status.

#### Can I export results to CSV or Excel?

Yes. From the Apify dataset view, use the **Export** button to download results as CSV, Excel, JSON, or JSONL. You can also push directly to Google Sheets via the Apify integration.

#### How fast is the actor?

In search mode, the actor fetches 100 records per API call. For 1000 results, expect roughly 10 API requests taking 20–40 seconds total. The actor runs with low resource usage (512 MB memory, datacenter proxy).

#### Is this legal to use?

Open Library is a project of the Internet Archive, a 501(c)(3) non-profit. All bibliographic data is published under open licenses (CC0 or CC BY). The actor uses the official public API with proper User-Agent headers, does not hammer endpoints, and complies with Open Library's terms of service for programmatic access.

#### What subject slugs are available?

Popular subjects include: `science_fiction`, `mystery_and_detective_stories`, `history`, `biography`, `cookbooks`, `romance`, `children`, `fantasy`, `self-help`, `business_economics`. Browse the full list at `openlibrary.org/subjects`.

#### How often is Open Library data updated?

Open Library is updated continuously by its community. New editions, ratings, and metadata improvements are pushed daily. Running this actor weekly will capture recent additions and rating changes.

#### Can I search by ISBN directly?

Yes — in `search` mode, set `query` to `isbn:9780345391803` (replace with your ISBN). The Open Library search API supports ISBN queries natively.

#### Are author photos included?

In `author` mode, the `coverUrl` field returns the author's photo URL from Open Library's author covers API (if available). Photos are stored at `covers.openlibrary.org/a/id/<id>-L.jpg`.

### Is it legal?

Open Library is an initiative of the Internet Archive and provides all bibliographic data under open licenses. The data accessed by this actor is publicly available via Open Library's official REST API, which is designed and documented for programmatic access. This actor does not scrape HTML pages, does not bypass any authentication, and uses descriptive User-Agent headers to identify itself. Use the extracted data in compliance with your local laws and Open Library's terms of service. For commercial use, verify that your intended application aligns with Open Library's data licensing (primarily CC0 and CC BY).

### Related scrapers

- **[OpenAlex Academic Papers Scraper](https://apify.com/logiover/openalex-academic-papers-scraper)** — Extract academic papers, citations, and author metadata from OpenAlex.
- **[PubMed Scraper](https://apify.com/logiover/pubmed-scraper)** — Scrape biomedical research articles from the PubMed database.
- **[Semantic Scholar Research Scraper](https://apify.com/logiover/semantic-scholar-research-scraper)** — Search and extract papers from Semantic Scholar with citation counts and abstracts.
- **[arXiv Paper Scraper](https://apify.com/logiover/arxiv-paper-scraper)** — Download preprint papers from arXiv by keyword, category, or author.

### 📝 Changelog

#### 2026-08-01

- Completed the August 2026 full health check: verified empty/programmatic default, Console UI default, and two source-informed alternative inputs on Apify.
- Confirmed successful live execution, non-empty structured output, dataset-field/type integrity, and logical sample quality within the 5-minute quality window.
- Normalized Open Library's year-0 unknown sentinel to null, aligned README examples with the numeric dataset contract, and made total API failure explicit instead of succeeding with an empty dataset.

#### 2026-08-01 — Health-check remediation

- August 2026 monthly health-check remediation is in progress; this build contains fixes verified from empty/default, Console-default, targeted live probes, or field-level semantic review.
- Normalized Open Library's year-0 unknown sentinel to null, aligned README examples with the numeric dataset contract, and made total API failure explicit instead of succeeding with an empty dataset.
- Converted Open Library's invalid year-0 sentinel to null, corrected the documented field type, and closed the all-upstream-failed successful-empty path.
- The final four-input matrix verdict will be appended after post-build cloud revalidation.

# Actor input Schema

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

What to scrape. 'trending' and an empty 'search' return popular books (great for a quick zero-config run). 'search' = full-text search; 'subject' = browse a genre; 'author' = search authors; 'bookDetail' = fetch specific work IDs.

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

Free-text search query for books or authors (used in 'search' and 'author' modes). Leave empty to browse popular books.

## `title` (type: `string`):

Filter search results by title keyword (used in 'search' mode alongside query).

## `author` (type: `string`):

Filter search results by author name (used in 'search' mode).

## `subject` (type: `string`):

Subject/genre to browse (used in 'subject' mode). Pick a common one or type your own slug (e.g. 'graphic\_novels').

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

Sort order for 'search' mode results.

## `trendingPeriod` (type: `string`):

Time window for 'trending' mode (and the zero-input default browse).

## `workIds` (type: `array`):

List of Open Library work IDs for book detail mode (e.g. 'OL45804W', '/works/OL45804W').

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

Maximum number of results to return (default 200, max 5000). Raise it to pull more.

## `proxyConfiguration` (type: `object`):

Proxy settings (AUTO recommended). Open Library is a public API; the actor also falls back to a direct connection on the final retry.

## Actor input object example

```json
{
  "mode": "trending",
  "sort": "",
  "trendingPeriod": "daily",
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All records extracted by this run. Open the Dataset tab to browse, filter, and export as CSV, JSON, or Excel.

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("logiover/openlibrary-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 = { "proxyConfiguration": { "useApifyProxy": True } }

# Run the Actor and wait for it to finish
run = client.actor("logiover/openlibrary-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call logiover/openlibrary-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=logiover/openlibrary-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/zrlKEJDqeBlvmwocM/builds/HndD45fdNsa8jEFdC/openapi.json
