Get a specific book
curl --request GET \
--url https://bookhub-mock.onrender.com/books/{bookId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://bookhub-mock.onrender.com/books/{bookId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://bookhub-mock.onrender.com/books/{bookId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bookhub-mock.onrender.com/books/{bookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://bookhub-mock.onrender.com/books/{bookId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://bookhub-mock.onrender.com/books/{bookId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://bookhub-mock.onrender.com/books/{bookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"bookId": "123e4567-e89b-41d4-a716-426614174000",
"title": "The Great Adventure",
"author": "Jane Smith",
"description": "An epic tale of courage and discovery",
"language": "en-US",
"publisher": "Adventure Books Inc",
"publishedDate": "2024-03-15",
"isbn": "978-0-1234-5678-9",
"price": 24.99,
"status": "ACTIVE",
"coverImages": [
"https://covers.bookhub.com/great-adventure-front.jpg"
],
"genres": [
"Fiction",
"Adventure"
],
"bookFormat": "Hardcover",
"createdDate": "2024-12-25T10:30:00Z",
"updatedDate": "2024-12-26T15:45:00Z",
"hitCount": 1247
}
}{
"status": "error",
"message": "Authentication failed",
"errors": [
{
"field": "Authorization",
"error": "INVALID_TOKEN",
"description": "The JWT is missing, malformed, or expired. Obtain a new token and retry."
}
]
}{
"status": "error",
"message": "Book not found",
"errors": [
{
"field": "bookId",
"error": "NOT_FOUND",
"description": "No book exists with bookId 123e4567-e89b-41d4-a716-426614174000"
}
]
}{
"status": "error",
"message": "Rate limit exceeded. Retry after the window resets (see X-RateLimit-Reset header)."
}Endpoints
Get a specific book
Retrieves detailed information about a specific book.
v2 changes
- (new): Returns
hitCountfield. - The
hitCountincrements each time a buyer retrieves the book viaGET /v2/books/{bookId}. Requests authenticated with publisher credentials do not increment the count.
GET
/
books
/
{bookId}
Get a specific book
curl --request GET \
--url https://bookhub-mock.onrender.com/books/{bookId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://bookhub-mock.onrender.com/books/{bookId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://bookhub-mock.onrender.com/books/{bookId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bookhub-mock.onrender.com/books/{bookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://bookhub-mock.onrender.com/books/{bookId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://bookhub-mock.onrender.com/books/{bookId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://bookhub-mock.onrender.com/books/{bookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"bookId": "123e4567-e89b-41d4-a716-426614174000",
"title": "The Great Adventure",
"author": "Jane Smith",
"description": "An epic tale of courage and discovery",
"language": "en-US",
"publisher": "Adventure Books Inc",
"publishedDate": "2024-03-15",
"isbn": "978-0-1234-5678-9",
"price": 24.99,
"status": "ACTIVE",
"coverImages": [
"https://covers.bookhub.com/great-adventure-front.jpg"
],
"genres": [
"Fiction",
"Adventure"
],
"bookFormat": "Hardcover",
"createdDate": "2024-12-25T10:30:00Z",
"updatedDate": "2024-12-26T15:45:00Z",
"hitCount": 1247
}
}{
"status": "error",
"message": "Authentication failed",
"errors": [
{
"field": "Authorization",
"error": "INVALID_TOKEN",
"description": "The JWT is missing, malformed, or expired. Obtain a new token and retry."
}
]
}{
"status": "error",
"message": "Book not found",
"errors": [
{
"field": "bookId",
"error": "NOT_FOUND",
"description": "No book exists with bookId 123e4567-e89b-41d4-a716-426614174000"
}
]
}{
"status": "error",
"message": "Rate limit exceeded. Retry after the window resets (see X-RateLimit-Reset header)."
}Last modified on June 8, 2026