# Open Library Search Scraper - Books by Title, Author & Subject (`ninhothedev/openlibrary-search-scraper`) Actor

$0.4/1K 🔥 Open Library search scraper! Find books by title, author or subject with ratings, editions & covers. No key. JSON, CSV, Excel or API in seconds. Build book discovery apps ⚡

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

## Pricing

from $0.40 / 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?

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 Search Scraper 📚 — Find Books by Title, Author or Subject

**Search the world's largest open book catalogue and export structured book data — no API key, no login, no rate-limit headaches.**

This Apify actor turns [Open Library](https://openlibrary.org) (the Internet Archive's open book database, 40M+ works) into a clean, paginated dataset. Give it a search term, an author name or a subject, and get back titles, authors, publication years, publishers, ISBNs, languages, subjects, edition counts, **star ratings**, reading-list stats, full-text availability and high-resolution cover URLs.

***

### 🔍 How is this different from `open-library-book-scraper`?

This is the **discovery / search** counterpart to my other actor. They solve two opposite problems:

| | **Open Library Search Scraper** (this actor) | [**Open Library Book Scraper**](https://apify.com/ninhothedev/open-library-book-scraper) |
|---|---|---|
| **You start with** | A *question*: "sci-fi books", "Le Guin", "dune" | A *known identifier*: an ISBN or an Open Library work/edition ID |
| **Answers** | "**Which** books exist that match this?" | "**What do I know** about this exact book?" |
| **Input** | Free-text queries, author names, subjects | ISBN-10/ISBN-13, work keys, edition keys |
| **Output** | Ranked lists of matching works — many books per query | Deep record for one specific book |
| **Extra fields** | Ratings, edition counts, want-to-read/already-read counts, full-text & public-scan flags, people/places | Edition-level detail for the looked-up book |
| **Typical use** | Building catalogues, discovery feeds, genre datasets | Enriching an existing ISBN list |

**Rule of thumb:** if you *have* ISBNs, use `open-library-book-scraper`. If you need to *find* books in the first place, use **this** actor. Many users run this one to build a list, then pipe the ISBNs into the other for deeper enrichment.

***

### ✨ Features

- **Three search modes** — free-text `search`, `author` and `subject`
- **Ratings & popularity** — average star rating, rating count, want-to-read and already-read counts
- **Edition intelligence** — edition counts, median page count, publisher list, up to 10 ISBNs per work
- **Availability signals** — `has_fulltext` and `public_scan` tell you what's readable for free on the Internet Archive
- **Cover images** — ready-to-use large cover URLs
- **Rich metadata** — subjects, languages, characters (people), settings (places), opening sentence
- **Automatic pagination** — offsets handled for you, up to 1,000 books per run
- **Deduplication** — results deduped by Open Library work key across all your terms
- **No API key. No proxies required.** Open Library's JSON API is fully public.

***

### 💰 Pricing

Roughly **$0.50 per 1,000 books** on Apify's pay-per-event compute. Runs at 512 MB, and a 100-book run typically completes in well under a minute. No third-party API costs — Open Library is free and open.

***

### 🚀 Input

```json
{
  "mode": "search",
  "queries": ["dune", "neuromancer"],
  "maxItems": 100
}
```

Search by author:

```json
{
  "mode": "author",
  "authors": ["Ursula K. Le Guin", "Isaac Asimov"],
  "maxItems": 200
}
```

Search by subject/genre:

```json
{
  "mode": "subject",
  "subjects": ["science_fiction", "historical fiction"],
  "maxItems": 500
}
```

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | select | `search` | `search` (free text), `author` (by author name), `subject` (by genre/subject) |
| `queries` | array | `["dune","neuromancer"]` | Free-text terms — used in `search` mode |
| `authors` | array | – | Author names — used in `author` mode |
| `subjects` | array | – | Subjects/genres — used in `subject` mode (spaces auto-converted to underscores) |
| `maxItems` | integer | `100` | Max books across all terms combined (max 1000) |

***

### 📦 Output

One dataset item per book (work):

```json
{
  "work_key": "/works/OL893516W",
  "title": "Children of Dune",
  "subtitle": null,
  "authors": ["Frank Herbert"],
  "author_keys": ["OL79034A"],
  "first_publish_year": 1976,
  "publishers": ["Ace Books", "Berkley Publishing", "Gollancz"],
  "isbns": ["0425071790", "9780441104024"],
  "languages": ["eng", "ger", "fre"],
  "subjects": ["Dune (Imaginary place)", "Fiction", "Science fiction"],
  "edition_count": 77,
  "page_count_median": 504,
  "rating": 3.9574,
  "ratings_count": 47,
  "want_to_read": 277,
  "already_read": 132,
  "has_fulltext": true,
  "public_scan": false,
  "first_sentence": "A SPOT of light appeared on the deep red rug...",
  "people": ["Paul Atreides"],
  "places": ["Arrakis"],
  "cover_url": "https://covers.openlibrary.org/b/id/6976407-L.jpg",
  "url": "https://openlibrary.org/works/OL893516W",
  "source": "openlibrary",
  "scraped_at": "2026-07-28T13:00:00+00:00",
  "input_term": "dune",
  "input_mode": "search"
}
```

Every field is nullable — Open Library is community-maintained, so coverage varies by book. Export as JSON, CSV, Excel, XML or via the Apify API.

***

### 🎯 Use cases

- **Book discovery apps** — power search, "more like this" and browse-by-genre features without building your own index
- **Library & catalogue apps** — check which editions and ISBNs exist for a title before ordering or cataloguing
- **Reading datasets for research & ML** — build genre-labelled corpora with ratings and publication years for analysis
- **Recommendation engines** — combine subjects, people, places and rating signals into a content-based recommender
- **Bookstore & publisher intelligence** — see which publishers dominate a genre and how many editions a work has spawned
- **Free-to-read audits** — filter on `has_fulltext` and `public_scan` to surface books legally readable on the Internet Archive

***

### 🔗 Related actors by ninhothedev

- [Open Library Book Scraper](https://apify.com/ninhothedev/open-library-book-scraper) — ISBN & work-ID lookups (the enrichment counterpart to this actor)
- [HathiTrust Scraper](https://apify.com/ninhothedev/hathitrust-scraper) — academic & digitized library holdings
- [Google Books Scraper](https://apify.com/ninhothedev/google-books-scraper) — Google Books metadata, previews and sales links
- [Project Gutenberg Scraper](https://apify.com/ninhothedev/project-gutenberg-scraper) — 70k+ free public-domain ebooks with download links

***

### ❓ FAQ

**Do I need an Open Library API key?** No. The search endpoint is public and free.

**How many books can I get per run?** Up to 1,000 per run (`maxItems`). Run the actor multiple times with different terms for larger datasets.

**Are results deduplicated?** Yes — by Open Library work key, across all your queries in a single run.

**Why is a field empty?** Open Library data is crowd-sourced. Rating and page-count fields only exist for books that readers have logged. All fields are nullable by design.

**Can I search by ISBN here?** You can, but the dedicated [Open Library Book Scraper](https://apify.com/ninhothedev/open-library-book-scraper) is purpose-built for that and returns more edition-level detail.

**Is scraping Open Library allowed?** Open Library publishes an open, documented JSON API intended for public use. This actor sends a descriptive user agent and paginates politely.

***

### 🛠 Local development

```bash
pip install -r requirements.txt
python -m src.main
python tests/test_smoke.py   # offline smoke tests
```

***

*Data source: [Open Library](https://openlibrary.org), a project of the Internet Archive. This actor is not affiliated with or endorsed by the Internet Archive.*

# Actor input Schema

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

What kind of discovery to run. 'search' does a free-text query across titles, authors and subjects, 'author' searches by author name only, 'subject' searches by subject/genre only. The matching input field below is used for the selected mode.

## `queries` (type: `array`):

Free-text search terms used when mode is 'search'. Anything you would type into the Open Library search box works: book titles, series names, keywords or author names, e.g. 'dune' or 'neuromancer'.

## `authors` (type: `array`):

Author names used when mode is 'author'. Each entry returns the works attributed to that author, e.g. 'Ursula K. Le Guin' or 'Isaac Asimov'.

## `subjects` (type: `array`):

Subjects or genres used when mode is 'subject'. Spaces are converted to underscores automatically, e.g. 'science\_fiction', 'fantasy' or 'historical fiction'.

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

Maximum number of books to push to the dataset across all queries, authors or subjects combined. Results are deduplicated by Open Library work key. Default 100, maximum 1000.

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "dune",
    "neuromancer"
  ],
  "authors": [
    "Ursula K. Le Guin"
  ],
  "subjects": [
    "science_fiction"
  ],
  "maxItems": 100
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "queries": [
        "dune",
        "neuromancer"
    ],
    "authors": [
        "Ursula K. Le Guin"
    ],
    "subjects": [
        "science_fiction"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/openlibrary-search-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 = {
    "queries": [
        "dune",
        "neuromancer",
    ],
    "authors": ["Ursula K. Le Guin"],
    "subjects": ["science_fiction"],
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/openlibrary-search-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 '{
  "queries": [
    "dune",
    "neuromancer"
  ],
  "authors": [
    "Ursula K. Le Guin"
  ],
  "subjects": [
    "science_fiction"
  ]
}' |
apify call ninhothedev/openlibrary-search-scraper --silent --output-dataset

```

## MCP server setup

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