This document outlines the REST API endpoints provided by this service.
http://localhost:8080/
Description: Returns a welcome message.
Response
200 OK
Hello, World!
Description: Searches for books and authors via OpenLibrary.
Query Parameters:
q(string): The search term (e.g.,"harry+potter")
Response
200 OK
{
"books": [
{
"title": "Sample Book",
"author_name": ["Author One"],
"work_id": "Work ID"
}
],
"authors": [
{
"name": "Author One",
"work_count": 5
}
]
}Description: Retrieves metadata for a book by its OpenLibrary Work ID.
Path Parameters:
book_id(string): e.g.,OL123456W
Response
200 OK
{
"title": "Book Title",
"description": "This is a description of a book...",
"author_keys": ["/authors/author_id"]
}Description: Retrieves metadata and bio for an author by their OpenLibrary Author ID.
Path Parameters:
author_id(string): e.g.,OL98765A
Response
200 OK
{
"name": "Author One",
"bio": "Author One is a fictional writer used for documentation examples..."
}All errors are returned in a consistent JSON format.
{
"error": "Description of the error"
}Common status codes:
400 Bad Request: Malformed or missing parameters404 Not Found: Resource not found500 Internal Server Error: Server-side issue
- All responses use
Content-Type: application/jsonunless otherwise noted. - This API does not require authentication (yet).
- Future versions may add pagination and filtering options.