API Reference
Quotes
API reference for Quote endpoints — list, search, filter, and retrieve quotes.
The Quotes endpoints let you retrieve, search, and filter approved public quotes. All responses wrap data in a data field and include a pagination object on list endpoints.
List Quotes
GET /api/v1/quotes
| Parameter | Type | Default | Description |
|---|---|---|---|
language | string | Filter by language code (en, nl, tr, …) | |
categories | string | Comma-separated category slugs. Matches any (OR logic) | |
author_id | string | Filter by a specific author ID | |
playlist_id | string | Filter by a specific playlist ID | |
limit | number | 20 | Results per page (max 100) |
offset | number | 0 | Pagination offset |
curl -H "X-API-Key: your_api_key_here" \
"https://quotegallery.nl/api/v1/quotes?language=en&categories=wisdom,success&limit=10"
const response = await fetch(
'https://quotegallery.nl/api/v1/quotes?language=en&categories=wisdom,success&limit=10',
{ headers: { 'X-API-Key': process.env.QUOTE_GALLERY_API_KEY } }
)
const { data, pagination } = await response.json()
import requests, os
response = requests.get(
'https://quotegallery.nl/api/v1/quotes',
headers={'X-API-Key': os.environ['QUOTE_GALLERY_API_KEY']},
params={'language': 'en', 'categories': 'wisdom,success', 'limit': 10}
)
data = response.json()
{
"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 }
}
| Field | Type | Description |
|---|---|---|
data[].id | string | Unique quote identifier |
data[].text | string | Quote text |
data[].language | string | Language code |
data[].categories | string[] | Category slugs |
data[].likeCount | number | Number of likes |
data[].author.id | string | Author identifier |
data[].author.name | string | Author display name |
data[].createdAt | number | Unix timestamp (ms) |
pagination.total | number | Total matching quotes |
pagination.hasMore | boolean | Whether more pages exist |
Random Quote
Returns a single random approved quote. Useful for quote-of-the-day features and loading screens.
GET /api/v1/quotes/random
| Parameter | Type | Description |
|---|---|---|
language | string | Filter by language code |
categories | string | Comma-separated category slugs |
curl -H "X-API-Key: your_api_key_here" \
"https://quotegallery.nl/api/v1/quotes/random?language=en"
const response = await fetch(
'https://quotegallery.nl/api/v1/quotes/random?language=en',
{ headers: { 'X-API-Key': process.env.QUOTE_GALLERY_API_KEY } }
)
const { data: quote } = await response.json()
console.log(`"${quote.text}" — ${quote.author.name}`)
{
"data": {
"id": "abc123",
"text": "Stay hungry, stay foolish.",
"language": "en",
"categories": ["inspirational"],
"likeCount": 128,
"author": { "id": "xyz789", "name": "Steve Jobs" },
"createdAt": 1704067200000
}
}
Get Quote by ID
Returns a single quote with full detail, including all available translations.
GET /api/v1/quotes/:id
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for the primary text field |
curl -H "X-API-Key: your_api_key_here" \
"https://quotegallery.nl/api/v1/quotes/abc123?language=en"
const response = await fetch(
`https://quotegallery.nl/api/v1/quotes/abc123?language=en`,
{ headers: { 'X-API-Key': process.env.QUOTE_GALLERY_API_KEY } }
)
const { data: quote } = await response.json()
{
"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." }
],
"createdAt": 1704067200000
}
}
The translations array contains all available language versions of the quote. The top-level text field reflects the language requested via the language param, or the default language if omitted.
| Status | Description |
|---|---|
404 | Quote ID not found or not publicly approved |
401 | Missing or invalid API key |
Examples
Quote of the day with caching
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)
return quote
}
All quotes from a playlist
async function getPlaylistQuotes(apiKey, playlistId) {
const response = await fetch(
`https://quotegallery.nl/api/v1/quotes?playlist_id=${playlistId}&limit=100`,
{ headers: { 'X-API-Key': apiKey } }
)
const { data } = await response.json()
return data
}