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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
language | string | No | — | Filter by language code (e.g., en, nl, tr) |
categories | string | No | — | Comma-separated list of categories to filter by |
author_id | string | No | — | Filter quotes by a specific author ID |
limit | number | No | 20 | Number of results per page (max 100) |
offset | number | No | 0 | Pagination 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"
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
import 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()
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
| Field | Type | Description |
|---|---|---|
data | array | Array of quote objects |
data[].id | string | Unique identifier for the quote |
data[].text | string | The quote text |
data[].language | string | Language code of the quote |
data[].categories | string[] | List of category slugs the quote belongs to |
data[].likeCount | number | Number of likes the quote has received |
data[].author | object | The quote's author |
data[].author.id | string | Unique identifier for the author |
data[].author.name | string | Author's display name |
data[].createdAt | number | Unix timestamp (milliseconds) when the quote was created |
pagination.total | number | Total number of matching quotes |
pagination.limit | number | Number of results per page |
pagination.offset | number | Current offset |
pagination.hasMore | boolean | Whether more results are available |
Random Quote
Get a random approved quote. Optionally filter by language or categories.
GET /api/v1/quotes/random
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
language | string | No | — | Filter by language code |
categories | string | No | — | Comma-separated list of categories |
Example Request
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}`)
response = requests.get(
'https://quotegallery.nl/api/v1/quotes/random',
headers={'X-API-Key': os.environ['QUOTE_GALLERY_API_KEY']},
params={'language': 'en'}
)
quote = response.json()['data']
print(f'"{quote["text"]}" — {quote["author"]["name"]}')
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
| Field | Type | Description |
|---|---|---|
data | object | A single quote object |
data.id | string | Unique identifier for the quote |
data.text | string | The quote text |
data.language | string | Language code of the quote |
data.categories | string[] | List of category slugs |
data.likeCount | number | Number of likes |
data.author | object | The quote's author |
data.author.id | string | Author's unique identifier |
data.author.name | string | Author's display name |
data.createdAt | number | Unix 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique identifier of the quote |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
language | string | No | — | Preferred 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"
const quoteId = 'abc123'
const response = await fetch(
`https://quotegallery.nl/api/v1/quotes/${quoteId}?language=en`,
{
headers: { 'X-API-Key': process.env.QUOTE_GALLERY_API_KEY },
}
)
const { data: quote } = await response.json()
quote_id = 'abc123'
response = requests.get(
f'https://quotegallery.nl/api/v1/quotes/{quote_id}',
headers={'X-API-Key': os.environ['QUOTE_GALLERY_API_KEY']},
params={'language': 'en'}
)
quote = response.json()['data']
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
| Field | Type | Description |
|---|---|---|
data | object | The quote object |
data.id | string | Unique identifier for the quote |
data.text | string | The quote text (in the requested or default language) |
data.language | string | Language code of the primary text |
data.categories | string[] | List of category slugs |
data.likeCount | number | Number of likes |
data.author | object | The quote's author (extended) |
data.author.id | string | Author's unique identifier |
data.author.name | string | Author's display name |
data.author.imageUrl | string | URL to the author's profile image |
data.translations | array | All available translations of this quote |
data.translations[].language | string | Language code for this translation |
data.translations[].text | string | The translated quote text |
data.createdAt | number | Unix timestamp (milliseconds) |
Error Responses
| Status | Description |
|---|---|
404 | Quote not found — the provided ID does not match any approved quote |
401 | Unauthorized — 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
}