library-rest
Full-text search over book titles and ISBNs.
GET
/books/searchReturns books whose title or ISBN contains q (case-insensitive). An empty or missing q returns no results. Unlike GET /books, this endpoint is not paginated and has no other filters — it is meant for quick free-text lookups such as a search box.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| q | query | string | Free-text search term matched against title and ISBN. |
Responses
200 Books matching the search term (possibly empty).
application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | array of object | yes | |
| authorId | string | yes | The id of the Author who wrote this book. |
| createdAt | string (date-time) | yes | When the book record was created. |
| id | string | yes | Unique identifier assigned by the server, prefixed with bk_. |
| isbn | string | yes | The book's ISBN. Must be unique across the catalog. |
| publishedYear | integer | yes | The year the book was first published. Must be between 1450 and next year. |
| status | string | yes | A book's availability. borrowed means it is out on an open loan. Allowed values: available, borrowed |
| title | string | yes | The book's display title, 1–200 characters. |
| updatedAt | string (date-time) | yes | When the book record was last modified. |
| meta | object | yes | Response metadata attached to every successful response. |
| requestId | string | yes | Correlation id for this request, echoed from the X-Request-Id request header or generated if absent. Useful for tracing a request across logs. |
| total | integer | Total number of matches before pagination was applied. Present only on paginated list responses (currently GET /books). |
Errors
| Code | Message | Description |
|---|---|---|
| 401 | The request is missing a valid Authorization: Bearer <token> header. | |
| 500 | An unexpected error occurred. The response never leaks internal error details. |
Response example
{
"data": [
{
"authorId": "authorId_985",
"createdAt": "createdAt_435",
"id": "id_669",
"isbn": "isbn_529",
"publishedYear": 835,
"status": "available",
"title": "title_283",
"updatedAt": "updatedAt_938"
}
],
"meta": {
"requestId": "requestId_512",
"total": 101
}
}