API reference

Book metadata over HTTPS.

Look a book up by ISBN or by title and author, fix a record for everyone, or send an EPUB and get it back repaired.

Basics

The base URL is https://api.metadata.dev. Looking books up and repairing EPUBs need no key and no signup. Corrections and adding books need an API key, sent as Authorization: Bearer <key>. Responses are JSON unless the endpoint returns a file. CORS is open, so you can call it from a browser.

GET your first book
curl https://api.metadata.dev/books/9780441013593

The book object

Every lookup returns books in this shape. A field we have no value for is null, or [] for the lists.

application/json
{
  "id": "9780441013593",
  "isbn": "9780441013593",
  "title": "Dune",
  "author": "Frank Herbert",
  "description": "Set on the desert planet Arrakis…",
  "cover_url": "https://api.metadata.dev/covers/9780441013593",
  "page_url": "https://metadata.dev/book/dune-frank-herbert-9780441013593",
  "series": "Dune",
  "series_position": 1,
  "genres": ["Science Fiction", "Classics"],
  "page_count": 604,
  "release_year": 1965,
  "publisher": "Ace",
  "published_date": "2005-08-02",
  "language": "en",
  "asin": null
}
FieldTypeNotes
idstringThe ISBN-13, or an id like t-762af8168f5b for a book we know only by title and author. Use it anywhere an ISBN is accepted.
isbnstring | nullISBN-13, digits only. null when the book has no ISBN on record.
isbn10string | nullThe same ISBN in its 10-character form, when it has one. Read-only.
title, authorstringauthor can be null.
descriptionstring | nullUp to 6,000 characters.
cover_urlstring | nullAlways our hosted copy, at /covers/{id}.
page_urlstringThe book's page on metadata.dev, for linking or sharing. https://metadata.dev/book/{id} also works and redirects here.
series, series_positionstring, number | nullPosition can be fractional, such as 1.5 for a novella.
genresstring[]
page_countinteger | nullPrint length.
release_yearinteger | nullFirst publication of the work.
publisherstring | nullOf this edition.
published_datestring | nullWhen this edition came out: YYYY, YYYY-MM or YYYY-MM-DD, as much as is known.
languagestring | nullTwo-letter code, such as en.
asinstring | nullAmazon's identifier for this edition.

Look up by ISBN or id

GET /books/{id}

Takes an ISBN-10, an ISBN-13 (hyphens are fine), or a book id. If we don't know the ISBN yet, we look it up in the outside catalogs before answering, so a first request can take a second or two.

GET
curl https://api.metadata.dev/books/0-441-01359-7

Returns one book object, or 404 when no catalog knows the ISBN.

Look up by title and author

GET /books?title=…&author=…

Returns { "books": [...] } with the matching book, or an empty list. author is optional but makes the match much more reliable. Without it you can get several books that share a title.

Matching ignores case, punctuation, accents, bracketed edition notes such as (Deluxe Edition), and "Last, First" name order. A spelling we don't recognise is sent to the outside catalogs, which forgive more. If they draw a blank too, we work out which book you most likely mean, so a typo, a half-remembered title or even "that andy weir book about the guy stuck on mars" can still land. The first such lookup can take several seconds; the answer is remembered.

GET
curl -G https://api.metadata.dev/books \
  --data-urlencode "title=The Hobbit [illustrated]" \
  --data-urlencode "author=Tolkien, J.R.R."

Look up many ISBNs

GET /books?isbn=a,b,c

Up to 100 ISBNs, comma separated. Returns { "books": [...] } with the ones we already know. This call never asks the outside catalogs, so use the single lookup for anything it leaves out.

GET /books?q=…

Substring search over the titles and authors already in the catalog. Up to 20 results, shortest title first.

Covers

GET /covers/{id}

The cover image for a book, as JPEG or PNG, cached for a day. Every cover_url in a book object points here, so you never link to another site's image. We keep our own copy of each cover; one we haven't copied yet is fetched and stored on its first request. 404 means the book has no cover or its source was unreachable.

Series

GET /books/{id}/series

GET /series?name=…&author=…

A series in reading order, from one of its books or from its name. Use it to show "next in series" or to see which volumes a library is missing.

GET
curl https://api.metadata.dev/books/9780451458124/series
200
{
  "series": "The Dresden Files",
  "author": "Jim Butcher",
  "position": 2,
  "books": [
    { "position": 1, "title": "Storm Front", "release_year": 2000, "id": "9780451457813", "isbn": "9780451457813", "cover_url": "https://…" },
    { "position": 2, "title": "Fool Moon", … },
    { "position": 3, "title": "Grave Peril", "release_year": 2001, "id": null, "isbn": null, "cover_url": null }
  ],
  "next": { "position": 3, "title": "Grave Peril", … }
}

Changes

GET /changes?since=…

Books in the order their details last changed, for keeping your own copy of the catalog current without re-reading all of it. Call it with no since to start from the beginning, then keep passing back the next value you were given.

GET
curl "https://api.metadata.dev/changes?since=1794950203:9780451458124&limit=200"
200
{
  "books": [ { "id": "9780441013593", … , "changed_at": 1794951877 } ],
  "next": "1794951877:9780441013593",
  "more": false
}

Each book is a full book object plus changed_at, a Unix timestamp. limit is 200 by default and 500 at most. When more is true, call again straight away with next; when it is false you are up to date, and the same next is where to resume later. Treat the cursor as opaque.

Corrections

POST /books/{id}/corrections

Fix a record for everyone. Needs an API key. Send a JSON body with any of the book fields except id and isbn. Each change is checked against the current record before it applies.

POST
curl https://api.metadata.dev/books/9780441013593/corrections \
  -H "Authorization: Bearer $METADATA_KEY" \
  -d '{"page_count": 612, "genres": ["Science Fiction", "Classics"]}'
200 · applied
{
  "approved": true,
  "reason": "The page count and genres are plausible for this book.",
  "book": { … }
}

Repair an EPUB

POST /epub

Send an EPUB and get it back with its metadata repaired: title, author, description, genres, series and its number, and the cover when it was missing or small. The ISBN, publisher, language and publication date are filled in when the file has none, and left alone when it does. The book's text is not touched.

Send the file either as the raw request body, with options in the query string, or as a multipart form with the file in the file field and options as fields.

POST multipart
curl https://api.metadata.dev/epub \
  -F file=@book.epub \
  -F "instructions=the cover of this epub is too small and low resolution" \
  -o fixed.epub
POST raw body
curl "https://api.metadata.dev/epub?id=9780441013593" \
  --data-binary @book.epub -o fixed.epub
OptionNotes
fileThe EPUB, up to 30 MB. Multipart only; otherwise it is the body.
idOptional. The ISBN or book id to repair it as. Skips working out which book it is.
instructionsOptional. What is wrong, in plain words, up to 500 characters. See Instructions.

We work out which book the file is from the ISBN in its metadata, then its title and author. If those are a mess, such as a filename used as the title, we read through them to identify the book.

The response is the repaired file (application/epub+zip) with two headers:

404 means we couldn't tell which book it is. The body carries what we read from the file under extracted; send it again with id. When the title fits several books and nothing else in the file settles it, the body also lists them under candidates, each with an id to send back.

Inspect an EPUB

POST /epub/inspect

The same upload as repair, but it changes nothing and returns the diagnosis as JSON. instructions is ignored here.

200
{
  "book": { … },
  "extracted": { "isbn": null, "title": "dune_final (retail)", "author": "Herbert, Frank" },
  "issues": [
    { "field": "title", "problem": "differs", "was": "dune_final (retail)", "now": "Dune" },
    { "field": "description", "problem": "missing", "was": null, "now": "Set on the desert planet…" },
    { "field": "cover", "problem": "low_resolution", "was": "200×300", "now": "1200×1800" }
  ],
  "notes": ["Identified as \"Dune\" from the file's metadata and name."]
}

cover, when present, is the image the repaired file will carry (url, width, height); it is null when the file keeps its own cover.

problem is missing, differs or low_resolution (a cover under 500 pixels wide). now is what the repair will write, or null when we have nothing to fix it with.

Instructions

The instructions option on repair takes plain English, and can do two kinds of thing.

Find a different cover

Say the cover is wrong, missing, blurry, too small or low resolution. We search the catalogs for other covers of that book, take the largest, and check that it actually shows this book. The cover that passes becomes the catalog's cover for everyone and is put into your file.

examples
the cover for this epub is wrong
the cover of this epub is too small and low resolution
this has no cover, find one

State a correct value

Give the right value outright and it is written into your file. From the metadata.dev page, or with an API key, it is also treated as a correction: checked, and applied for everyone if approved.

examples
the author is Ursula K. Le Guin
it's book 2 of The Broken Earth and has 410 pages

A complaint without the right value ("the author is wrong") changes nothing, because we won't guess. What happened to each request comes back in notes.

Add books

POST /books

Adds books to the catalog in bulk. Needs an API key.

POST
curl https://api.metadata.dev/books \
  -H "Authorization: Bearer $METADATA_KEY" \
  -d '{"books": [
    {"isbn": "9780765326355", "title": "The Way of Kings", "author": "Brandon Sanderson"},
    {"title": "A Psalm for the Wild-Built", "author": "Becky Chambers"},
    {"isbn": "9781250236210"}
  ]}'

Send up to 500 entries per request. Each needs an isbn, a title (ideally with author), or both, and may carry any other book field you know. What you send only fills blanks; it never replaces what the catalog already has.

The call returns straight away. Covers, page counts, descriptions and genres are filled in afterwards, usually within ten minutes.

200
{
  "added": 1, "queued": 1, "known": 1, "rejected": 0,
  "results": [
    { "id": "9780765326355", "status": "added" },
    { "id": "t-d492b7c8341f", "status": "known" },
    { "id": "9781250236210", "status": "queued" }
  ]
}
StatusMeaning
addedNew to the catalog. Look it up by the returned id.
knownAlready in the catalog. Any fields you sent filled its blanks.
queuedAn ISBN sent on its own. It appears once the outside catalogs identify it, and is dropped if none can.
errorThe entry was rejected; error says why. The rest of the batch still goes through.

Results come back in the order you sent them. Sending the same book twice is harmless.

Errors

Errors are JSON: { "error": "…" }.

StatusMeaning
400The request is malformed: a bad ISBN, an unknown field, a file that isn't an EPUB.
401A correction or an add without a valid API key.
404No such book, or an EPUB we couldn't identify.
413The EPUB is over 30 MB.
422A correction was reviewed and rejected.
429You hit the rate limit. Wait a minute.
503An outside catalog or the review step is busy. Nothing was recorded; retry after the Retry-After seconds.

Limits

Per IP address: 120 reads a minute, and 20 writes a minute (corrections and EPUB uploads together). EPUBs are processed in memory and returned; the file is not kept.