API Documentation

Endpoint: /api/quotes/[id]

Method: GET

This endpoint retrieves quotes based on the provided id parameter.

Parameters

  • id (string): The ID of the quote to retrieve. Special values:
    • random: Retrieves a random quote.
    • quote-of-the-day: Retrieves the quote of the day.

Responses

  • 200 OK: Returns the quote data.
    {
      id: string,
      text: string,
      author: {
        id: string,
        name: string
      }
    }
  • 404 Not Found: If the quote with the specified ID does not exist.
    { 
      error: "Quote not found" 
    }