This is an API for serving categorized quotes. It includes features such as retrieving all quotes, fetching quotes by category or author, adding new quotes, updating or deleting existing ones, and a random quote generator.
https://quotes-api.priyanshideshpande19.workers.dev
- Purpose: Check if the API is running.
- Example:
curl https://quotes-api.priyanshideshpande19.workers.dev/
- Purpose: Retrieve all quotes. Optionally filter by
categoryorauthor. - Example:
curl "https://quotes-api.priyanshideshpande19.workers.dev/quotes?category=motivation"
- Purpose: Add a new quote.
- Example:
bash curl -X POST https://quotes-api.priyanshideshpande19.workers.dev/quotes -H "Content-Type: application/json" -d '{"text": "The only way to do great work is to love what you do.", "author": "Steve Jobs", "category": "inspiration"}'
- Purpose: Fetch a random quote. Optionally filter by
category. - Example:
curl "https://quotes-api.priyanshideshpande19.workers.dev/quotes/random?category=motivation"
- Purpose: Retrieve a specific quote by its unique ID.
- Example:
curl https://quotes-api.priyanshideshpande19.workers.dev/quotes/12345
- Purpose: Update a quote by its ID.
- Example:
bash curl -X PUT https://quotes-api.priyanshideshpande19.workers.dev/quotes/12345 -H "Content-Type: application/json" -d '{"text": "Updated quote text", "author": "Updated Author", "category": "Updated Category"}'
- Purpose: Delete a specific quote by its unique ID.
- Example:
curl -X DELETE https://quotes-api.priyanshideshpande19.workers.dev/quotes/12345
- Purpose: Retrieve a list of all available categories.
- Example:
curl https://quotes-api.priyanshideshpande19.workers.dev/categories
- Ensure JSON payloads are correctly formatted for POST and PUT requests.
- Replace
12345with the actual quote ID for specific operations.