# Open Library Books Scraper (`b2b_lead_generation/open-library-books-scraper`) Actor

Extract book and author metadata from Open Library. Search by keyword, title, author, subject, or ISBN to collect records, editions, descriptions, and cover URLs.

- **URL**: https://apify.com/b2b_lead_generation/open-library-books-scraper.md
- **Developed by:** [B2B Lead Generation](https://apify.com/b2b_lead_generation) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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/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

## Open Library Scraper: Book Search, ISBN Lookup, Authors, Ratings and Covers

<p align="center">
  <img src="https://imgur.com/Qh8WrCL.png" alt="Open Library Scraper" width="800" />
</p>

Collect book and author metadata for catalogs, research, reading lists, and recommendation datasets. Search by keyword, title, author, subject, or ISBN. Depending on the selected mode, results can include editions, publishers, page counts, ISBNs, subjects, ratings, reading-shelf counts, author biographies, and cover image URLs.

Cover images are provided as URLs. The actor does not download image files.

### What This Actor Extracts

- **Book Search:** Titles, authors, publication years, edition counts, ISBNs, publishers, and cover information.
- **Subject Search:** Book records associated with subjects such as `science_fiction`.
- **ISBN Lookup:** Edition details associated with ISBN-10 or ISBN-13 values.
- **Work Details:** Descriptions, subjects, ratings, reading-shelf counts, and optional edition lists.
- **Author Records:** Names, biographies, birth and death dates, external identifiers, and photo URLs.
- **Error Records:** Information about invalid inputs, missing records, and failed requests.

Search and subject results represent works, while ISBN lookups return edition-level records. Author mode returns author records and can optionally include a page of the author's works.

The `bookTitle` field is also available as `title`. Similarly, `bookDescription` is duplicated into `description` when available.

### Use Cases

- **Bookstore Catalogs:** Enrich ISBN records with titles, publishers, page counts, and cover links.
- **Publisher Research:** Compare editions, ratings, and reading-shelf activity.
- **Libraries and Education:** Build reading lists around specific subjects.
- **Recommendation Systems:** Create datasets containing book identifiers, subjects, and author references.
- **Author Research:** Collect biographies, publication references, and external identifiers.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | Operation mode: `search`, `isbn`, `works`, `authors`, or `subjects`. |
| `query` | string | `the lord of the rings` | Search keyword or author name in author mode. |
| `title` | string | Empty | Title filter for book searches. |
| `author` | string | Empty | Author filter for book searches. |
| `subject` | string | Empty | Search filter or subject slug, such as `science_fiction`. |
| `language` | string | Empty | Three-letter language code, such as `eng`. |
| `sort` | string | Empty | Sort order: `new`, `old`, `random`, or `key`. Blank preserves relevance order. |
| `isbns` | array | Empty | ISBN-10 or ISBN-13 values. Dashes are removed. |
| `ids` | array | Empty | Work or author identifiers, such as `OL45804W` or `OL26320A`, or supported Open Library URLs. |
| `includeEditions` | boolean | `false` | Attach up to 20 editions to each work. |
| `includeRatings` | boolean | `true` | Include ratings and reading-shelf counts where supported. |
| `includeAuthorWorks` | boolean | `false` | Attach one page of an author's works. |
| `maxItems` | integer | `100` | Maximum number of output rows. |
| `requestsPerSecond` | number | `2` | Controls the request rate. |
| `timeoutSecs` | integer | `300` | Maximum run duration in seconds. |
| `requestTimeoutSecs` | integer | `30` | Maximum duration for an individual request. |

### Example Inputs

#### Search for Books

```json
{
  "mode": "search",
  "query": "the lord of the rings",
  "maxItems": 20,
  "includeRatings": true,
  "requestsPerSecond": 2,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30
}
```

#### Look Up an ISBN

```json
{
  "mode": "isbn",
  "isbns": ["9780441172719"]
}
```

#### Retrieve Work Details

```json
{
  "mode": "works",
  "ids": ["OL893414W"],
  "includeEditions": true,
  "includeRatings": true
}
```

#### Search for an Author

```json
{
  "mode": "authors",
  "query": "Frank Herbert",
  "includeAuthorWorks": true,
  "maxItems": 20
}
```

#### Search by Subject

```json
{
  "mode": "subjects",
  "subject": "science_fiction",
  "maxItems": 100
}
```

### Output Examples

Results are saved to the default dataset. The following examples illustrate the available output structure.

#### Book Search Result

```json
{
  "recordKind": "book",
  "workKey": "/works/OL893414W",
  "workId": "OL893414W",
  "url": "OPEN_LIBRARY_WORK_URL",
  "bookTitle": "Dune",
  "title": "Dune",
  "authors": ["Frank Herbert"],
  "firstPublishYear": 1965,
  "editionCount": 101,
  "isbns": ["9780441172719"],
  "publishers": ["Ace Books"],
  "coverId": 980253,
  "coverUrl": "BOOK_COVER_IMAGE_URL",
  "query": "dune"
}
```

#### Work Details

A work-detail record can include `bookDescription`, subjects, ratings, and reading-shelf counts, along with an optional edition list.

#### ISBN Lookup

An edition record can include:

- `editionKey`
- `isbn10`
- `isbn13`
- `publishDate`
- `numberOfPages`
- `identifiers`

#### Author Record

An author record can include:

- `authorKey`
- `name`
- `bio`
- `remoteIds`
- `photoUrl`
- Birth and death dates, when available

External identifiers may include Wikidata, VIAF, ISNI, Goodreads, and Amazon identifiers when present in the source record.

### Output Fields

| Field | Type | Description |
|---|---|---|
| `recordKind` | string | Record type, such as `book`, `author`, or `error`. |
| `workKey` | string | Work key, such as `/works/OL45804W`. |
| `workId` | string | Work identifier without the path prefix. |
| `bookTitle` | string | Book title; also stored in `title`. |
| `title` | string | Duplicate title field for convenient dataset access. |
| `authors` | array | Author names associated with a work. |
| `firstPublishYear` | integer | First publication year, when available. |
| `editionCount` | integer | Number of editions associated with the work. |
| `isbns` | array | Up to 20 ISBNs from a search record. |
| `publishers` | array | Publisher names, capped at 10 in search results. |
| `subjects` | array | Associated subjects, capped at 30 in search results. |
| `coverId` | integer | Cover identifier. Invalid cover IDs such as `-1` are discarded. |
| `coverUrl` | string | Cover image URL. The image file is not downloaded. |
| `bookDescription` | string | Work description; also stored in `description` when available. |
| `ratings` | object | Average rating, rating count, and star-count breakdown, when available. |
| `shelves` | object | Counts for want-to-read, currently-reading, and already-read shelves. |
| `authorKey` | string | Author identifier. |
| `bio` | string or object | Author biography, when available. |
| `remoteIds` | object | External identifiers, such as Wikidata, VIAF, ISNI, Goodreads, and Amazon IDs. |
| `photoUrl` | string | Author photo URL, when available. |
| `url` | string | Reference URL for the associated work or record. |
| `error` | string | Error type, such as `NOT_FOUND`, `HTTP_<code>`, or `INVALID_INPUT`. |
| `statusCode` | integer | HTTP status code for a failed request, when available. |

The exact fields depend on the selected mode and the information available for each record.

### FAQ

#### What types of book information can I collect?

Depending on the selected mode, results can include titles, authors, publication years, ISBNs, publishers, editions, descriptions, ratings, reading-shelf counts, and cover URLs.

#### Can I search for books by ISBN?

Yes. Select `isbn` mode and provide one or more ISBN-10 or ISBN-13 values in the `isbns` array.

#### What is the difference between work and edition records?

A work represents the overall book, while an edition represents a particular published version. Search and subject modes return work records; ISBN lookups return edition-level records.

#### Can I collect author biographies and their books?

Yes. Use `authors` mode with an author name in `query`. Set `includeAuthorWorks` to `true` to include one page of that author's works.

#### Are book cover images downloaded?

No. The dataset includes cover image URLs, not the actual image files.

#### What happens when an ISBN or book cannot be found?

The actor can return an error record containing the input, error type, and available status code. It can continue processing the remaining inputs.

#### Why are some metadata fields missing?

Not every work, edition, or author has complete information. Missing values reflect information unavailable in the source records and are not fabricated.

#### What does `iaIdentifiers` mean?

Some book records include Internet Archive identifiers that can reference scanned material. These identifiers are metadata references; the actor does not automatically download scanned books.

### Trademark Notice

Open Library and Internet Archive are names associated with their respective owners. This actor is an independent tool and does not imply affiliation, sponsorship, endorsement, or partnership with either organization.

### Disclaimer

This actor is provided as an independent data collection tool. Users are responsible for verifying collected information and ensuring their use complies with applicable laws, licences, and website policies.

### Is Web Scraping Legal?

This actor collects publicly accessible book and author metadata without bypassing login screens, paywalls, or technical security measures. How collected information can be used depends on applicable laws and the source's policies.

- **Personal Data:** Author biographies, names, and related identifiers may contain personal information. Handle such data in accordance with applicable privacy laws, including GDPR or CCPA where relevant.
- **Copyright and Licensing:** Book descriptions, biographies, cover images, and other creative content may be protected by copyright. Avoid unauthorized reproduction or redistribution, and check the applicable licences before reuse.
- **Platform Terms and Rate Limits:** Respect the source's policies and request limits when collecting or using information.
- **Disclaimer:** This information is general guidance, not legal advice. Consult a qualified legal professional if you need advice about a specific use case.

[Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

# Actor input Schema

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

Search books, look up ISBNs, fetch one work, search authors, or list books in a subject.

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

Keyword for book search, or the author name when mode is authors and no author ID is set.

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

Book title filter for search mode. Sent as the title parameter on search.json.

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

Author name filter for search mode. Sent as the author parameter on search.json.

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

Search filter, or the subject slug in subjects mode, such as science_fiction.

## `language` (type: `string`):

Three-letter code such as eng. Passed to search.json as the language parameter. This filter was not re-checked on 2026-10-12.

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

Sort for search.json. Leave blank for relevance. new, old, random, and key are documented sort values.

## `isbns` (type: `array`):

ISBN-10 or ISBN-13 values for isbn mode. Dashes are stripped. Each ISBN calls the verified /isbn/{isbn}.json endpoint.

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

Work IDs such as OL45804W, author IDs such as OL26320A, or full openlibrary.org URLs.

## `includeEditions` (type: `boolean`):

On works mode, attach up to 20 editions from /works/{id}/editions.json. Off by default to keep the run small.

## `includeRatings` (type: `boolean`):

Fetch /ratings.json and /bookshelves.json. In search mode this stays off when max results is above 200, because those are two extra calls per book.

## `includeAuthorWorks` (type: `boolean`):

On authors mode, attach one page of works from /authors/{id}/works.json. Off by default.

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

Free cap 5,000. Open Library asks not to use the API for bulk downloads. Use their monthly dumps for a full catalog.

## `requestsPerSecond` (type: `number`):

Open Library allows 3 requests per second for identified clients. Default is 2. A 403 or 429 waits 60 seconds, then cuts this rate in half.

## `contactEmail` (type: `string`):

Open Library asks for a contact in the User-Agent. Leave blank to use BigiByteResearch/1.0 (https://bigibyte.com; research@bigibyte.com).

## `timeoutSecs` (type: `integer`):

Stop the run after this many seconds. Default 300. Maximum 3600.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout. Open Library search often takes 2 to 4 seconds, so the default is 30.

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

Optional. Open Library forbids spreading requests across many IPs, so this stays off. If you enable it, the actor uses one proxy URL for the whole run and does not rotate.

## Actor input object example

```json
{
  "mode": "search",
  "query": "the lord of the rings",
  "title": "Dune",
  "author": "Frank Herbert",
  "subject": "science_fiction",
  "language": "eng",
  "sort": "",
  "isbns": [
    "9780441172719"
  ],
  "ids": [
    "OL45804W",
    "OL26320A"
  ],
  "includeEditions": false,
  "includeRatings": true,
  "includeAuthorWorks": false,
  "maxItems": 100,
  "requestsPerSecond": 2,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `books` (type: `string`):

Work key, book title, first publish year, edition count, and cover URL.

## `authors` (type: `string`):

Author name, key, birth and death dates, and work count.

## `errors` (type: `string`):

Inputs that failed, with the error code and HTTP status.

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

Every row from the run, without a table view applied.

# 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": "the lord of the rings",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_lead_generation/open-library-books-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": "the lord of the rings",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/open-library-books-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": "the lord of the rings",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call b2b_lead_generation/open-library-books-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,b2b_lead_generation/open-library-books-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/GJBzclYqmN9Mbz5yK/builds/rcCOhGhiSba1DO35h/openapi.json
