Api

Quotes

API reference for Quote endpoints — list, search, filter, and retrieve quotes.

Quotes

The Quotes endpoints allow you to retrieve, search, and filter quotes from the Quote Gallery catalog. All quotes returned are approved and publicly visible.

List Quotes

Retrieve a paginated list of approved public quotes.

GET /api/v1/quotes

Query Parameters

ParameterTypeRequiredDefaultDescription
languagestringNoFilter by language code (e.g., en, nl, tr)
categoriesstringNoComma-separated list of categories to filter by
author_idstringNoFilter quotes by a specific author ID
limitnumberNo20Number of results per page (max 100)
offsetnumberNo0Pagination offset

Example Request

curl -H "X-API-Key: your_api_key_here" \
  "https://quotegallery.nl/api/v1/quotes?language=en&categories=wisdom,success&limit=10"

Example Response

{
  "data": [
    {
      "id": "abc123",
      "text": "The only way to do great work is to love what you do.",
      "language": "en",
      "categories": ["wisdom", "success"],
      "likeCount": 42,
      "author": {
        "id": "xyz789",
        "name": "Steve Jobs"
      },
      "createdAt": 1704067200000
    }
  ],
  "pagination": {
    "total": 150,
    "limit": 10,
    "offset": 0,
    "hasMore": true
  }
}

Response Fields

FieldTypeDescription
dataarrayArray of quote objects
data[].idstringUnique identifier for the quote
data[].textstringThe quote text
data[].languagestringLanguage code of the quote
data[].categoriesstring[]List of category slugs the quote belongs to
data[].likeCountnumberNumber of likes the quote has received
data[].authorobjectThe quote's author
data[].author.idstringUnique identifier for the author
data[].author.namestringAuthor's display name
data[].createdAtnumberUnix timestamp (milliseconds) when the quote was created
pagination.totalnumberTotal number of matching quotes
pagination.limitnumberNumber of results per page
pagination.offsetnumberCurrent offset
pagination.hasMorebooleanWhether more results are available

Random Quote

Get a random approved quote. Optionally filter by language or categories.

GET /api/v1/quotes/random

Query Parameters

ParameterTypeRequiredDefaultDescription
languagestringNoFilter by language code
categoriesstringNoComma-separated list of categories

Example Request

curl -H "X-API-Key: your_api_key_here" \
  "https://quotegallery.nl/api/v1/quotes/random?language=en"

Example Response

{
  "data": {
    "id": "abc123",
    "text": "Stay hungry, stay foolish.",
    "language": "en",
    "categories": ["inspirational"],
    "likeCount": 128,
    "author": {
      "id": "xyz789",
      "name": "Steve Jobs"
    },
    "createdAt": 1704067200000
  }
}

Response Fields

FieldTypeDescription
dataobjectA single quote object
data.idstringUnique identifier for the quote
data.textstringThe quote text
data.languagestringLanguage code of the quote
data.categoriesstring[]List of category slugs
data.likeCountnumberNumber of likes
data.authorobjectThe quote's author
data.author.idstringAuthor's unique identifier
data.author.namestringAuthor's display name
data.createdAtnumberUnix timestamp (milliseconds)
The random endpoint is perfect for "Quote of the Day" features, loading screen tips, or any use case where you want to show a different quote each time.

Get Quote by ID

Retrieve a single quote by its unique identifier. This endpoint returns additional details including all available translations.

GET /api/v1/quotes/:id

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the quote

Query Parameters

ParameterTypeRequiredDefaultDescription
languagestringNoPreferred language for the primary quote text

Example Request

curl -H "X-API-Key: your_api_key_here" \
  "https://quotegallery.nl/api/v1/quotes/abc123?language=en"

Example Response

{
  "data": {
    "id": "abc123",
    "text": "The only way to do great work is to love what you do.",
    "language": "en",
    "categories": ["wisdom", "success"],
    "likeCount": 42,
    "author": {
      "id": "xyz789",
      "name": "Steve Jobs",
      "imageUrl": "https://..."
    },
    "translations": [
      { "language": "en", "text": "The only way to do great work is to love what you do." },
      { "language": "nl", "text": "De enige manier om geweldig werk te doen is door te houden van wat je doet." }
    ],
    "createdAt": 1704067200000
  }
}

Response Fields

FieldTypeDescription
dataobjectThe quote object
data.idstringUnique identifier for the quote
data.textstringThe quote text (in the requested or default language)
data.languagestringLanguage code of the primary text
data.categoriesstring[]List of category slugs
data.likeCountnumberNumber of likes
data.authorobjectThe quote's author (extended)
data.author.idstringAuthor's unique identifier
data.author.namestringAuthor's display name
data.author.imageUrlstringURL to the author's profile image
data.translationsarrayAll available translations of this quote
data.translations[].languagestringLanguage code for this translation
data.translations[].textstringThe translated quote text
data.createdAtnumberUnix timestamp (milliseconds)

Error Responses

StatusDescription
404Quote not found — the provided ID does not match any approved quote
401Unauthorized — missing or invalid API key

Use Cases

Here are some common patterns for working with the Quotes endpoints:

Quote of the Day

Fetch a random quote and cache it for 24 hours:

async function getQuoteOfTheDay(apiKey) {
  const cacheKey = `qotd-${new Date().toISOString().slice(0, 10)}`
  const cached = cache.get(cacheKey)
  if (cached) return cached

  const response = await fetch(
    'https://quotegallery.nl/api/v1/quotes/random?language=en',
    { headers: { 'X-API-Key': apiKey } }
  )

  const { data: quote } = await response.json()
  cache.set(cacheKey, quote, 86400) // 24h TTL
  return quote
}

Infinite Scroll

Paginate through quotes as the user scrolls:

let offset = 0
const limit = 20

async function loadMore(apiKey) {
  const response = await fetch(
    `https://quotegallery.nl/api/v1/quotes?limit=${limit}&offset=${offset}`,
    { headers: { 'X-API-Key': apiKey } }
  )

  const { data, pagination } = await response.json()
  offset += limit

  return {
    quotes: data,
    hasMore: pagination.hasMore,
  }
}

Filter by Author

Get all quotes from a specific author:

async function getAuthorQuotes(apiKey, authorId) {
  const response = await fetch(
    `https://quotegallery.nl/api/v1/quotes?author_id=${authorId}&limit=100`,
    { headers: { 'X-API-Key': apiKey } }
  )

  const { data } = await response.json()
  return data
}
Copyright © 2026