Blog / API guides

Goodreads API: Books and Ratings as JSON

To get Goodreads book data as JSON, search with GET /v1/goodreads/search?query=…, take a result's id, and pass it to GET /v1/goodreads/book for the full record: average_rating, ratings_count, a rating_distribution from five stars to one, genres, series, publisher and num_pages. Two more endpoints return an author's works and a book's reviews. Each of the four costs 1 credit per successful call. This guide shows the requests, the parameters, recorded responses, a Python ratings tracker and what it costs.

What does the Goodreads API on Perceptlayer cover?

The Goodreads API on Perceptlayer has four endpoints: a keyword search, a book record by ID, an author record with their works, and a book's reviews. All four are GET requests that return JSON and cost 1 credit per successful call. A typical job starts with search to find book IDs, then calls book for each ID on a schedule to record its ratings.

Method Path Returns Credits Required Optional
GET /v1/goodreads/search Books matching a query 1 query page
GET /v1/goodreads/book One book 1 id none
GET /v1/goodreads/author One author and their works 1 id none
GET /v1/goodreads/reviews A book's reviews 1 id limit, after

The data is collected from publicly available sources and returned as found at the time of the call. These are Perceptlayer endpoints, not Goodreads' own developer offering, and this guide makes no claims about what Goodreads offers itself; compare it yourself and read Goodreads' terms before you use the data. The Goodreads API page has a playground for all four endpoints.

Which parameters do the Goodreads endpoints take?

The four endpoints take five parameters between them. The table lists each with its type and the constraints the API documents. Nothing else is documented, such as defaults or how many reviews limit allows, so try the values you plan to use in the playground before a job depends on them.

Endpoint Parameter Type Required Documented constraint
search query string yes Up to 255 characters
search page integer no None documented
book id integer yes None documented
author id integer yes None documented
reviews id integer yes None documented
reviews limit integer no None documented
reviews after string no Up to 255 characters

Every request sends your key in the X-API-Key header. Keys start with sk_live_, and where you can't set a header, the key can go in the api_key query parameter. The authentication docs cover both.

How do you search Goodreads books?

Send GET /v1/goodreads/search with your keywords in query. This is the request behind the recorded response:

curl "https://api.perceptlayer.com/v1/goodreads/search?query=the+lord+of+the+rings&page=1" \
  -H "X-API-Key: $API_KEY"

The response has page, per_page, total, has_more and a results array. Each result carries the book id, title, url, cover_url, an author object, average_rating, ratings_count, published_year and a short description_plain. Trimmed, with the author's name left out:

{
  "success": true,
  "data": {
    "page": 1,
    "per_page": 20,
    "total": 2474,
    "has_more": true,
    "results": [
      {
        "position": 1,
        "id": 61215351,
        "title": "The Fellowship of the Ring",
        "url": "https://www.goodreads.com/book/show/61215351-the-fellowship-of-the-ring",
        …
        "author": {
          "id": 656983,
          …
        },
        "average_rating": 4.41,
        "ratings_count": 3255350,
        "published_year": 2022,
        …
        "series": [
          {
            "title": "Middle Earth",
            "url": "https://www.goodreads.com/series/66175-middle-earth",
            "position": 2
          }
        ]
      },
      {
        "position": 2,
        "id": 33,
        "title": "The Lord of the Rings",
        …
        "average_rating": 4.55,
        "ratings_count": 753541,
        "published_year": 2005,
        …
      }
    ]
  },
  "meta": {
    "endpoint_family": "search"
  }
}

Two details matter for a real job. The first result's published_year is 2022, while the author endpoint lists the same id with published_year 1954, so don't read the search value as a first publication year. And series appears on the first result but not the second, so read every field as optional. With has_more: true and a total of 2,474, the page parameter is how you move past the first 20 results.

What does a Goodreads book record contain?

GET /v1/goodreads/book takes the integer id from a search result and returns the full record. In the recordings, the first search result's id, 61215351, is the value passed here, and the response's id matches. Beyond the search fields, the book record adds format, page count, publisher, language, genres, an ASIN, the rating split and a count of text reviews.

curl "https://api.perceptlayer.com/v1/goodreads/book?id=61215351" \
  -H "X-API-Key: $API_KEY"
{
  "success": true,
  "data": {
    "id": 61215351,
    "title": "The Fellowship of the Ring",
    "title_complete": "The Fellowship of the Ring (The Lord of the Rings, #1)",
    …
    "author": {
      …
      "id": 656983,
      …
    },
    "format": "Kindle Edition",
    "num_pages": 432,
    "publisher": "William Morrow",
    "published_at": "2022-06-01T07:00:00Z",
    "language": "English",
    "asin": "B0DT42KYKH",
    "genres": [
      "Fantasy",
      "Classics"
    ],
    …
    "average_rating": 4.41,
    "ratings_count": 3255350,
    "rating_distribution": {
      "five": 1979920,
      "four": 826552,
      "three": 310859,
      "two": 82296,
      "one": 55723
    },
    "text_reviews_count": 59645,
    "work_id": 3204327
  },
  "meta": {
    "endpoint_family": "book_detail"
  }
}
Field What a ratings job does with it
id The key you store and pass to book and reviews
title, title_complete Short title, and the title with its series label
average_rating, ratings_count The headline figures to track over time
rating_distribution Counts per star, from five to one
text_reviews_count How many ratings came with written text
genres, series Grouping and filtering
format, publisher, num_pages, language, asin Edition details
work_id A separate ID from id; the recordings don't show it used as a parameter

The five star counts in the recording add up to 3,255,350, the same as ratings_count, so you can compute shares yourself: 1,979,920 ÷ 3,255,350 is about 61% five-star ratings. Store the raw counts rather than the shares, so later calls can be compared directly.

How do you get an author's works?

GET /v1/goodreads/author takes an author id and returns the author's details and a works array. In the recordings, the author.id in the book and search responses, 656983, is the value passed to this endpoint. Each work carries its own id, title, average_rating, ratings_count, published_year, cover_url and editions_count.

curl "https://api.perceptlayer.com/v1/goodreads/author?id=656983" \
  -H "X-API-Key: $API_KEY"
{
  "success": true,
  "data": {
    "id": 656983,
    …
    "url": "https://www.goodreads.com/author/show/656983",
    …
    "works": [
      {
        "position": 1,
        "id": 5907,
        "title": "The Hobbit, or There and Back Again",
        …
        "average_rating": 4.3,
        "ratings_count": 4668096,
        "published_year": 1937,
        …
        "editions_count": 1451
      },
      {
        "position": 2,
        "id": 61215351,
        "title": "The Fellowship of the Ring (The Lord of the Rings, #1)",
        …
        "ratings_count": 3255344,
        "published_year": 1954,
        …
        "editions_count": 1083
      }
    ]
  },
  "meta": {
    "endpoint_family": "author_detail"
  }
}

One author call gives you a catalogue-level view of a backlist for 1 credit. Note that the same book, 61215351, shows ratings_count 3,255,344 here and 3,255,350 in the book call, and published_year 1954 here against 2022 in search. Counts move between calls, and the two endpoints report different years, so record which endpoint and which time each figure came from.

How do you read a book's reviews?

GET /v1/goodreads/reviews takes the book id, an optional limit and an optional after string. The recorded call used limit=3 for the same book. The response carries book_id, total_count, has_more, a next_cursor string and an items array; each item has a rating, text_plain, created_at, like_count and spoiler. Each item also has a reviewer object, cut from the excerpt below; a ratings job doesn't need it, so don't store it.

curl "https://api.perceptlayer.com/v1/goodreads/reviews?id=61215351&limit=3" \
  -H "X-API-Key: $API_KEY"
{
  "success": true,
  "data": {
    "book_id": 61215351,
    "total_count": 59471,
    "has_more": true,
    "next_cursor": "NjAxMDAsMTU4OTUzMjQxMjEzNg",
    "items": [
      {
        "position": 1,
        "rating": 3,
        "text_plain": "Authors who inspire a movement are usually misunderstood, especially by those they have inspired, …",
        "created_at": "2009-05-28T18:33:07Z",
        "like_count": 1056,
        "spoiler": false,
        …
      },
      …
    ]
  },
  "meta": {
    "endpoint_family": "reviews"
  }
}

The response's next_cursor and the endpoint's after parameter are both strings, but the recordings don't show a cursor passed back, so confirm in the playground that after takes next_cursor before you page through reviews. Also, total_count (59,471) differs from the book's text_reviews_count (59,645); treat them as two separate counts. For aggregate work, such as the spread of review ratings over time, keep rating, created_at and like_count and drop anything that identifies a reviewer.

How do you track Goodreads ratings in Python?

A ratings tracker calls book for a fixed list of IDs on a schedule and appends one row per book: the time, the ID, the title, average_rating, ratings_count, the five star counts and text_reviews_count. Over weeks this gives you a ratings history per book. The script reads only fields in the recorded book response and uses requests and csv.

import csv
import datetime
import os
import time

import requests

API_KEY = os.environ["API_KEY"]
URL = "https://api.perceptlayer.com/v1/goodreads/book"
BOOK_IDS = [61215351, 33]


def get_book(book_id, attempts=3):
    for _ in range(attempts):
        r = requests.get(URL, params={"id": book_id}, headers={"X-API-Key": API_KEY}, timeout=60)
        if r.status_code in (429, 503):
            time.sleep(int(r.headers.get("Retry-After", "5")))
            continue
        r.raise_for_status()
        return r.json()["data"]
    raise RuntimeError(f"gave up on {book_id}")


now = datetime.datetime.now(datetime.timezone.utc).isoformat()
with open("goodreads-ratings.csv", "a", newline="") as f:
    out = csv.writer(f)
    for book_id in BOOK_IDS:
        book = get_book(book_id)
        dist = book.get("rating_distribution") or {}
        out.writerow([
            now, book.get("id"), book.get("title"),
            book.get("average_rating"), book.get("ratings_count"),
            dist.get("five"), dist.get("four"), dist.get("three"),
            dist.get("two"), dist.get("one"),
            book.get("text_reviews_count"),
        ])
        time.sleep(1)

The one-second pause keeps a free account within its 1 request a second. To build the ID list, run a few searches and keep the id of each result you want; the second ID above, 33, is the second search result in the recording.

What should the job do with errors?

Every error returns an HTTP status and a JSON body with code, message and request_id, and costs nothing. Retry rate_limited (429) and temporarily_unavailable (503) after the Retry-After seconds, as the script does. Log not_found (404) and invalid_parameters (422) and fix the ID list rather than retrying. Requests have no idempotency key, so a client timeout may hide a call that succeeded and was billed; keep the timeout generous. The errors docs list every code.

What does Goodreads data cost?

Every successful call to any of the four endpoints costs 1 credit, and a failed call costs nothing and returns X-Credits-Used: 0. A search call returns a page of books for 1 credit, while a book call returns one book's full record. So search to find IDs once, then spend your recurring credits on book calls for the titles you track.

Plan Arithmetic Credits a month
50 books, weekly 50 × 4 weeks × 1 credit 200
300 books, daily 300 × 30 days × 1 credit 9,000
1,000 books, daily 1,000 × 30 days × 1 credit 30,000

The first two fit the Starter pack's 10,000 credits, and the third fits the Build pack's 50,000. The 100 free credits on signup cover 100 calls: enough for a few searches and a first ratings snapshot of about 90 books. Purchased credits last 12 months. See pricing for what credits cost and the credits docs for how calls are debited.

To try it, run query=the lord of the rings in the playground on the search endpoint page, then get a free API key and set your own book list. Similar guides to another book source are in Google Books data as JSON, and more are in API guides.

APIs in this post

Frequently asked questions

Is this Goodreads' official API?

No. These are Perceptlayer endpoints that return public Goodreads data, collected from publicly available sources and returned as found at the time of the call. They search books and read book, author and review records. This guide makes no claims about what Goodreads offers developers itself, so compare that yourself and read Goodreads' terms before you use the data commercially.

How do I find a book's Goodreads ID?

Call GET /v1/goodreads/search with the title or author in query. Each result carries an integer id; in the recordings, the first result's id, 61215351, is the value passed to the book and reviews endpoints. Search results also carry the author.id used by the author endpoint. Each search costs 1 credit.

How do I get a book's star rating breakdown?

Call GET /v1/goodreads/book with the book's id. The response's rating_distribution object has counts under five, four, three, two and one. In the recording those counts add up to the book's ratings_count, 3,255,350, so dividing each by ratings_count gives the share per star. One book call costs 1 credit.

Can I page through Goodreads reviews?

The reviews response carries has_more and a next_cursor string, and the endpoint takes an optional after string of up to 255 characters. The recordings don't show a cursor passed back, so confirm in the playground that after accepts next_cursor before relying on it. Each page costs 1 credit. Leave reviewer details out of what you store.

How fast can I call the Goodreads endpoints?

Limits are per account, shared by all its keys, and counted per minute. A free account gets 1 request a second, 60 a minute. Paying accounts run at least 5 requests a second, 300 a minute, depending on the pack. Every response carries RateLimit-Remaining, and the rate limits docs list the rate each pack includes.

  1. Google Books Data as JSON: Search, ISBN and Volumes

    Search Google Books by author and title, look up a book by ISBN or volume id, and get isbn_13, page_count and categories as JSON at 1 credit a call.

  2. Depop API: Resale Listings as JSON

    Search Depop listings as JSON with brand, condition, sizes and price.amount per item; the recorded jacket search had a total_count of 6,815,522. 1 credit.

  3. Similarweb API: Website Traffic Data as JSON

    Get Similarweb traffic estimates as JSON: visits, bounce_rate, traffic_sources, top_countries and top_keywords for a domain, at 1 credit a call.

Start with 100 free credits

No password to set. We email you a sign-in link, and your key works on every API.

No credit card. 100 free credits on signup.