Book search
Searches Open Library's 20M+ books by keywords, title, author, subject, publisher, ISBN, person, place or time period, with language, first-publication-year, full-text and e-book access filters: work id, title, authors, first publish year, edition count, cover, ISBNs, languages, subjects, publishers, median pages, rating, want-to-read and read counts, e-book access. Sort by relevance, newest, oldest, rating, editions, title or random. Pass next_page back as page; null on the last page.
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
q | string | Keywords. Example: dune |
title | string | Title. |
author | string | Author. |
subject | string | Subject. |
publisher | string | Publisher. |
language | string | Language (3-letter MARC code: eng, fre, spa, ger...). |
from_year | integer | First published in or after. |
to_year | integer | First published in or before. |
sort | relevance | new | old | rating | editions | title | random | Sort order. |
limit | integer | Per page (default 20, max 100). |
page | integer | Page (default 1). |
isbn | string | ISBN-10 or ISBN-13. |
person | string | Person the book is about or features, e.g. sherlock holmes. |
place | string | Place the book is about or set in, e.g. london. |
time | string | Time period the book is about, e.g. 19th century. |
has_fulltext | boolean | true: books with a readable or borrowable digital copy; false: without. |
ebook_access | public | borrowable | printdisabled | Minimum e-book access: public (free to read), borrowable (public or borrowable) or printdisabled (any digital copy). |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/books/v1/search?q=dune" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/books/v1/search",
params={"q": "dune"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/books/v1/search");
url.searchParams.set("q", "dune");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).