Skip to main content

Random Quotes API

REAL DATA

Public-domain quotes from authors who died before 1929 — every one traceable to a real work, filterable by author, tag and length, reproducible with a seed.

Authoritative reference data or standards computation

Base URL
/api/quotes
Capabilities
1 route Seedable
Last updated
July 29, 2026
Data source
  • Public-domain works — authors deceased 95+ years, attributions verified

GET /api/quotes

Live requestRuns against the public API
No key required
GET/api/quotes

Request parameters

Only quotes whose author contains this text, case-insensitive ('twain' → Mark Twain).

Only quotes tagged with this theme.

Only quotes at most this many characters long.

Advanced response options7 options

Limit the number of returned records (1–100). Defaults to 5.

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/quotes"
const res = await fetch("https://randomapi.dev/api/quotes");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/quotes").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/quotes"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 3
author string

Only quotes whose author contains this text, case-insensitive ('twain' → Mark Twain).

example: author=twain
tag enum

Only quotes tagged with this theme.

default: any
allowed: wisdom | life | courage | work | happiness | time | truth | change | success | nature | love | art | any
example: tag=courage
maxLength int

Only quotes at most this many characters long.

allowed: 20 – 500
example: maxLength=120
Universal parameters Shared response and formatting options 7
count int

Limit the number of returned records (1–100). Defaults to 5.

default: 5
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=text,author
exclude list

Return all fields except these (comma-separated).

example: exclude=tags
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 3
text string

The quote, in its classic public-domain English rendering.

example: When in doubt, tell the truth.

author string

The verified author; unattributable sayings are labelled e.g. 'Anonymous (Japanese proverb)'.

example: Mark Twain

tags string[]

Themes from the fixed set: wisdom, life, courage, work, happiness, time, truth, change, success, nature, love, art.

example: ["truth","wisdom"]

Documented examples

Build-generated requests and complete responses
3
Five random quotes (default)
GET /api/quotes
{
  "data": [
    {
      "text": "Life can only be understood backwards; but it must be lived forwards.",
      "author": "Søren Kierkegaard",
      "tags": [
        "life",
        "time"
      ]
    },
    {
      "text": "All the world's a stage, and all the men and women merely players.",
      "author": "William Shakespeare",
      "tags": [
        "life",
        "art"
      ]
    },
    {
      "text": "Gratitude is not only the greatest of virtues, but the parent of all the others.",
      "author": "Cicero",
      "tags": [
        "happiness",
        "wisdom"
      ]
    },
    {
      "text": "Do I contradict myself? Very well then I contradict myself, I am large, I contain multitudes.",
      "author": "Walt Whitman",
      "tags": [
        "truth",
        "life"
      ]
    },
    {
      "text": "A friend in need is a friend indeed.",
      "author": "Anonymous (English proverb)",
      "tags": [
        "love",
        "truth""generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Three reproducible Mark Twain quotes
GET /api/quotes?author=twain&count=3&seed=42
{
  "data": [
    {
      "text": "Get your facts first, and then you can distort them as much as you please.",
      "author": "Mark Twain",
      "tags": [
        "truth",
        "work"
      ]
    },
    {
      "text": "When in doubt, tell the truth.",
      "author": "Mark Twain",
      "tags": [
        "truth",
        "wisdom"
      ]
    },
    {
      "text": "Wrinkles should merely indicate where smiles have been.",
      "author": "Mark Twain",
      "tags": [
        "happiness",
        "life"
      ]
    }
  ],
  "meta": {
    "endpoint": "quotes",
    "count": 3,
    "seed": 42,
    "params": {
      "author": "twain",
      "tag": "any"
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Short quotes about courage
GET /api/quotes?tag=courage&maxLength=80
{
  "data": [
    {
      "text": "The credit belongs to the man who is actually in the arena.",
      "author": "Theodore Roosevelt",
      "tags": [
        "courage",
        "work"
      ]
    },
    {
      "text": "Hope is the thing with feathers that perches in the soul.",
      "author": "Emily Dickinson",
      "tags": [
        "happiness",
        "courage"
      ]
    },
    {
      "text": "Fortune favors the bold.",
      "author": "Virgil",
      "tags": [
        "courage",
        "success"
      ]
    },
    {
      "text": "We are all in the gutter, but some of us are looking at the stars.",
      "author": "Oscar Wilde",
      "tags": [
        "courage",
        "happiness"
      ]
    },
    {
      "text": "I am not afraid of storms, for I am learning how to sail my ship.",
      "author": "Louisa May Alcott",
      "tags": [
        "courage",
        "change""generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

159 quotes you can ship without a rights headache: every named author died before 1929 (Marcus Aurelius, Seneca, Shakespeare, Austen, Thoreau, Emerson, Dickinson, Twain, Wilde, Nietzsche, …), so the originals — and the classic translations used — are public domain. Traditional sayings with no identifiable author are honestly labelled proverbs.

No apocrypha. Each quote is traceable to a specific published work, letter or speech. The famous-but-fake internet attributions are deliberately absent — no Einstein one-liners, no misattributed Wilde.

Filters genuinely filter: author is a case-insensitive contains-match, tag restricts to one of 12 curated themes, and maxLength caps the quote length in characters (handy for UI slots). The data is real, but the sampling order is seeded — request ?seed=42 and you get the same quotes in the same order forever.

Use it for

  • Quote-of-the-day widgets and screensavers with zero licensing risk
  • Realistic placeholder testimonials and blockquotes in mockups (maxLength fits the design)
  • Stable demo/test fixtures: the same seed returns the same quotes in CI forever

Frequently asked questions

Are the attributions accurate?

Yes — every quote comes from public-domain works with verified attribution. No fabricated "Einstein said" internet apocrypha.

Can I use the quotes commercially?

The quotes are public domain (authors deceased 95+ years), so quoting them in your product is generally safe — attribution ships in every record.

How do I filter quotes?

author matches by name, tag picks a theme, maxLength caps characters for tight UI slots, and seed makes the sample reproducible.