Quotes Archive

Click "Get Random Quote" or "Get Quote by ID" to display a quote here.

API Usage

You can fetch quotes via the following endpoints:

Examples using bash and Python:

    # BASH (random quote as raw text):
    curl http://localhost:3000/api/random

    # BASH (random quote as JSON):
    curl http://localhost:3000/api/random/json

    # BASH (specific quote by ID as raw text):
    curl http://localhost:3000/api/quote/123

    # Python (random quote as JSON):
    import requests

    url = "http://localhost:3000/api/random/json"
    response = requests.get(url)
    if response.status_code == 200:
        data = response.json()
        print("Quote ID:", data["id"])
        print("Quote Text:", data["text"])
        else:
            print("Error:", response.status_code)