Save over 30% when you subscribe to an annual subscription plan!

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:

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

  • categories  optional

    Comma-separated list of categories to include in results. Example: categories=wisdom,success

  • exclude_categories  optional

    Comma-separated list of categories to exclude from results. 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

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

Headers

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

Sample Response

JSON
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

  • categories  optional

    Comma-separated list of categories to include in results. Example: categories=wisdom,success

  • exclude_categories  optional

    Comma-separated list of categories to exclude from results. 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

Sample Request Live Demo!

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
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/quoteoftheday

Headers

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

Sample Response

JSON
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

  • 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

Returns an array of author names as strings.

Sample Request Live Demo!

https://api.api-ninjas.com/v2/quoteauthors

Headers

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

Sample Response

JSON
1 2 3 4 5 6 [ "Albert Einstein", "Mark Twain", "William Shakespeare", ... ]