Home
The world's knowledge, one API call away.
Book402 is an AI-native book knowledge API. Search 3,807 books, get summaries, and discover connections — all via a simple REST API. AI agents pay per query with USDC on Base using the x402 protocol.
Why Book402?¶
| Feature | Description |
|---|---|
| :books: 3,807 Books | Curated library spanning psychology, philosophy, business, science, and more |
| :mag: Hybrid Search | BM25 keyword + vector semantic search for high-quality results |
| :coin: Pay-per-query | Micropayments via USDC on Base — $0.01 per search, $0.05 per summary |
| :key: No API keys | Uses HTTP 402 + x402 protocol — your wallet IS your authentication |
| :robot: Agent-native | Built for AI agents, MCP servers, and autonomous workflows |
How It Works¶
sequenceDiagram
participant Agent as AI Agent
participant API as Book402 API
participant Facilitator as x402 Facilitator
participant Chain as Base (L2)
Agent->>API: GET /search/hybrid?q=stoicism
API-->>Agent: 402 Payment Required + PAYMENT-REQUIRED header
Note over Agent: Signs USDC transfer (EIP-3009)
Agent->>API: GET /search/hybrid?q=stoicism + X-PAYMENT header
API->>Facilitator: Verify payment signature
Facilitator-->>API: ✅ Valid
API-->>Agent: 200 OK + search results
API->>Facilitator: Settle payment
Facilitator->>Chain: Submit USDC transfer on-chain
Chain-->>Facilitator: ✅ Settled
Quick Example¶
# Free — browse books
curl https://book402.com/books?q=stoicism
# Free — list genres
curl https://book402.com/genres
# Paid — hybrid search (returns 402, needs x402 client)
curl https://book402.com/search/hybrid?q=overcoming+fear
# → 402 Payment Required (PAYMENT-REQUIRED header with payment instructions)
Pricing¶
| Endpoint | Price | What you get |
|---|---|---|
/books, /genres, /stats |
Free | Metadata browsing, discovery |
/search/hybrid?q= |
$0.01 | BM25 + vector semantic search |
/search/summaries?q= |
$0.01 | Full-text search in summaries |
/books/:id/summary |
$0.05 | Complete AI-generated book summary |
Links¶
- :globe_with_meridians: Live: book402.com
- :bar_chart: Graph Explorer: book402.com/graph
- :material-github: Source: github.com/hugofreire/book402.com
- :material-book-open-variant: x402 Protocol: x402.org
Built by Feralbyte · Powered by x402