Books by Subject API
Books filed under any Open Library subject, such as science fiction or cooking: work id, title, authors, first publish year, edition count, cover, full-text availability and the work's own subject tags, ranked by edition count, newest, oldest, rating or reading lists, with an optional publish-year range.
$0.50 per 1,000 records
You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.
Data from openlibrary.org/subjects
Get this data
Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.
Try it
Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key
For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
- Small runs answer in the same request; longer ones answer
202with a run to poll. fieldsreturns only the fields you name. The examples send the ones picked on this page.Idempotency-Keyis optional. A retry with it is never charged twice.- You pay for records returned. Zero records cost zero.
curl -X POST "https://pullrow.dev/v1/apis/open-library-subjects/run" \
-H "Authorization: Bearer $PULLROW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"subjects":["science_fiction"]},"max_items":50}'Inputs
Send them as input in the request body. Leave one out to use its default.
What's in each record
18 fields: 17 here, 1 technical one under Technical details.
Basics
- Subject
The subject the book was listed under, as Open Library's key, such as science_fiction.
Example science_fiction
- Subject name
Open Library's name of that subject, such as science fiction.
Example science fiction
- Subject work count
How many works Open Library files under the subject with the chosen filters.
Example 14,601
- Rank
Position of the book in the subject list in the chosen order; 1 is the first.
Example 1
- Work key
Open Library's work id, such as OL138052W: one id for all editions of a book.
Example OL138052W
- Title
Title of the work.
Example Alice's Adventures in Wonderland
- Authors
Author names, as Open Library lists them.
Example Lewis Carroll
- Author keys
Open Library ids of those authors, such as OL22098A, in the same order.
Example OL22098A
- Edition count
Number of editions Open Library lists for the work (printings, translations, formats).
Example 3,549
- Has fulltext
Yes when Open Library holds a scanned copy of some edition (free to read, to borrow or for print-disabled readers).
Example Yes
- Public scan
Yes when a scanned copy is free for anyone to read (public domain).
Example Yes
- Availability
Reading access on Open Library: open (free to read), borrow_available, borrow_unavailable (waitlist) or private (print-disabled readers only); empty when there is no scan.
Example open
- Tags
The work's own subject headings on Open Library, up to 30, such as Fantasy & Magic.
Example Alice (fictitious character : carroll), fiction, British and irish fiction (fictional works by one author)
Dates
- First publish year
The year the work first came out, as Open Library records it.
Example 1865
Links
- Link
The book's page on Open Library.
Example openlibrary.org/works/OL138052W
Pictures and media
- Cover
The cover image, large size, from covers.openlibrary.org.
Example Open the image
- Cover edition key
Open Library id of the edition the cover comes from, such as OL31754751M.
Example OL31754751M
Technical detailsField names and types for developers, and the 1 field hidden above
Hidden by default
This field comes with each record too. It is an internal code, a note about how the record was read or a copy of what was searched for, so the lists above leave it out.
- Cover ID
cover_idOpen Library's id of the work's cover image.
Field names and types
The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.
| Field name | Type | Shown on this page as | Filled |
|---|---|---|---|
subject | text | Subject | 3 of 3 |
subject_name | text | Subject name | 3 of 3 |
subject_work_count | number | Subject work count | 3 of 3 |
rank | number | Rank | 3 of 3 |
work_key | text | Work key | 3 of 3 |
url | link | Link | 3 of 3 |
title | text | Title | 3 of 3 |
authors | list | Authors | 3 of 3 |
author_keys | list | Author keys | 3 of 3 |
first_publish_year | number | First publish year | 3 of 3 |
edition_count | number | Edition count | 3 of 3 |
cover_id | number | Cover ID (hidden) | 3 of 3 |
cover_url | image link | Cover | 3 of 3 |
cover_edition_key | text | Cover edition key | 3 of 3 |
has_fulltext | yes or no | Has fulltext | 3 of 3 |
is_public_scan | yes or no | Public scan | 3 of 3 |
availability | text | Availability | 3 of 3 |
tags | list | Tags | 3 of 3 |
How it reads the site
Runs on a reader we built and maintain by hand for this site.
Save as pipeline
A pipeline remembers this API, your inputs and the fields you picked. It can run on a schedule and email you the results.
Sample records
| Record | Title | Subject | Subject name | Subject work count | Rank | Work key | Authors | Author keys | Edition count | Has fulltext | Public scan | Availability | Tags | First publish year | Link | Cover | Cover edition key |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alice's Adventures in Wonderland | science_fiction | science fiction | 14,601 | 1 | OL138052W | Lewis Carroll | OL22098A | 3,549 | Yes | Yes | open | Alice (fictitious character : carroll), fiction, British and irish fiction (fictional works by one author), Fiction, fantasy, general, JUVENILE FICTION | 1865 | openlibrary.org/works/OL138052W | covers.openlibrary.org/b/id/10527843-L.jpg | OL31754751M |
| 2 | Frankenstein; or, The Modern Prometheus | science_fiction | science fiction | 14,601 | 2 | OL450063W | Mary Shelley | OL25342A | 2,187 | Yes | Yes | open | Frankenstein (Fictitious character), Frankenstein's monster (Fictitious character), Fiction, Victor Frankenstein (Fictitious character) | 1818 | openlibrary.org/works/OL450063W | covers.openlibrary.org/b/id/12356249-L.jpg | OL35649409M |
| 3 | Twilight | love__romance | love romance | 597 | 1 | OL5720023W | Stephenie Meyer | OL1391085A | 133 | Yes | No | borrow_available | series:Luz_e_Escuridão, series:Twilight, New York Times bestseller, nyt:series_books=2008-03-15 | 2005 | openlibrary.org/works/OL5720023W | covers.openlibrary.org/b/id/12641977-L.jpg | OL25418289M |
Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.
Reliability
Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.
Incidents and repairs
How it is kept working What a repair can't do
A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.
- You pay only for records returned. A run that returns none costs nothing.
- Subjects are Open Library's own subject keys, such as science_fiction, cooking, place:london or time:19th_century. Plain words become keys the way Open Library makes them (Love & Romance becomes love__romance); a subject Open Library does not use returns no books.
- The year range keeps works with at least one edition published in those years, so a classic reprinted since then still counts. It does not filter on the year a work first came out.
- Open Library's catalog is built by libraries and volunteers: coverage is broad but uneven, and first_publish_year is sometimes missing or wrong on old records (a year of 0 comes back empty).
- Up to 5,000 books per run. Requests are spaced about a second apart to keep the load on Open Library low, so 1,000 books take about 30 seconds.
- sort old puts works with no known first publish year first; rating and want_to_read follow Open Library readers' own ratings and reading lists.
- Open Library data is open (mostly CC0 or public domain): credit Open Library (openlibrary.org) when you publish it. Cover images carry their own rights.
Version history
A run uses the live version unless the request names another one with version.
Manage this API
Only your workspace sees this part.
Automatic repair
Off: a rebuilt version is stored and waits for you in the version history.
Delete this API
Removes the API, its versions and the saved records of its runs. Calls to its address then answer 404. Records already charged stay charged. This cannot be undone.