Book recommendation API

Big Book API recommends books in two ways: /{id}/similar returns up to 100 books similar to one you pick, and /search-books turns a description of what a reader wants, plus genre and rating filters, into matching books. Both draw on over 4 million English books, so every recommendation is a real book with an ID, a title and a cover URL when one is known.

Similar books for a given book

Pass a book ID, from a search by title, topic or ISBN, to /{id}/similar. The documentation example uses 16384516, Harry Potter and the Goblet of Fire:

curl -H "x-api-key: $BIG_BOOK_API_KEY" \
  "https://api.bigbookapi.com/16384516/similar"

The response, abridged:

{
    "similar_books": [
        {
            "id": 14296534,
            "title": "Harry Potter and the Order of the Phoenix",
            "image": "https://covers.openlibrary.org/b/id/11416565-M.jpg"
        },
        {
            "id": 16499448,
            "title": "Harry Potter and the Half-Blood Prince",
            "image": "https://covers.openlibrary.org/b/id/8235163-M.jpg"
        },
        …
        {
            "id": 20464852,
            "title": "Towers of midnight",
            "subtitle": "Wheel of Time Book 13",
            "image": "https://covers.openlibrary.org/b/id/6657713-M.jpg"
        },
        …
    ]
}

Here the later Harry Potter books come first, followed by other titles, including Robert Jordan's Wheel of Time. number (1 to 100) sets how many you get. Each entry has an id, a title, a subtitle when there is one, and an image with the cover URL when one is known. For authors and ratings, fetch /{id}, at one request per book.

A "readers also liked" shelf

A shelf under a book page is one call per page view. Make it from your server, since the terms require you to keep the API key confidential:

// Express-style route (Node 18+); the browser calls /books/16384516/also-liked and gets a JSON array
app.get('/books/:id/also-liked', async (req, res) => {
  if (!/^\d{1,12}$/.test(req.params.id)) return res.status(400).json([]);
  try {
    const r = await fetch('https://api.bigbookapi.com/' + req.params.id + '/similar?number=8', {
      headers: { 'x-api-key': process.env.BIG_BOOK_API_KEY },
      signal: AbortSignal.timeout(8000),
    });
    if (!r.ok) return res.json([]);   // 402, 429 or another error: send an empty shelf
    const data = await r.json();
    const books = Array.isArray(data.similar_books) ? data.similar_books : [];
    res.json(books.map((b) => ({ id: b.id, title: b.title, image: b.image })));
  } catch (err) {
    res.json([]);                     // network error, timeout or invalid JSON: also an empty shelf
  }
});

A 402 means the free daily quota is used up, a 429 that you went over the rate limit. For a complete front end with its own small proxy, see a similar-books widget in JavaScript (it uses a different route and response shape than this snippet), and the book cover API.

Recommendations by interest

When a reader describes what they want instead of naming a book, search for it. The query is parsed with Big Book API's own ontology, so related terms match without you listing them (semantic book search):

curl -G "https://api.bigbookapi.com/search-books" \
  -H "x-api-key: $BIG_BOOK_API_KEY" \
  --data-urlencode "query=murder mystery in a small english village" \
  -d "genres=mystery" \
  -d "min-rating=0.75" \
  -d "number=10"

genres takes any of the 92 genres, and ratings run from 0 to 1. To follow an author, pass authors with IDs from /search-authors. /{id}/similar takes no filters, so use the search when genre, rating or publish year matter. For a reader who liked several books, call /{id}/similar for each and rank the books that appear in more than one list.

Recommending real books from a chatbot or LLM app

A language model answering from memory can name books that do not exist or attach the wrong author. Give it the search as a tool instead, and instruct it to recommend only books the tool returned. A tool definition looks like this; depending on the LLM API, the schema goes in a field called parameters or input_schema:

{
  "name": "search_books",
  "description": "Search a catalogue of English books. Call this before recommending any book and recommend only books it returns.",
  "parameters": {
    "type": "object",
    "properties": {
      "query": { "type": "string", "description": "What the reader wants, in plain words" },
      "genres": { "type": "string", "description": "Comma-separated genres, e.g. science_fiction" },
      "min_rating": { "type": "number", "description": "Minimum rating from 0 to 1" },
      "number": { "type": "integer", "minimum": 1, "maximum": 10 }
    },
    "required": ["query"]
  }
}

Your code turns each tool call into a /search-books request (min_rating becomes min-rating) and returns IDs, titles and author names. A second tool wrapping /{id}/similar lets the assistant answer "more like this one".

Parameters

ParameterEndpointUse
number/{id}/similarHow many similar books to return, 1 to 100.
query/search-booksWhat the reader is looking for, in plain words.
genres/search-booksComma-separated genres; books from any of them are returned.
min-rating, max-rating/search-booksRating range between 0 and 1.
authors/search-booksComma-separated author IDs or names.
number/search-books1 to 100 results per request.

Limits and pricing

Every call counts as one request, however many books it returns. The terms allow storing Big Book IDs but not titles, covers or other data (caching for up to an hour needs written permission). A precomputed list of similar-book IDs therefore still needs each book's data fetched when it is shown, so one /{id}/similar call per page view is usually the cheaper shelf. The free plan covers 50 requests a day at 1 request per second, for non-commercial use with a backlink. Paid plans cost $6, $29 and $99 a month for 500, 5,000 and 50,000 requests a day, then $0.04, $0.02 or $0.005 per extra request (pricing, quotas).

When another API is a better fit

Google Books has no documented similar-books endpoint for arbitrary titles, and Goodreads stopped issuing new API keys in December 2020; see Google Books API alternatives and Goodreads API alternatives.

Frequently asked questions

Is there an API for book recommendations?

Yes. Big Book API's /{id}/similar endpoint returns up to 100 similar books for a book in its catalogue, and /search-books finds books that match a description, genre and rating range.

How do I recommend books in a chatbot without made-up titles?

Give the model /search-books as a tool, tell it to recommend only books the tool returns, and pass back IDs, titles and authors. The titles it recommends should then come from the catalogue; to be sure, check the IDs it names against the tool results in your code.

Can I recommend books based on what a user has read?

Call /{id}/similar for each book they liked and rank the books that appear in several lists. The API holds no user profiles, so the reading history has to come from your app.

Is the book recommendation API free?

The free plan gives 50 requests a day for non-commercial projects with a backlink. A shelf of up to 100 similar books is one request. Paid plans start at $6 a month for 500 requests a day.

Try similar-book recommendations on the free plan: 50 requests a day.

Get a free API key Read the docs