/api/v1/books/author

GET /api/v1/books/author/<string:author>

Description

This endpoint allows users to retrieve a list of books based on a specified author.

Parameters

All parameters are optional, if there is no specific value provided, default will be used.

  • page: Page number for pagination. Default is 1 (int).
  • limit: Number of books per page. Default is 10 (int).
  • sort_type: Type of sorting based on a book characteristic. Default is id (int).
  • sort_order: Sorting order of the results. 1 for ascending and -1 for descending. Default is 1 (str).

Request

Response

The response will show books that match the specified author, with pagination details. For example, if the author is "Yehuda Katz" there will be 2 matching that have the author specified (and can also have others).

{
    "books": [
        {
            "_id": "6123d2c4a3490d001f2cf0db",
            "title": "jQuery in Action",
            "authors": [
                "Bear Bibeault",
                "Yehuda Katz"
            ],
            // More book information
        },
        {
            "_id": "6123d2c4a3490d001f2cf0dc",
            "title": "jQuery in Action, Second Edition",
            "authors": [
                "Bear Bibeault",
                "Yehuda Katz"
            ],
            // More book information
        }
    ],
    "pageCurrent": 1,
    "pagePrevious": null,
    "pageNext": null,
    "pageLast": 1,
    "items": 2
}