API Endpoints
GET Random Quote
https://quotes.dhruvchheda.com/api/quote/random
Get a random inspirational quote.
curl -X GET "https://quotes.dhruvchheda.com/api/quote/random"
GET All Quotes (Paginated)
https://quotes.dhruvchheda.com/api/quotes?page=1&limit=10
Get all quotes with pagination support.
curl -X GET "https://quotes.dhruvchheda.com/api/quotes?page=1&limit=10"
GET Search Quotes
https://quotes.dhruvchheda.com/api/quotes/search?q=success
Search quotes by content keywords.
curl -X GET "https://quotes.dhruvchheda.com/api/quotes/search?q=success"
GET Quotes by Author
https://quotes.dhruvchheda.com/api/quotes/author/einstein
Get all quotes by a specific author.
curl -X GET "https://quotes.dhruvchheda.com/api/quotes/author/einstein"
GET Quotes by Tag
https://quotes.dhruvchheda.com/api/quotes/tag/motivation
Get all quotes with a specific tag.
curl -X GET "https://quotes.dhruvchheda.com/api/quotes/tag/motivation"
GET Quote by ID
https://quotes.dhruvchheda.com/api/quote/{id}
Get a specific quote by its unique ID.
curl -X GET "https://quotes.dhruvchheda.com/api/quote/quote-id-123"
GET Filter by Length
https://quotes.dhruvchheda.com/api/quotes/length?min=50&max=100
Filter quotes by character length.
curl -X GET "https://quotes.dhruvchheda.com/api/quotes/length?min=50&max=100"
GET All Tags
https://quotes.dhruvchheda.com/api/tags
Get all available tags.
curl -X GET "https://quotes.dhruvchheda.com/api/tags"
GET Health Check
https://quotes.dhruvchheda.com/health
Check API health and status.
curl -X GET "https://quotes.dhruvchheda.com/health"
Usage Examples
JavaScript/Node.js
// Get a random quote
const response = await fetch('https://quotes.dhruvchheda.com/api/quote/random');
const quote = await response.json();
console.log(`"${quote.content}" - ${quote.author}`);
// Search for quotes
const searchResponse = await fetch('https://quotes.dhruvchheda.com/api/quotes/search?q=success');
const searchResults = await searchResponse.json();
console.log(`Found ${searchResults.total} quotes about success`);
Python
import requests
# Get a random quote
response = requests.get('https://quotes.dhruvchheda.com/api/quote/random')
quote = response.json()
print(f'"{quote["content"]}" - {quote["author"]}')
# Get quotes by author
einstein_quotes = requests.get('https://quotes.dhruvchheda.com/api/quotes/author/einstein')
print(f"Found {einstein_quotes.json()['total']} Einstein quotes")
Response Format
All API responses return JSON with the following structure:
{
"_id": "quote-id-123",
"content": "The only way to do great work is to love what you do.",
"author": "Steve Jobs",
"tags": ["work", "passion", "success"],
"length": 49,
"dateAdded": "2023-01-01"
}
Rate Limiting
API calls are rate limited to 100 requests per 60 seconds per IP address.
Rate limit information is included in response headers:
X-RateLimit-Limit: 100 X-RateLimit-Remaining: 59 X-RateLimit-Reset: 1640995200