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.

Try it
Ready-made, maintained by usRecords, 18 fieldsv1.0

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

Subjects
Subjects to list books for, such as ["science_fiction", "cooking"]. Plain words work too (Science Fiction), as do place:, person: and time: subjects such as place:london. One per line, or separated by commas.
Example: science_fiction
Published fromoptional
Keep only works with an edition published in or after this year, such as 2000.
Example: 2000
Published tooptional
Keep only works with an edition published in or before this year, such as 2020.
Example: 2020
Sortoptional
Order of the books: editions (most editions first, Open Library's own default), new (newest first), old (oldest first), rating (best rated first) or want_to_read (most on readers' lists first).
Only full textoptional
true keeps only works Open Library holds a scanned copy of (free to read, to borrow or for print-disabled readers).
Maximum resultsoptional
Books per subject, from 1 to 5,000, in the chosen order.
Example: 200

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
Endpoint
POSThttps://pullrow.dev/v1/apis/open-library-subjects/run
  • Small runs answer in the same request; longer ones answer 202 with a run to poll.
  • fields returns only the fields you name. The examples send the ones picked on this page.
  • Idempotency-Key is optional. A retry with it is never charged twice.
  • You pay for records returned. Zero records cost zero.

Every run option, explained

Calling it needs a key
10,000 free records of this API to start. No card.
curl
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.

subjectslistrequired
Subjects to list books for, such as ["science_fiction", "cooking"]. Plain words work too (Science Fiction), as do place:, person: and time: subjects such as place:london.
example: science_fiction
published_fromnumber
Keep only works with an edition published in or after this year, such as 2000.
example: 2000
published_tonumber
Keep only works with an edition published in or before this year, such as 2020.
example: 2020
sorttext
Order of the books: editions (most editions first, Open Library's own default), new (newest first), old (oldest first), rating (best rated first) or want_to_read (most on readers' lists first).
default: editionsexample: editionsone of: editions, new, old, rating, want_to_read
only_full_textyes/no
true keeps only works Open Library holds a scanned copy of (free to read, to borrow or for print-disabled readers).
default: falseexample: false
max_resultsnumber
Books per subject, from 1 to 5,000, in the chosen order.
default: 100example: 200

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

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 nameTypeShown on this page asFilled
subjecttextSubject3 of 3
subject_nametextSubject name3 of 3
subject_work_countnumberSubject work count3 of 3
ranknumberRank3 of 3
work_keytextWork key3 of 3
urllinkLink3 of 3
titletextTitle3 of 3
authorslistAuthors3 of 3
author_keyslistAuthor keys3 of 3
first_publish_yearnumberFirst publish year3 of 3
edition_countnumberEdition count3 of 3
cover_idnumberCover ID (hidden)3 of 3
cover_urlimage linkCover3 of 3
cover_edition_keytextCover edition key3 of 3
has_fulltextyes or noHas fulltext3 of 3
is_public_scanyes or noPublic scan3 of 3
availabilitytextAvailability3 of 3
tagslistTags3 of 3

How it reads the site

Runs on a reader we built and maintain by hand for this site.

Sample records

Sample records
RecordTitleSubjectSubject nameSubject work countRankWork keyAuthorsAuthor keysEdition countHas fulltextPublic scanAvailabilityTagsFirst publish yearLinkCoverCover edition key
1Alice's Adventures in Wonderlandscience_fictionscience fiction14,6011OL138052WLewis CarrollOL22098A3,549YesYesopenAlice (fictitious character : carroll), fiction, British and irish fiction (fictional works by one author), Fiction, fantasy, general, JUVENILE FICTION1865openlibrary.org/works/OL138052Wcovers.openlibrary.org/b/id/10527843-L.jpgOL31754751M
2Frankenstein; or, The Modern Prometheusscience_fictionscience fiction14,6012OL450063WMary ShelleyOL25342A2,187YesYesopenFrankenstein (Fictitious character), Frankenstein's monster (Fictitious character), Fiction, Victor Frankenstein (Fictitious character)1818openlibrary.org/works/OL450063Wcovers.openlibrary.org/b/id/12356249-L.jpgOL35649409M
3Twilightlove__romancelove romance5971OL5720023WStephenie MeyerOL1391085A133YesNoborrow_availableseries:Luz_e_Escuridão, series:Twilight, New York Times bestseller, nyt:series_books=2008-03-152005openlibrary.org/works/OL5720023Wcovers.openlibrary.org/b/id/12641977-L.jpgOL25418289M

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.
Known limits
  • 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.