API Reference
Authors
API reference for Author endpoints — list, search, and retrieve authors with their metadata and quotes.
The Authors endpoints let you browse and search author profiles. Each author includes metadata like nationality, birth and death years, category associations, and quote counts.
List Authors
GET /api/v1/authors
| Parameter | Type | Default | Description |
|---|---|---|---|
search | string | Case-insensitive partial name match | |
categories | string | Comma-separated category slugs. Matches any (OR logic) | |
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/authors?search=einstein&limit=5"
const response = await fetch(
'https://quotegallery.nl/api/v1/authors?search=einstein&limit=5',
{ 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/authors',
headers={'X-API-Key': os.environ['QUOTE_GALLERY_API_KEY']},
params={'search': 'einstein', 'limit': 5}
)
data = response.json()
{
"data": [
{
"id": "xyz789",
"name": "Albert Einstein",
"description": "Theoretical physicist, developer of the theory of relativity.",
"imageUrl": "https://...",
"nationality": "German",
"birthYear": 1879,
"deathYear": 1955,
"categories": ["science", "philosophy"],
"likeCount": 512,
"quoteCount": 38
}
],
"pagination": { "total": 2, "limit": 5, "offset": 0, "hasMore": false }
}
| Field | Type | Description |
|---|---|---|
data[].id | string | Unique author identifier |
data[].name | string | Display name |
data[].description | string | Short biography |
data[].imageUrl | string | null | Profile image URL |
data[].nationality | string | null | Nationality |
data[].birthYear | number | null | Birth year |
data[].deathYear | number | null | Death year, or null if still alive |
data[].categories | string[] | Category slugs |
data[].likeCount | number | Total likes across all quotes |
data[].quoteCount | number | Number of approved quotes |
Get Author by ID
Returns a single author. Pass include_quotes=true to embed their quotes in the response.
GET /api/v1/authors/:id
| Parameter | Type | Default | Description |
|---|---|---|---|
include_quotes | boolean | false | Embed the author's quotes in the response |
language | string | Preferred language for quote texts (applies when include_quotes=true) |
curl -H "X-API-Key: your_api_key_here" \
"https://quotegallery.nl/api/v1/authors/xyz789?include_quotes=true&language=en"
const response = await fetch(
`https://quotegallery.nl/api/v1/authors/xyz789?include_quotes=true&language=en`,
{ headers: { 'X-API-Key': process.env.QUOTE_GALLERY_API_KEY } }
)
const { data: author } = await response.json()
console.log(`${author.name} — ${author.quoteCount} quotes`)
author.quotes?.forEach((q) => console.log(` "${q.text}"`))
import requests, os
response = requests.get(
'https://quotegallery.nl/api/v1/authors/xyz789',
headers={'X-API-Key': os.environ['QUOTE_GALLERY_API_KEY']},
params={'include_quotes': 'true', 'language': 'en'}
)
author = response.json()['data']
{
"data": {
"id": "xyz789",
"name": "Albert Einstein",
"description": "Theoretical physicist, developer of the theory of relativity.",
"imageUrl": "https://...",
"nationality": "German",
"birthYear": 1879,
"deathYear": 1955,
"categories": ["science", "philosophy"],
"likeCount": 512,
"quoteCount": 38,
"quotes": [
{
"id": "abc123",
"text": "Imagination is more important than knowledge.",
"language": "en",
"categories": ["science", "wisdom"],
"likeCount": 89
}
]
}
}
The quotes field is only present when include_quotes=true. Each quote object includes id, text, language, categories, and likeCount.
| Status | Description |
|---|---|
404 | Author ID not found or not publicly approved |
401 | Missing or invalid API key |
Examples
Author profile page
async function getAuthorProfile(apiKey, authorId) {
const response = await fetch(
`https://quotegallery.nl/api/v1/authors/${authorId}?include_quotes=true&language=en`,
{ headers: { 'X-API-Key': apiKey } }
)
if (response.status === 404) throw new Error('Author not found')
if (!response.ok) throw new Error(`API error ${response.status}`)
const { data: author } = await response.json()
return author
}
Search-as-you-type autocomplete
async function searchAuthors(apiKey, query) {
if (query.length < 2) return []
const response = await fetch(
`https://quotegallery.nl/api/v1/authors?search=${encodeURIComponent(query)}&limit=10`,
{ headers: { 'X-API-Key': apiKey } }
)
const { data } = await response.json()
return data.map((a) => ({ id: a.id, name: a.name, quoteCount: a.quoteCount }))
}