Get random quotes
Returns randomly chosen quotes, optionally filtered by category, author or work title. For stable paginated results use /quotes; for one fixed daily quote use /quoteoftheday.
Example code
// Using @orth/sdk - The simplest way to call APIs
// Install: npm install @orth/sdk
import Orthogonal from "@orth/sdk";
const orthogonal = new Orthogonal({
apiKey: process.env.ORTHOGONAL_API_KEY,
});
const output = await orthogonal.run({
api: "api-ninjas",
path: "/v2/randomquotes"
});
console.log(output);Query parameters
Comma-separated list of categories to include in results (results will match all of the categories). Example: categories=wisdom,success
Comma-separated list of categories to exclude from results (results will not match any of the categories). Example: exclude_categories=love,philosophy
Filter quotes by author name (partial match supported). Example: author=Einstein
Filter quotes by work title (partial match supported). Example: work=War
Number of random results to return. Must be between 1 and 100. Default is 1. (Default: 1)
Set safe=true to exclude quotes flagged as sexually explicit, crude, or containing profanity, slurs, or offensive content. Defaults to false, so results are unfiltered unless you opt in. Filtering is best-effort and not a guarantee. Any value other than true/false returns an error. (Default: False)