API Reference

Categories

API reference for the Categories endpoint — retrieve all available categories with quote counts.

Categories organize quotes and authors by topic or theme. The Categories endpoint returns the full list in one call — no pagination needed.

List Categories

GET /api/v1/categories

This endpoint accepts no query parameters.

curl -H "X-API-Key: your_api_key_here" \
  "https://quotegallery.nl/api/v1/categories"
{
  "data": [
    { "id": "wisdom", "name": "Wisdom", "quoteCount": 245 },
    { "id": "philosophy", "name": "Philosophy", "quoteCount": 189 },
    { "id": "life", "name": "Life", "quoteCount": 167 },
    { "id": "inspirational", "name": "Inspirational", "quoteCount": 156 },
    { "id": "success", "name": "Success", "quoteCount": 134 }
  ]
}
FieldTypeDescription
data[].idstringCategory slug, used in filter parameters
data[].namestringHuman-readable display name
data[].quoteCountnumberNumber of approved quotes in this category
StatusDescription
401Missing or invalid API key
The categories list is small and changes infrequently. Cache it for a few hours to avoid burning requests on repeat calls.

Using categories with other endpoints

Category slugs from the id field are what you pass as the categories parameter on Quotes, Authors, and Playlists endpoints. Multiple slugs are comma-separated and match with OR logic.

# Quotes in any of these categories
curl -H "X-API-Key: your_api_key_here" \
  "https://quotegallery.nl/api/v1/quotes?categories=wisdom,philosophy,life"

# Authors associated with technology or science
curl -H "X-API-Key: your_api_key_here" \
  "https://quotegallery.nl/api/v1/authors?categories=technology,science"

# Playlists tagged as inspirational
curl -H "X-API-Key: your_api_key_here" \
  "https://quotegallery.nl/api/v1/playlists?categories=inspirational"

Example: cached category lookup

let cache = null
let expiry = 0

async function getCategories(apiKey) {
  if (cache && Date.now() < expiry) return cache

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

  const { data } = await response.json()
  cache = data
  expiry = Date.now() + 4 * 60 * 60 * 1000 // 4 hours

  return cache
}

async function getCategoryName(apiKey, slug) {
  const categories = await getCategories(apiKey)
  return categories.find((c) => c.id === slug)?.name ?? slug
}
Copyright © 2026