Book Collection API (1.0.0)

Download OpenAPI specification:

API for managing a book collection database with authors, publishers, series, genres, and labels

Books

Operations related to books

Authors

Operations related to authors

Publishers

Operations related to publishers

Series

Operations related to book series

Genres

Operations related to genres

Labels

Operations related to labels

Get books with filtering, sorting, and pagination

Retrieve books from the collection with optional filtering by author, title, publisher, or series, plus sorting and pagination support

query Parameters
author
string

Filter books by author name (partial match)

title
string

Filter books by title (partial match)

publisher
string

Filter books by publisher name (partial match)

serie
string

Filter books by series name (partial match)

sortBy
string
Enum: "title" "author" "publisher" "release" "serie"

Field to sort by

orderDesc
string
Value: "desc"

Sort order (desc for descending, otherwise ascending)

itemsPerPage
integer >= 1

Number of items per page for pagination

page
integer >= 1

Page number for pagination (starts from 1)

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "count": 0,
  • "books": [
    ]
}

Add a new book to the collection

Add a new book with all its associated metadata

Request Body schema: application/json
required
title
required
string

Book title

authors
Array of strings

List of author names

publisher
string

Publisher name

release_date
string <date>

Book release date

series
string

Series name

genres
Array of strings

List of genre names

labels
Array of strings

List of label names

Responses

Request samples

Content type
application/json
{
  • "title": "The Great Gatsby",
  • "authors": [
    ],
  • "publisher": "Scribner",
  • "release_date": "1925-04-10",
  • "series": "Classic Literature",
  • "genres": [
    ],
  • "labels": [
    ]
}

Response samples

Content type
application/json
{
  • "error": "Database connection failed"
}

Get authors

Retrieve authors with optional search query

query Parameters
query
string

Search query to filter authors

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get publishers

Retrieve publishers with optional search query

query Parameters
query
string

Search query to filter publishers

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add a new publisher

Add a new publisher to the database

Request Body schema: application/json
required
name
required
string

Publisher name

Responses

Request samples

Content type
application/json
{
  • "name": "Penguin Random House"
}

Response samples

Content type
application/json
{
  • "message": "Publisher added successfully"
}

Get series

Retrieve series with optional search query

query Parameters
query
string

Search query to filter series

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add a new series

Add a new series to the database

Request Body schema: application/json
required
name
required
string

Series name

Responses

Request samples

Content type
application/json
{
  • "name": "The Lord of the Rings"
}

Response samples

Content type
application/json
{
  • "message": "Series added successfully"
}

Get genres

Retrieve genres with optional search query

query Parameters
query
string

Search query to filter genres

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get labels

Retrieve labels with optional search query

query Parameters
query
string

Search query to filter labels

Responses

Response samples

Content type
application/json
[
  • {
    }
]