12,802 vetted questions

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
request.js
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 questions

Try a sample question

Our most common format: multiple choice

ScienceMediumText 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
arts and literature🇪🇸 Spanish

question.text

¿A qué movimiento artístico pertenece la pintura 'Gótico americano' de Grant Wood?

Modernismo
Puntillismo
Primitivismo
Ukiyo-e

The only trivia API with image questions

Stand out from generic text-based quizzes with visual questions that keep players engaged.

Available with Complete subscription

Identify Celebrities

Actors, musicians, athletes, and historical figures

Recognize Landmarks

Famous buildings, monuments, and tourist attractions

Name the Item

Flags, food, animals, instruments, and more

film and tvhardImage

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 subscription
scienceText Input

Which planet has the most moons?

  • Accepts semantically equivalent answers
  • Tolerates spelling mistakes and typos
  • Handles different formats and phrasing
  • Works across languages
Available with regular and complete subscriptions

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
1

Create a session

POST /v2/session
→ session_abc123
2

Request questions

GET /v2/questions?session=abc123

First request → Questions 1-10

Second request → Questions 11-20

✓ Never the same question twice

quiz.js
// 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);
Available with any subscription

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
Available with Complete subscription

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.

semantic-search.js
// 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

Ready to build something fun?

Start building with our free, public API. No account required.

License

Information about the Creative Commons license for The Trivia API.

The API and all data returned from it are licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Creative Commons License

This means that the API and the questions it returns are free for noncommercial use. If you have somewhere suitable in your app, then please credit the API somewhere discreet — we love having our hard work shared!

If you would like to use the API commercially, or would like enhanced functionality, this service is offered through a paid subscription.

Sign in

Sign in to access your API key and manage your account.

or continue with email