Google Books Data as JSON: Search, ISBN and Volumes
If you want a Google Books API that returns clean JSON with one key, Perceptlayer has three endpoints for it: search finds books by author, title, subject, publisher or ISBN, isbn looks up one book by ISBN, and volume returns one book by its volume id. Each costs 1 credit per successful call. This guide shows the requests, the parameters, a recorded search for Dune, and how to enrich a catalogue or reading list by ISBN with the cost per book.
Which Google Books endpoints are there?
There are three, all GET, all on the standard tier, all 1 credit per successful call. Use search when you have an author, title or subject; use isbn when you already have an ISBN; use volume when you have a volume id from an earlier result. Failed calls cost nothing and return X-Credits-Used: 0.
| Endpoint | What it's for | Credits | Required | Optional |
|---|---|---|---|---|
GET /v1/google-books/search |
Books matching your filters | 1 | none | q, author, title, publisher, subject, isbn, free_only, page, limit, language, print type, filter and sort parameters, country |
GET /v1/google-books/isbn |
One book by ISBN | 1 | isbn |
none |
GET /v1/google-books/volume |
One book by volume id | 1 | id |
none |
Each has its own page with the playground: search, isbn and volume, and the Google Books API page lists them together. This guide covers what Perceptlayer returns. Google also publishes its own Books API; if you're choosing between the two, compare its keys, quotas and terms with what's here yourself.
How do you search for a book?
Send a GET request to https://api.perceptlayer.com/v1/google-books/search with your filters and your key in the X-API-Key header. The recorded request below asks for books by Frank Herbert with "dune" in the title, two results a page, and costs 1 credit.
curl "https://api.perceptlayer.com/v1/google-books/search?author=frank+herbert&title=dune&limit=2" \
-H "X-API-Key: $API_KEY"
Keys start with sk_live_. Where you can't set a header, the key can go in the api_key query parameter; the authentication docs cover both. Every successful response carries X-Credits-Used and X-Credits-Remaining, so a batch job can log what it spent.
Which search parameters can you use?
All search parameters are optional, and the API documents their types and length limits but not their defaults or page sizes. The table lists them. Several names look related, such as language, lang, lr and langRestrict, or sort and orderby; the documentation gives only their types, so test the one you plan to use in the playground and keep it fixed in your job.
| Parameter | Type | Documented constraint |
|---|---|---|
q |
string | Up to 300 characters |
author |
string | Up to 150 characters |
title |
string | Up to 200 characters |
publisher |
string | Up to 150 characters |
subject |
string | Up to 150 characters |
isbn |
string | No further constraint documented |
free_only |
boolean | No further constraint documented |
page, limit |
integer | No further constraint documented |
language, lang, lr, langRestrict |
string | No further constraint documented |
print_type, printType, ebooks, filter |
string | No further constraint documented |
sort, orderby, country |
string | No further constraint documented |
What does the search response contain?
The response holds the query as it was run, the total match count, paging flags and an items array of books. In the recording, author and title came back combined in query as inauthor:"frank herbert" intitle:dune, with 101 matches and has_next: true. This is the recorded response, trimmed:
{
"success": true,
"data": {
"query": "inauthor:\"frank herbert\" intitle:dune",
"total_results": 101,
"page": 1,
"limit": 2,
"has_next": true,
"items": [
{
"id": "DxmKzQEACAAJ",
"title": "Dune",
"authors": ["Frank Herbert"],
"publisher": "Hodder Paperbacks",
"published_date": "2021-01-27",
"description": "Before The Matrix, before Star Wars, before Ender's Game and Neuromancer, there was Dune, …",
"print_type": "book",
"isbn_10": "1529347858",
"isbn_13": "9781529347852",
"language": "en",
"categories": ["Fiction"],
"viewability": "none",
…
"cover_url": "https://books.google.com/books/content?id=DxmKzQEACAAJ&printsec=frontcover&img=1&zoom=1",
"info_url": "https://books.google.com/books?id=DxmKzQEACAAJ",
…
},
{
"id": "i9-wAAAAIAAJ",
"title": "Chapterhouse, Dune",
"authors": ["Frank Herbert"],
"publisher": "Putnam Publishing Group",
"published_date": "1985",
…
"page_count": 510,
"language": "en",
"categories": ["Fiction"],
"average_rating": 4.2,
…
}
]
},
"meta": {
"endpoint_family": "search",
"credits_charged": 1,
…
}
}
| Field | Notes from the recording |
|---|---|
id |
The volume id, such as DxmKzQEACAAJ |
title, authors, publisher |
Present on both items |
published_date |
A full date (2021-01-27) on one item, a year (1985) on the other |
isbn_10, isbn_13 |
Present on the first item only |
page_count, average_rating |
Present on the second item only |
categories, language, print_type |
Present on both items |
thumbnail_url, cover_url, info_url, preview_url |
Links to the cover and the book's page |
viewability, embeddable, open_access |
Present on both items |
Three details matter when you store this. Fields are optional per book, so read every field with a fallback. published_date isn't always a full date, so store it as text, or parse the year separately. And the first item's description ends with … in the recording, so check whether volume returns longer text before you rely on it for display.
How do you look up a book by ISBN or volume id?
When you already know the book, skip search and call isbn with the ISBN or volume with the volume id. Each takes one required parameter and costs 1 credit. The search result's id and the volume endpoint's id parameter share a name; try the recorded DxmKzQEACAAJ on the volume page in the playground to see its fields before you build on them.
curl "https://api.perceptlayer.com/v1/google-books/isbn?isbn=9781529347852" \
-H "X-API-Key: $API_KEY"
curl "https://api.perceptlayer.com/v1/google-books/volume?id=DxmKzQEACAAJ" \
-H "X-API-Key: $API_KEY"
We don't have recorded responses for isbn or volume, so this guide doesn't show their fields. isbn accepts a string of up to 300 characters, and volume takes the id as a string. The ISBN in the request above is the isbn_13 from the recorded search.
How do you enrich a reading list by ISBN?
To enrich a list of ISBNs, send one call per ISBN and write the fields you get back next to each one. The script below uses the search endpoint with its isbn parameter, because its response fields are recorded, and writes a CSV row per ISBN. Swap in the isbn endpoint once you've checked its response in the playground; the cost is the same 1 credit per book.
import csv
import os
import time
import requests
API_KEY = os.environ["API_KEY"]
URL = "https://api.perceptlayer.com/v1/google-books/search"
ISBNS = ["9781529347852", "9780441013593"]
FIELDS = ["id", "title", "publisher", "published_date", "isbn_13",
"page_count", "language", "average_rating", "cover_url"]
def fetch(isbn, attempts=3):
for _ in range(attempts):
r = requests.get(URL, params={"isbn": isbn, "limit": 1},
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"].get("items", [])
raise RuntimeError(f"gave up on {isbn}")
with open("books.csv", "w", newline="") as f:
out = csv.writer(f)
out.writerow(["isbn", "authors", "categories"] + FIELDS)
for isbn in ISBNS:
items = fetch(isbn)
if not items:
out.writerow([isbn, "", ""] + ["not found"] + [""] * (len(FIELDS) - 1))
else:
book = items[0]
out.writerow([isbn,
"; ".join(book.get("authors", [])),
"; ".join(book.get("categories", []))]
+ [book.get(k, "") for k in FIELDS])
time.sleep(1)
Every field is read with a fallback, since the recording shows isbn_13, page_count and average_rating missing on some items. The one-second pause keeps the script within the free tier's 1 request a second; a paying account runs at least 5 a second. An ISBN that returns no items is written as "not found" rather than guessed.
What should the job do with errors?
Every error comes back with an HTTP status and a JSON body with code, message and request_id. The script waits on rate_limited (429) and temporarily_unavailable (503) using Retry-After. Treat invalid_parameters (422) as a malformed ISBN to clean up, and source_error (502) as a book to retry later. Requests have no idempotency key, so a client timeout may hide a call that succeeded and was billed. The errors docs list every code.
What does enriching books cost?
Enriching books costs 1 credit per book per lookup, whichever endpoint you use. A one-time enrichment is one call per ISBN; a refresh, for example to pick up a changed average_rating, repeats it. Only successful calls are billed, so a failed lookup followed by a successful retry costs 1 credit.
| Plan | Arithmetic | Credits |
|---|---|---|
| A 100-book reading list, once | 100 × 1 credit | 100 |
| A 2,000-book catalogue, once | 2,000 × 1 credit | 2,000 |
| 500 books refreshed weekly for a month | 500 × 4 × 1 credit | 2,000 a month |
| A 40,000-book catalogue, once | 40,000 × 1 credit | 40,000 |
The 100 free credits on signup cover the reading list. The 2,000-book catalogue and the weekly refresh fit the Starter pack's 10,000 credits, and the 40,000-book catalogue fits the Build pack's 50,000. Purchased credits last 12 months, with no subscription. See pricing for what credits cost and the credits docs for how debits work.
To try it, run search with an author and title you know in the playground on the Google Books API page, then call isbn with one of your own ISBNs and compare the fields. When they fit, get a free API key and run the script on your list. The reviews APIs page lists related sources.
APIs in this post
Frequently asked questions
How much does a Google Books lookup cost on Perceptlayer?
Each successful call to search, isbn or volume costs 1 credit, and a failed call costs nothing and returns X-Credits-Used: 0. Enriching a 2,000-book catalogue once is 2,000 credits; the 100 free credits on signup cover 100 books. The pricing page lists what credit packs cost.
How does this compare with Google's own Books API?
This guide makes no claims about Google's own Books API, its keys, quotas or pricing. If you're choosing, read Google's documentation and terms, then compare them with the three endpoints here: one X-API-Key header, 1 credit per successful call, and the same key for the rest of the catalogue of 707 websites.
Why are some fields missing from a book?
Fields vary from book to book. In the recorded search, the first item has isbn_10 and isbn_13 but no page_count, and the second has page_count and average_rating but no ISBN fields. published_date is a full date on one and a year on the other. Read every field with a fallback.
How do I page through search results?
The search endpoint takes page and limit, and the response returns page, limit, total_results and has_next. The recorded call with limit=2 returned total_results: 101 and has_next: true. Each page is another call at 1 credit, so a narrower filter is cheaper than paging through broad results.
Can an AI agent look up books?
Yes. Through the MCP server at https://perceptlayer.com/mcp, an agent finds the Google Books endpoints with search_endpoints, reads their parameters with get_endpoint (both free) and runs a lookup with call_endpoint, which spends credits only on success. The AI agents docs show how to add the server.