These endpoints require no authentication or payment.

List Books

GET /books

Query parameters:

Parameter Type Description
q string Full-text search across title, author, description
author string Filter by author name
genre string Filter by genre
isbn string Exact ISBN lookup
page number Page number (default: 1)
limit number Results per page (default: 20, max: 100)

Examples

# Search by keyword
curl "https://book402.com/books?q=habits"

# Filter by author
curl "https://book402.com/books?author=brene+brown"

# Filter by genre
curl "https://book402.com/books?genre=psychology"

# ISBN lookup
curl "https://book402.com/books?isbn=9781984878113"

# Pagination
curl "https://book402.com/books?page=2&limit=10"

Response

{
  "data": [
    {
      "id": 1847,
      "title": "Atomic Habits",
      "author": "James Clear",
      "google_title": "Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones",
      "publication_date": "2018-10-16",
      "genre": "Personal Development",
      "isbn": "9780735211292",
      "description": "No matter your goals, Atomic Habits offers a proven framework..."
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 20
}

Get Single Book

GET /books/:id
curl "https://book402.com/books/1847"

Returns full book metadata including Google Books enrichment.


List Genres

GET /genres
curl "https://book402.com/genres"

Response

[
  { "genre": "Personal Development", "count": 487 },
  { "genre": "Psychology", "count": 312 },
  { "genre": "Business", "count": 298 },
  { "genre": "Philosophy", "count": 215 }
]

Database Stats

GET /stats
curl "https://book402.com/stats"

Response

{
  "books": 3807,
  "chunks": 23145,
  "genres": 42,
  "authors": 2891
}