library-rpc

List books with optional filtering and pagination.

RPCbooks.list

Returns books matching the given filters, ordered by id, together with the total number of matches (before pagination is applied) in the result's "total" field. All parameters are optional and combine with logical AND; omitting every parameter returns the full catalog, one page at a time.

Servers

•mock: https://mock.api.selfdochub.com/rpc

Parameters

NameInTypeRequiredDescription
authorIdparamsstringRestrict results to books written by this author.
statusparamsstringRestrict results to books in this availability status. A book's availability. "borrowed" means it is out on an open loan. Allowed values: available, borrowed
queryparamsstringCase-insensitive substring match against the book title.
offsetparamsintegerNumber of matching books to skip, for pagination. Must not be negative.
limitparamsintegerMaximum number of books to return. Omit or use 0 to return every remaining match after offset. Must not be negative.

Responses

result The page of books matching the filter.

application/json

FieldTypeRequiredDescription
booksarray of objectyes
authorIdstringyesThe id of the Author who wrote this book.
createdAtstring (date-time)yesWhen the book record was created.
idstringyesUnique identifier assigned by the server, prefixed with bk_.
isbnstringyesThe book's ISBN. Must be unique across the catalog.
publishedYearintegeryesThe year the book was first published. Must be between 1450 and next year.
statusstringyesA book's availability. "borrowed" means it is out on an open loan. Allowed values: available, borrowed
titlestringyesThe book's display title, 1-200 characters.
updatedAtstring (date-time)yesWhen the book record was last modified.
totalintegeryesTotal number of matches before offset/limit was applied.

Errors

CodeMessageDescription
-32602Invalid params

Request example

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "books.list",
  "params": {
    "authorId": "authorId_352",
    "limit": 71,
    "offset": 826,
    "query": "query_203",
    "status": "available"
  }
}

Response example

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "books": [
      {
        "authorId": "authorId_882",
        "createdAt": "createdAt_896",
        "id": "id_891",
        "isbn": "isbn_574",
        "publishedYear": 449,
        "status": "borrowed",
        "title": "title_379",
        "updatedAt": "updatedAt_716"
      }
    ],
    "total": 476
  }
}