This API returns a random quote from a collection of quotes. The quotes are from famous people and are in English.
Without length parameters, the quote is 120 to 400 characters long. If only max-length is given and it is below 120, the minimum drops to 1; if only min-length is given and it is above 400, the maximum rises to 10,000. A min-length greater than max-length returns a 400 error. If no quote matches the requested length, the API returns a 404 error and the call is not billed.
| Name | Example | Description |
|---|---|---|
min-length | 120 | The minimum length of the quote in characters. Defaults to 120, or to 1 if only max-length is given and it is below 120. Must not be greater than max-length. |
max-length | 400 | The maximum length of the quote in characters. Defaults to 400, or to 10,000 if only min-length is given and it is above 400. |
api-key | abcd1234 | Your API key. |
{
"author": "Francis Bacon",
"quote": "A little philosophy inclineth man's mind to atheism, but depth in philosophy bringeth men's minds about to religion."
} Copy Code
curl -X GET 'https://api.apileague.com/retrieve-random-quote?min-length=50&max-length=150' \ -H 'x-api-key: myapikey'
Response Headers:
Content-Type: application/jsonX-API-Quota-Request: The number of tokens used by the requestX-API-Quota-Used: The number of tokens used in total todayX-API-Quota-Left: The number of tokens left today (depends on your plan)The database contains quotes from a diverse range of famous people, including historical figures, authors, scientists, politicians, and celebrities.
Currently, the API returns a random quote. If you need quotes on specific topics, you might want to check if a search parameter becomes available in future updates.
The API draws from a massive collection of thousands of quotes, ensuring you get a wide variety of wisdom and humor.
The Random Quote API returns famous quotes from various authors on a wide range of topics, while the Random Affirmation API provides positive statements designed to boost self-confidence.