Books API

Description

Search, or get recommendations from, our database of 30M+ books. We provide you with search capability based on isbn, isbn13 or title.

Bulk Data Download:

If you need a complete data dump of our entire Books database, reach out to us. We offer that as a separate service option. Trying to scrape our APIs is not recommended as you'll end up consuming your monthly request allowance.

Endpoint

> GET https://api.jsonrepo.com/v1/knowledge/entertainment/books

Headers

Field Description
api_key Required Your API Key

Parameters

Field Type Description
isbn String Optional ISBN 10 code
isbn13 String Optional ISBN 13 code
title String Optional Book title (case insensitive)
limit Integer Optional Number of results
Default: 10
Range: 1 <= limit <= 20

Random Recommendations:

If none of the optional search fields isbn, isbn13 or title is provided, the endpoint will return a set of random book of size limit.

Parameter Interaction:

If multiple optional fields are provided, an AND operation will be executed. In most cases this is not helpful. Searching for isbn & title is the same as searching for isbn without the title as the former is always unique. For best possible matches, use only one of the optional search fields.

Search Strictness:

Our Books database is very large. Aggregated from a variety of public domain sources and contains 30M+ records. For search to be effective and return appropriate results rather than unexpected hits that just might happen to match your search term partially, we've decided to implement a strict search policy for the title parameter. That means when providing a title parameter, only the records that start with your input will be searched for.

Title Encoding:

The title parameter is UTF-8 ready. Any non-english characters can be sent as is without any pre-processing or conversions on your end. Example: "Sagen Aus Österreich" will be accepted as a title by this endpoint as long as the parameter was provided with the correct URL-encoding.

Response

A successful request will result in a populated payload field with the expected output.

A failed request will result in an error output as detailed in Error Rules. If the endpoint validation fails due to missing, badly formatted or invalid parameters, the endpoint will return HTTP code 400 along with a message detailing the error.

See the examples section for more information.

Request 1: Random Books

  • Curl
// Get 10 random books

curl \
https://api.jsonrepo.com/v1/knowledge/entertainment/books \
-H "api_key: {YOUR_API_KEY_HERE}"

Success Response

{
    "http_code": 200,
    "http_message": "Ok",
    "message": "Successful execution",
    "payload": {
        "books": [
            {
                "id": 1646380,
                "isbn": "0312337817",
                "isbn13": "9780312337810",
                "title": "My So-Called Punk",
                "authors": [
                    "Diehl, Matt"
                ],
                "pages": 272,
                "publisher": "St. Martin's Griffin",
                "published": "2007",
                "language": "en",
                "subjects": [
                    "Music",
                    "Punk"
                ],
                "db_entry_last_updated_at": "2024-07-24 03:19:55"
            },
            ...
            {
                "id": 17119545,
                "isbn": "151719069X",
                "isbn13": "9781517190699",
                "title": "Plato and Platonism",
                "authors": [
                    "Pater, Walter"
                ],
                "pages": 112,
                "publisher": "CreateSpace Independent Publishing Platform",
                "published": "2015",
                "language": "en",
                "subjects": [],
                "db_entry_last_updated_at": "2024-07-24 03:48:46"
            },
        ]
    }
}

Request 2: Search

  • Curl
// Search for a book by `isbn`

curl -G \
https://api.jsonrepo.com/v1/knowledge/entertainment/books \
-H "api_key: {YOUR_API_KEY_HERE}" \
--data-urlencode "isbn=0099503794"

Success Response

{
    "http_code": 200,
    "http_message": "Ok",
    "message": "Successful execution",
    "payload": {
        "books": [
            {
                "id": 472076,
                "isbn": "0099503794",
                "isbn13": "9780099503798",
                "title": "Crime And Punishment",
                "authors": [
                    "Fyodor Dostoyevsky"
                ],
                "pages": 564,
                "publisher": "",
                "published": "2007",
                "language": "en",
                "subjects": [],
                "db_entry_last_updated_at": "2024-07-24 03:17:43"
            }
        ]
    }
}

Error Response Examples

// Request with invalid `limit` parameter

{
    "http_code": 400,
    "http_message": "Bad Request",
    "message": "Malformed request: `limit` parameter must be between 1 (min) and 20 (max). Default is 10.",
    "payload": []
}