Get random motivational quotes!
Get a Random QuoteFollow these steps to integrate the Quote API into your project:
Use the following endpoint to fetch a random quote:
GET /api/random
A successful response will return a JSON object like this:
{ "content": "The only way to do great work is to love what you do.", "author": "Steve Jobs" }
Use this example code to fetch quotes in JavaScript:
fetch('/api/random') .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
If you plan to call this API from another domain, make sure CORS is properly configured in your application.