Skip to content

Latest commit

 

History

History
119 lines (85 loc) · 1.44 KB

API_EXAMPLES.md

File metadata and controls

119 lines (85 loc) · 1.44 KB

📘 API Request & Response Examples

This document provides sample request and response payloads for BiblioDrift APIs.


🔹 1. Chat Endpoint

POST /api/v1/chat

Request

{
  "message": "I want something cozy for a rainy evening",
  "history": [
    {"role": "user", "content": "Hello!"},
    {"role": "assistant", "content": "Welcome to my shop. How can I help you find a story today?"}
  ]
}

Response

{
  "response": "You might enjoy 'The Night Circus' or 'Before the Coffee Gets Cold' for a cozy vibe."
}

🔹 2. Mood Search

POST /api/v1/mood-search

Request

{
  "query": "mystery thriller"
}

Response

{
  "results": [
    {
      "title": "Gone Girl",
      "author": "Gillian Flynn"
    },
    {
      "title": "The Girl with the Dragon Tattoo",
      "author": "Stieg Larsson"
    }
  ]
}

🔹 3. Analyze Mood

POST /api/v1/analyze-mood

Request

{
  "title": "The Great Gatsby",
  "author": "F. Scott Fitzgerald"
}

Response

{
  "mood": ["melancholic", "romantic", "tragic"]
}

🔹 4. Generate Notes

POST /api/v1/generate-note

Request

{
  "title": "Atomic Habits"
}

Response

{
  "summary": "A practical guide to building good habits and breaking bad ones."
}

🔹 5. Health Check

GET /api/v1/health

Response

{
  "status": "ok"
}