Build trivia games
in hours, not months
A simple, powerful API for trivia questions. Filter by category, difficulty, and language. Professional translations included.
One API call.
Instant trivia.
Get random questions filtered by category, difficulty, and more. Most questions are multiple choice with the correct answer and three plausible incorrect options. Other question types are available when you upgrade to a Complete subscription.
- 10 categories including Science, History, Geography
- 3 difficulty levels: easy, medium, hard
- Professional translations in 5 languages
const response = await fetch(
'https://the-trivia-api.com/v2/questions',
{
headers: {
'x-api-key': 'your-api-key'
}
}
);
const questions = await response.json();
// Returns 10 random trivia questionsTry a sample question
Our most common format: multiple choice
What is the chemical symbol for gold?
Reach global audiences
with professional translations
Every question comes professionally translated in multiple languages, making it easy to launch your trivia game worldwide.
Available with Complete subscription- Spanish, French, German, Dutch, Turkish, Hindi
- Culturally appropriate translations
- Consistent terminology across questions
question.text
¿A qué movimiento artÃstico pertenece la pintura 'Gótico americano' de Grant Wood?
The only trivia API with image questions
Stand out from generic text-based quizzes with visual questions that keep players engaged.
Available with Complete subscriptionIdentify Celebrities
Actors, musicians, athletes, and historical figures
Recognize Landmarks
Famous buildings, monuments, and tourist attractions
Name the Item
Flags, food, animals, instruments, and more
Which of these actresses is Sharon Stone?
AI-powered answer validation
Text input questions use intelligent AI validation to accept correct answers even with different phrasing or typos—just like a real quiz master.
Available with Complete subscriptionWhich planet has the most moons?
- Accepts semantically equivalent answers
- Tolerates spelling mistakes and typos
- Handles different formats and phrasing
- Works across languages
No repeat questions
with session tokens
Create a session for each player and the API will automatically track which questions they've seen. No duplicate questions, ever.
- Sessions persist across requests
- Automatic deduplication
- Reset sessions anytime
Create a session
POST /v2/session→ session_abc123Request questions
GET /v2/questions?session=abc123First request → Questions 1-10
Second request → Questions 11-20
✓ Never the same question twice
// Create a quiz with fixed questions
const quiz = await createQuiz({
name: 'Friday Trivia',
categories: ['science'],
limit: 10
});
// Everyone gets the same questions
// Perfect for competitions!
const questions =
await getQuiz(quiz.id);Same questions,
every player
Create a quiz once and share it with unlimited players. Everyone gets the exact same questions in the same order - perfect for competitions, pub quizzes, and leaderboards.
- Consistent questions across all players
- Ideal for live events and competitions
- Easy leaderboard implementation
Semantic Search
find questions by meaning
Let players search for questions using natural language. Semantic search understands intent and returns relevant questions even when the exact keywords don't match.
- Find questions by meaning, not keywords
- Handles synonyms and different phrasing
- Topic-random questions via
GET /v2/questions?query=...
Powered by embeddings + vector search.
// Search questions by meaning
const res = await fetch(
'https://the-trivia-api.com/v2/questions/search',
{
method: 'POST',
headers: {
'content-type': 'application/json',
'x-api-key': 'your-api-key'
},
body: JSON.stringify({
mode: 'semantic',
query: 'greek mythology'
}),
}
);
// Topic-random questions about a query
const topicRes = await fetch(
'https://the-trivia-api.com/v2/questions?query=greek%20mythology&limit=10',
{
headers: {
'x-api-key': 'your-api-key'
}
}
);
Frequently Asked Questions
Everything you need to know about The Trivia API
The Trivia API is a comprehensive API that provides high-quality quiz questions across a wide range of categories. It's designed to help developers build engaging quiz applications without the hassle of managing a large question database.
The API is under active development with new questions and features being added regularly!
Subscriptions unlock commercial access and premium features.
Value subscriptions give you commercial access to the API.
Regular and Complete subscriptions also include advanced features like:
- Session management to prevent duplicate questions for users
- Semantic search (find questions by meaning)
- Visual image questions for enhanced engagement
- Professional translations in multiple languages (French, Hindi, Spanish, Dutch, Turkish, and German)
- Text input questions with intelligent answer validation
- Shared quizzes so multiple users can answer the same questions
See pricing for the full breakdown of what's included in each plan.
Getting started is simple! Just send a GET request to https://the-trivia-api.com/v2/questions and you'll receive 10 random trivia questions with their answers.
You can filter questions using URL parameters:
categories- Filter by topic (Science, History, Geography, etc.)difficulties- Choose easy, medium, or hardlimit- Control how many questions to receive
Check out our comprehensive documentation for the full API reference and examples.
The API is free for non-commercial use under a Creative Commons Attribution-NonCommercial 4.0 International License. This means you can use it freely for personal projects, education, and non-profit applications.
If you're building a commercial application or want access to premium features like image questions, translations, and text input questions, you'll need a paid subscription. We offer flexible plans to suit different needs:
- Starter - Perfect for small commercial projects
- Complete - Includes all premium features like images and translations
- Enterprise - Custom solutions for high-volume applications
View our pricing page for detailed information about each plan.
We're not just another trivia API - we offer features you won't find anywhere else:
- Image questions - The only trivia API with visual questions. Players can identify celebrities, landmarks, flags, and more
- AI-powered validation - Our text input questions use intelligent AI to accept correct answers even with different phrasing or typos
- Professional translations - Reach global audiences with questions translated by professionals in 6+ languages
- Active development - We're constantly adding new questions, categories, and features based on community feedback
- Developer-friendly - Clean API design, comprehensive docs, and responsive support
Plus, our free tier is genuinely useful - no credit card required, no sneaky limitations. Start building today!
Ready to build something fun?
Start building with our free, public API. No account required.