QuotesDB is a free online quotes API that provides you with a variety of quotes. It includes features for filtering and generating random quotes, making it a user-friendly tool for accessing quotes programmatically.
Get Random Quote
This endpoint returns a random quote from the database.
fetch("https://quotes-db.vercel.app/api/random")
.then(res => res.json())
.then(data => console.log(data))
{
"id": 5,
"quote": "...",
"author": "Albert Einstein",
"category": "Motivational"
}
Get All Quotes
This endpoint returns all quotes from the database.
fetch("https://quotes-db.vercel.app/api/quotes")
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.log(err))
Output :
[{
"id": 5,
"quote": "...",
"author": "Albert Einstein",
"category": "Motivational"
}, {
"id": 6,
"quote": "...",
"author": "Albert Einstein",
"category": "Motivational"
}, {
"id": 7,
"quote": "...",
"author": "Albert Einstein",
"category": "Motivational"
}]
QuotesDB is a powerful backend API that gives users access to a large database of quotes from different authors and topics. Developers can use it to easily add inspiring and motivational quotes to their apps or websites. It includes features for filtering and generating random quotes, making it a user-friendly tool for accessing quotes programmatically.
Copyright © 2022 Sachin Kumar