BasicBooks

Books

These endpoints allow you to retrieve all books, a single book by its id, or a random book. The response will be an array of JSON objects if you request all books, or a single JSON object if you request a single book or a random book.

The Book model

PropTypeDefault
id
integer
-
title
string
-
author
string
-
genre
string
-
description
string
-
isbn
string
-
image
object
-
published
string
-
publisher
string
-

All books

GET/books

Retrieve all books.

Response
{
  "data": [
    {
      "id": 1,
      "title": "Big Trouble in Town",
      "author": "Jermain Hudson",
      "genre": "Voluptatibus",
      "description": "Alice, they all spoke at once, with a shiver. 'I beg pardon, your Majesty,' said the Caterpillar. This was such a noise inside, no one to listen to me! I'LL soon make you dry enough!' They all sat.",
      "isbn": "9785699252138",
      "image": {
        "url": "http://placeimg.com/480/640/any",
        "alt": "Big Trouble in Town"
      },
      "published": "2012-01-08",
      "publisher": "Voluptates Nihil"
    },
    {
      "id": 2,
      "title": "The Next Day",
      "author": "Pattie Hagenes",
      "genre": "Dolor",
      "description": "Rabbit angrily. 'Here! Come and help me out of the tea--' 'The twinkling of the conversation. Alice replied, so eagerly that the cause of this pool? I am to see that queer little toss of her ever.",
      "isbn": "9798692336644",
      "image": {
        "url": "http://placeimg.com/480/640/any",
        "alt": "The Next Day"
      },
      "published": "1977-03-03",
      "publisher": "Blanditiis Labore"
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

Single book

GET/books/<id>

Retrieve a single book by its id.

Response
{
  "data": {
    "id": 1,
    "title": "Big Trouble in Town",
    "author": "Jermain Hudson",
    "genre": "Voluptatibus",
    "description": "Alice, they all spoke at once, with a shiver. 'I beg pardon, your Majesty,' said the Caterpillar. This was such a noise inside, no one to listen to me! I'LL soon make you dry enough!' They all sat.",
    "isbn": "9785699252138",
    "image": {
      "url": "http://placeimg.com/480/640/any",
      "alt": "Big Trouble in Town"
    },
    "published": "2012-01-08",
    "publisher": "Voluptates Nihil"
  },
  "meta": {}
}

Random book

GET/books/random

Retrieve a random book.

Response
{
  "data": {
    "id": 53,
    "title": "Minecraft: How To Survive",
    "author": "Reanna Schowalter",
    "genre": "Rem",
    "description": "Hatter said, turning to the door, and the other bit. Her chin was pressed hard against it, that attempt proved a failure. Alice heard it muttering to himself in an offended tone, 'so I should.",
    "isbn": "9794275021358",
    "image": {
      "url": "http://placeimg.com/480/640/any",
      "alt": "Minecraft: How To Survive"
    },
    "published": "2004-12-27",
    "publisher": "Et Sit"
  },
  "meta": {}
}