Random Quote API

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.

GET
https://api.apileague.com/retrieve-random-quote

Parameters

NameExampleDescription
min-length
n o q
120The 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
n o q
400The 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
s r q
abcd1234Your API key.
Example Request and Response
GET
https://api.apileague.com/retrieve-random-quote?min-length=50&max-length=150
{
    "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 Codecurl -X GET 'https://api.apileague.com/retrieve-random-quote?min-length=50&max-length=150' \ -H 'x-api-key: myapikey'

Headers

Response Headers:

  • Content-Type: application/json
  • X-API-Quota-Request: The number of tokens used by the request
  • X-API-Quota-Used: The number of tokens used in total today
  • X-API-Quota-Left: The number of tokens left today (depends on your plan)

Frequently Asked Questions

Who are the quotes by?

The database contains quotes from a diverse range of famous people, including historical figures, authors, scientists, politicians, and celebrities.

Can I get quotes about specific topics?

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.

How many quotes are in the database?

The API draws from a massive collection of thousands of quotes, ensuring you get a wide variety of wisdom and humor.

How is the Random Quote API different from the Random Affirmation API?

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.

Questions? Need Help? Ask Away

Quotas

Calling this endpoint costs
1 token