Quotely is a simple API that returns random quotes with their respective author names. It can return a single quote or multiple quotes in JSON format.
Sample webpage created using the API
To get a single random quote, simply access the following URL:
The API will return a JSON object with the following format:
{
"quoteText": "Man is equally incapable of seeing the nothingness from which he emerges and the infinity in which he is engulfed.",
"quoteAuthor": "Blaise Pascal"
}
To get a specific number of random quotes, add the desired number at the end of the URL as shown below:
Replace {count}
with the desired number of quotes.
The API will return an array of JSON objects, each containing a quote and its respective author name. Here is an example of how the output would look like for {count} = 4
:
[{
"quoteText": "He who controls others may be powerful, but he who has mastered himself is mightier still.",
"quoteAuthor": "Lao Tzu"
},
{
"quoteText": "The most formidable weapon against errors of every kind is reason.",
"quoteAuthor": "Thomas Paine"
},
{
"quoteText": "I never think of the future. It comes soon enough.",
"quoteAuthor": "Albert Einstein"
},
{
"quoteText": "Moments of complete apathy are the best for new creations.",
"quoteAuthor": "Philip Breedveld"
}]
This API is currently hosted on Render, a cloud platform for deploying and scaling web applications. You can easily deploy your own version of this API by following these steps:
- Clone the GitHub repository:
git clone https://github.com/your_username/quotely-api.git
- Navigate to the project directory:
quotely
- Install the required dependencies:
npm install
- Start the server:
npm start
- Your API should now be accessible at
http://localhost:3000/quotes
Note: You should replace "https://quotely-m7oa.onrender.com" with your own API URL if you decide to deploy your own version of the API.