Quotes API
The Quotes API provides tens of thousands of carefully curated, aphoristic quotes from famous people throughout history. All quotes are pre-vetted and pre-processed by our data team to ensure quality and selected specifically for their memorable and thought-provoking nature.
Available endpoints:
- /v2/quotes - Get quotes with pagination support (deterministic order)
- /v2/randomquotes - Get random quotes
- /v2/quoteoftheday - Get today's quote (same quote all day)
- /v2/quoteauthors - Get list of authors with multiple aphoristic quotes (premium only)
From 4,398 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 389ms | 427ms | 457ms | 812ms | 1172ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v2/quotes GET
https://api.api-ninjas.com/v2/quotes
Returns high-quality quotes with advanced filtering by categories (include/exclude), author, work, and pagination support. Returns quotes in deterministic order. For random quotes, use /v2/randomquotes or /v2/quoteoftheday.
The following categories are available:
wisdomphilosophylifetruthinspirationalrelationshipslovefaithhumorsuccesscouragehappinessartwritingfearnaturetimefreedomdeathleadership
Parameters
categoriesoptionalComma-separated list of categories to include in results (results will match all of the categories). Example:
categories=wisdom,successexclude_categoriesoptionalComma-separated list of categories to exclude from results (results will not match any of the categories). Example:
exclude_categories=love,philosophyauthoroptionalFilter quotes by author name (partial match supported). Example:
author=EinsteinworkoptionalFilter quotes by work title (partial match supported). Example:
work=Warlimitpremium onlyNumber of results to return. Must be between
1and100. Default is1.offsetpremium onlyNumber of results to skip for pagination. Default is
0.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
quoteThe quote text.
authorThe author of the quote.
workThe work/book from which the quote originates (if available).
categoriesArray of categories associated with the quote.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v2/quotes?categories=success%2CwisdomHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v2/quotes?categories=success,wisdom" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
/v2/randomquotes GET
https://api.api-ninjas.com/v2/randomquotes
Returns random high-quality quotes with advanced filtering by categories (include/exclude), author, and work. Each request returns different random quotes.
The categories available are the same as for /v2/quotes.
Parameters
categoriesoptionalComma-separated list of categories to include in results (results will match all of the categories). Example:
categories=wisdom,successexclude_categoriesoptionalComma-separated list of categories to exclude from results (results will not match any of the categories). Example:
exclude_categories=love,philosophyauthoroptionalFilter quotes by author name (partial match supported). Example:
author=EinsteinworkoptionalFilter quotes by work title (partial match supported). Example:
work=Warlimitpremium onlyNumber of random results to return. Must be between
1and100. Default is1.
Response
Same response format as /v2/quotes (returns an array of objects, each containing the fields above), or an error if the request is unsuccessful.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v2/randomquotes?categories=success,wisdomHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
/v2/quoteoftheday GET
https://api.api-ninjas.com/v2/quoteoftheday
Returns a single aphoristic quote for the current day. The same pre-vetted, high-quality quote is returned for all requests on the same day, and changes each day. Perfect for displaying on your website or app. No filtering parameters are available for this endpoint to ensure everyone sees the same quote of the day.
Response
Same response format as /v2/quotes (always returns a single quote), or an error if the request is unsuccessful.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v2/quoteofthedayHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
/v2/quoteauthors GETPremium subscriptions only
https://api.api-ninjas.com/v2/quoteauthors
Returns a list of authors who have at least 2 aphoristic quotes in the database. Authors are sorted by the number of quotes (descending) and then alphabetically by name. Default returns 100 authors (maximum 500 per request).
Parameters
limitoptionalMaximum number of authors to return. Must be between
1and500. Default is100.offsetoptionalNumber of authors to skip. Used for pagination. Default is
0.
Response
A JSON array of author names as strings, or an error if the request is unsuccessful.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v2/quoteauthorsHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Frequently Asked Questions
Can I use the Quotes API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Quotes API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Quotes API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Quotes API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.What endpoints does the Quotes API offer and how do they differ?
The Quotes API has four endpoints:/v2/quotesreturns quotes in deterministic order with pagination vialimitandoffset,/v2/randomquotesreturns different random quotes on each request,/v2/quoteofthedayreturns a single quote that stays the same all day and changes daily, and/v2/quoteauthors(premium only) lists authors who have at least 2 quotes. If you just need short sayings, also see the Advice API.How do I filter quotes by topic, author, or work?
On the/v2/quotesand/v2/randomquotesendpoints you can passcategories(a comma-separated list such aswisdom,successmatching all listed tags),exclude_categoriesto omit tags,authorfor a partial author-name match, andworkfor a partial work-title match. Available categories include wisdom, philosophy, life, love, success, leadership, and more; see the full list on the Quotes API page.What fields does the Quotes API response include?
Each quote object containsquote(the quote text),author(the person who said it),work(the originating book or work, if available), andcategories(an array of topic tags). The/v2/quoteauthorsendpoint instead returns a plain JSON array of author name strings; for richer biographical data on those authors, pair it with the Historical Figures API.How many quotes can I retrieve per request?
By default/v2/quotesand/v2/randomquotesreturn a single quote, but with a premium plan you can set thelimitparameter to any value between1and100and useoffsetfor pagination on/v2/quotes. See pricing for plan details and premium-only features like the/v2/quoteauthorsendpoint.