Api
Authors
API reference for Author endpoints — list, search, and retrieve authors with their metadata and quotes.
Authors
The Authors endpoints allow you to browse, search, and retrieve author profiles from the Quote Gallery catalog. Authors include rich metadata such as nationality, birth/death years, categories, and associated quotes.
List Authors
Retrieve a paginated list of approved authors.
GET /api/v1/authors
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
search | string | No | — | Search authors by name (case-insensitive partial match) |
categories | string | No | — | Comma-separated list of categories to filter by |
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/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
import 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()
Example Response
{
"data": [
{
"id": "xyz789",
"name": "Steve Jobs",
"description": "Co-founder of Apple Inc.",
"imageUrl": "https://...",
"nationality": "American",
"birthYear": 1955,
"deathYear": 2011,
"categories": ["technology", "leadership"],
"likeCount": 256,
"quoteCount": 45
}
],
"pagination": {
"total": 80,
"limit": 5,
"offset": 0,
"hasMore": true
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
data | array | Array of author objects |
data[].id | string | Unique identifier for the author |
data[].name | string | Author's display name |
data[].description | string | Short biography or description of the author |
data[].imageUrl | string | null | URL to the author's profile image, or null if not available |
data[].nationality | string | null | Author's nationality |
data[].birthYear | number | null | Author's birth year |
data[].deathYear | number | null | Author's death year, or null if still alive |
data[].categories | string[] | List of category slugs associated with the author |
data[].likeCount | number | Total number of likes across all the author's quotes |
data[].quoteCount | number | Number of approved quotes by this author |
pagination.total | number | Total number of matching authors |
pagination.limit | number | Number of results per page |
pagination.offset | number | Current offset |
pagination.hasMore | boolean | Whether more results are available |
Get Author by ID
Retrieve a single author by their unique identifier. Optionally include the author's quotes in the response.
GET /api/v1/authors/:id
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique identifier of the author |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
include_quotes | boolean | No | false | When true, includes the author's quotes in the response |
language | string | No | — | Preferred language for the quote texts (only applies when include_quotes=true) |
Example Request
# Get author without quotes
curl -H "X-API-Key: your_api_key_here" \
"https://quotegallery.nl/api/v1/authors/xyz789"
# Get author with quotes in English
curl -H "X-API-Key: your_api_key_here" \
"https://quotegallery.nl/api/v1/authors/xyz789?include_quotes=true&language=en"
const authorId = 'xyz789'
// Get author with quotes
const response = await fetch(
`https://quotegallery.nl/api/v1/authors/${authorId}?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((quote) => {
console.log(` "${quote.text}"`)
})
author_id = 'xyz789'
response = requests.get(
f'https://quotegallery.nl/api/v1/authors/{author_id}',
headers={'X-API-Key': os.environ['QUOTE_GALLERY_API_KEY']},
params={
'include_quotes': 'true',
'language': 'en',
}
)
author = response.json()['data']
print(f'{author["name"]} — {author["quoteCount"]} quotes')
for quote in author.get('quotes', []):
print(f' "{quote["text"]}"')
Example Response
{
"data": {
"id": "xyz789",
"name": "Steve Jobs",
"description": "Co-founder of Apple Inc.",
"imageUrl": "https://...",
"nationality": "American",
"birthYear": 1955,
"deathYear": 2011,
"categories": ["technology", "leadership"],
"likeCount": 256,
"quoteCount": 45,
"quotes": [
{
"id": "abc123",
"text": "Stay hungry, stay foolish.",
"language": "en",
"categories": ["inspirational"],
"likeCount": 128
}
]
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
data | object | The author object |
data.id | string | Unique identifier for the author |
data.name | string | Author's display name |
data.description | string | Short biography or description |
data.imageUrl | string | null | URL to the author's profile image |
data.nationality | string | null | Author's nationality |
data.birthYear | number | null | Author's birth year |
data.deathYear | number | null | Author's death year, or null if still alive |
data.categories | string[] | List of category slugs |
data.likeCount | number | Total likes across all quotes |
data.quoteCount | number | Number of approved quotes |
data.quotes | array | undefined | Author's quotes (only present when include_quotes=true) |
data.quotes[].id | string | Quote's unique identifier |
data.quotes[].text | string | The quote text |
data.quotes[].language | string | Language code of the quote text |
data.quotes[].categories | string[] | Categories the quote belongs to |
data.quotes[].likeCount | number | Number of likes on the quote |
Error Responses
| Status | Description |
|---|---|
404 | Author not found — the provided ID does not match any approved author |
401 | Unauthorized — missing or invalid API key |
Use Cases
Here are some common patterns for working with the Authors endpoints:
Author Search Autocomplete
Build a search-as-you-type experience for finding authors:
async function searchAuthors(apiKey, query) {
if (!query || 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((author) => ({
id: author.id,
name: author.name,
nationality: author.nationality,
quoteCount: author.quoteCount,
}))
}
Author Profile with Quotes
Display a full author profile page with their quotes:
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.ok) {
if (response.status === 404) {
throw new Error('Author not found')
}
throw new Error(`API error: ${response.status}`)
}
const { data: author } = await response.json()
return author
}
Browse Authors by Category
List all authors associated with a specific category:
async function getAuthorsByCategory(apiKey, category) {
const authors = []
let offset = 0
const limit = 100
while (true) {
const response = await fetch(
`https://quotegallery.nl/api/v1/authors?categories=${category}&limit=${limit}&offset=${offset}`,
{ headers: { 'X-API-Key': apiKey } }
)
const { data, pagination } = await response.json()
authors.push(...data)
if (!pagination.hasMore) break
offset += limit
}
return authors
}
Author Statistics Dashboard
Aggregate author data for analytics:
import requests
import os
api_key = os.environ['QUOTE_GALLERY_API_KEY']
headers = {'X-API-Key': api_key}
# Fetch all authors
authors = []
offset = 0
while True:
response = requests.get(
'https://quotegallery.nl/api/v1/authors',
headers=headers,
params={'limit': 100, 'offset': offset}
)
data = response.json()
authors.extend(data['data'])
if not data['pagination']['hasMore']:
break
offset += 100
# Calculate statistics
total_quotes = sum(a['quoteCount'] for a in authors)
total_likes = sum(a['likeCount'] for a in authors)
top_authors = sorted(authors, key=lambda a: a['likeCount'], reverse=True)[:10]
print(f'Total authors: {len(authors)}')
print(f'Total quotes: {total_quotes}')
print(f'Total likes: {total_likes}')
print(f'\nTop 10 authors by likes:')
for i, author in enumerate(top_authors, 1):
print(f' {i}. {author["name"]} — {author["likeCount"]} likes, {author["quoteCount"]} quotes')