Public API

Internal API for Stoic philosophy quotes, powering our 404 pages and future content features

Endpoint

GET /api/quotes

Returns a random Stoic philosophy quote with rich metadata.

Response Format

{
  "quote": {
    "id": 1,
    "text": "Quote text...",
    "author": "Author name",
    "work": "Work title",
    "themes": ["theme1", "theme2"],
    "difficulty": "beginner",
    "length": "short",
    "popularity": "high",
    "context": "Historical context",
    "modernRelevance": "Modern application"
  },
  "metadata": {
    "totalQuotes": 30,
    "version": "1.0",
    "lastUpdated": "2025-01-30",
    "description": "A random Stoic philosophy quote with rich metadata"
  }
}

Usage Examples

JavaScript/Fetch

// Get a random quote
const response = await fetch('/api/quotes');
const data = await response.json();
console.log(data.quote.text);
console.log(`By ${data.quote.author}`);

Python/Requests

import requests

# Get a random quote
response = requests.get('https://your-site.com/api/quotes')
data = response.json()
print(data['quote']['text'])
print(f"By {data['quote']['author']}")

Test the API

Click the button above to test the API...