Filtering

Filter quotes by category, language, and author

Filtering Options

The API supports various filtering options to help you find specific quotes.

Categories

Filter quotes by category using the category parameter.

Available Categories

CategoryDescription
historicalHistorical figures and leaders
contemporaryModern era personalities
fictionalFictional characters
philosophicalPhilosophers and thinkers
scientificScientists and researchers
literaryAuthors and poets
politicalPolitical figures
religiousReligious leaders
businessBusiness leaders and entrepreneurs
entertainmentActors, musicians, artists
sportsAthletes and sports figures
otherOther categories

Example

# Get philosophical quotes
curl "https://quotegallery.nl/api/quotes?category=philosophical&limit=5"

# Get scientific quotes in English
curl "https://quotegallery.nl/api/quotes?category=scientific&language=en"

Languages

Filter quotes by language using the language parameter.

curl "https://quotegallery.nl/api/quotes?language=en"
If a quote doesn't have a translation in the requested language, it won't be included in the results.

Author Filtering

Filter quotes by a specific author using author_id.

# First, find the author (via search)
curl "https://quotegallery.nl/api/v1/search?q=Einstein"

# Then filter by author_id
curl "https://quotegallery.nl/api/quotes?author_id=550e8400-e29b-41d4-a716-446655440000"

Combining Filters

You can combine multiple filters:

curl "https://quotegallery.nl/api/quotes?category=philosophical&language=en&limit=10&random=true"

Sorting (V1 API)

The V1 API supports additional sorting options:

# Most liked quotes
curl "https://quotegallery.nl/api/v1/quotes?sort=most_liked&limit=10"

# Oldest quotes first
curl "https://quotegallery.nl/api/v1/quotes?sort=oldest&order=asc"

# Random order
curl "https://quotegallery.nl/api/v1/quotes?sort=random"

Sort Options

ValueDescription
newestMost recent first (default)
oldestOldest first
most_likedHighest like count first
least_likedLowest like count first
randomRandomized order
author_nameAlphabetically by author

Excluding Quotes

The V1 API allows excluding specific quotes (useful for avoiding duplicates):

curl "https://quotegallery.nl/api/v1/quotes?exclude_ids=uuid1,uuid2,uuid3"

This is useful for implementing "infinite scroll" or "load more" features without showing duplicates.