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)
Checking API status...
/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.
Parameters
- categoriesoptional- Comma-separated list of categories to include in results. Example: - categories=wisdom,success
- exclude_categoriesoptional- Comma-separated list of categories to exclude from results. Example: - exclude_categories=love,philosophy
- authoroptional- Filter quotes by author name (partial match supported). Example: - author=Einstein
- workoptional- Filter quotes by work title (partial match supported). Example: - work=War
- limitpremium only- Number of results to return. Must be between - 1and- 100. Default is- 1.
- offsetpremium only- Number of results to skip for pagination. Default is - 0.
Headers
- X-Api-Keyrequired- API Key associated with your account. 
Response
- quote- The quote text. 
- author- The author of the quote. 
- work- The work/book from which the quote originates (if available). 
- categories- Array of categories associated with the quote. 
Sample Request Live Demo!
https://api.api-ninjas.com/v2/quotes?categories=success,wisdomHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
[
  {
    "quote": "The road to success begins with knowing what you need to know and why",
    "author": "Savania China",
    "work": "",
    "categories": [
      "success",
      "wisdom",
      "inspirational"
    ]
  }
]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.
Parameters
- categoriesoptional- Comma-separated list of categories to include in results. Example: - categories=wisdom,success
- exclude_categoriesoptional- Comma-separated list of categories to exclude from results. Example: - exclude_categories=love,philosophy
- authoroptional- Filter quotes by author name (partial match supported). Example: - author=Einstein
- workoptional- Filter quotes by work title (partial match supported). Example: - work=War
- limitpremium only- Number of random results to return. Must be between - 1and- 100. Default is- 1.
Response
Same response format as /v2/quotes
Sample Request Live Demo!
https://api.api-ninjas.com/v2/randomquotes?categories=success,wisdomHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
[
  {
    "quote": "Always remember, success leaves clues.",
    "author": "John Patrick Hickey",
    "work": "On The Journey To Achievement",
    "categories": [
      "success",
      "wisdom",
      "inspirational"
    ]
  }
]/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)
Sample Request Live Demo!
https://api.api-ninjas.com/v2/quoteofthedayHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
[
  {
    "quote": "Goals want to realize themselves.",
    "author": "Zoltan Andrejkovics",
    "work": "The Invisible Game: The Mindset of a Winning Team",
    "categories": [
      "inspirational",
      "philosophy",
      "wisdom",
      "success"
    ]
  }
]/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
- limitoptional- Maximum number of authors to return. Must be between - 1and- 500. Default is- 100.
- offsetoptional- Number of authors to skip. Used for pagination. Default is - 0.
Response
Returns an array of author names as strings.
Sample Request Live Demo!
https://api.api-ninjas.com/v2/quoteauthorsHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
[
  "Albert Einstein",
  "Mark Twain",
  "William Shakespeare",
  ...
]