NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

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:

(4.3)

From 4,398 users

3,500+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
389ms427ms457ms812ms1172ms

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:

  • wisdom
  • philosophy
  • life
  • truth
  • inspirational
  • relationships
  • love
  • faith
  • humor
  • success
  • courage
  • happiness
  • art
  • writing
  • fear
  • nature
  • time
  • freedom
  • death
  • leadership

Parameters

  • categories  optional

    Comma-separated list of categories to include in results (results will match all of the categories). Example: categories=wisdom,success

  • exclude_categories  optional

    Comma-separated list of categories to exclude from results (results will not match any of the categories). Example: exclude_categories=love,philosophy

  • author  optional

    Filter quotes by author name (partial match supported). Example: author=Einstein

  • work  optional

    Filter quotes by work title (partial match supported). Example: work=War

  • limit  premium only

    Number of results to return. Must be between 1 and 100. Default is 1.

  • offset  premium only

    Number of results to skip for pagination. Default is 0.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • 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!

categories
exclude_categories
author
work
limit premium

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%2Cwisdom

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      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.

The categories available are the same as for /v2/quotes.

Parameters

  • categories  optional

    Comma-separated list of categories to include in results (results will match all of the categories). Example: categories=wisdom,success

  • exclude_categories  optional

    Comma-separated list of categories to exclude from results (results will not match any of the categories). Example: exclude_categories=love,philosophy

  • author  optional

    Filter quotes by author name (partial match supported). Example: author=Einstein

  • work  optional

    Filter quotes by work title (partial match supported). Example: work=War

  • limit  premium only

    Number of random results to return. Must be between 1 and 100. Default is 1.

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,wisdom

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      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), 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/quoteoftheday

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      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

  • limit  optional

    Maximum number of authors to return. Must be between 1 and 500. Default is 100.

  • offset  optional

    Number 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/quoteauthors

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    "Albert Einstein",
    "Mark Twain",
    "William Shakespeare",
    "..."
]

Frequently Asked Questions

  • 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.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • 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.
  • 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.
  • The Quotes API has four endpoints: /v2/quotes returns quotes in deterministic order with pagination via limit and offset, /v2/randomquotes returns different random quotes on each request, /v2/quoteoftheday returns 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.
  • On the /v2/quotes and /v2/randomquotes endpoints you can pass categories (a comma-separated list such as wisdom,success matching all listed tags), exclude_categories to omit tags, author for a partial author-name match, and work for 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.
  • Each quote object contains quote (the quote text), author (the person who said it), work (the originating book or work, if available), and categories (an array of topic tags). The /v2/quoteauthors endpoint instead returns a plain JSON array of author name strings; for richer biographical data on those authors, pair it with the Historical Figures API.
  • By default /v2/quotes and /v2/randomquotes return a single quote, but with a premium plan you can set the limit parameter to any value between 1 and 100 and use offset for pagination on /v2/quotes. See pricing for plan details and premium-only features like the /v2/quoteauthors endpoint.