Open Trivia Database website screenshot

Open Trivia Database

The Open Trivia Database (OpenTDB) is a free, user-contributed trivia question database operated by Pixeltail Games LLC. It offers a JSON REST API for retrieving thousands of community-verified trivia questions across 24 categories and three difficulty levels, with optional session tokens to prevent duplicate questions. The service is licensed Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0), is free at the point of use, and enforces a single throttling rule: one request per IP every five seconds.

Open Trivia Database publishes 4 APIs on the APIs.io network, including Categories API, Questions API, Statistics API, and 1 more. Tagged areas include Trivia, Games And Comics, Quiz, Open Data, and Public APIs.

The Open Trivia Database catalog on APIs.io includes 1 JSON-LD context and 2 Spectral governance rulesets.

Open Trivia Database’s developer surface includes documentation, support, tooling, code examples, and 16 more developer resources.

38.8/100 thin ▼ -6.3 Agent 28/100 agent aware Full breakdown ↓
scored 2026-07-28 · rubric v0.6
4 APIs
TriviaGames And ComicsQuizOpen DataPublic APIsOpen Source

Kin Score

Kin Score Kin Score How this is scored →
scored 2026-07-28 · rubric v0.6
Composite quality — 38.8/100 · thin
Contract Quality 15.1 / 25
Developer Ergonomics 5.7 / 20
Commercial Clarity 2.1 / 20
Operational Transparency 2.7 / 13
Governance 7.0 / 12
Discoverability 8.2 / 10
Agent readiness — 28/100 · agent aware
Machine-Readable Contract 18 / 18
Agentic Access Contract 10 / 10
MCP Server 0 / 12
Machine-Readable Auth 0 / 10
Idempotency 0 / 9
Stable Error Semantics 0 / 8
Request/Response Examples 7 / 7
Rate-Limit Signaling 7 / 7
Typed Event Surface 0 / 6
Agent Skills 0 / 5
Well-Known Catalog 0 / 4
Consent & Bot Identity 0 / 3
A2A Agent Card 0 / 8
Dry-Run / Simulate Mode 0 / 4
Improve this rating by publishing the missing artifacts — every area above can be raised, and the full rubric is at apis.io/rating/. This rating is computed from github.com/api-evangelist/open-trivia: open an issue to ask a question, or submit a pull request to add artifacts. Want it done for you? Prioritized profiling — $2,500 →

APIs 4

Individual APIs this provider publishes, each with its own machine-readable definition.

Open Trivia Database Categories API

Operations for discovering trivia category metadata and counts.

Open Trivia Database Questions API

Operations for retrieving trivia questions from the database.

Open Trivia Database Statistics API

Operations for inspecting overall database statistics.

Open Trivia Database Tokens API

Operations for managing session tokens that prevent duplicate questions.

Open Collections 1

Open, tool-agnostic API collections (OpenAPI-derived and Bruno).

Open Trivia Database API

OPEN COLLECTION

Rate Limits 1

Documented rate limits and quota policies.

Open Trivia Rate Limits

1 limits

RATE LIMITS

Semantic Vocabularies 1

JSON-LD contexts and semantic vocabularies used across these APIs.

Open Trivia Context

9 classes · 25 properties

JSON-LD

Spectral Rules 2

Spectral governance rulesets for linting and validating these APIs.

Open Trivia Database API Rules

5 rules · 4 warnings 1 info

SPECTRAL

Open Trivia Database API Rules

36 rules · 12 errors 18 warnings 6 info

SPECTRAL

JSON Schema 9

Standalone JSON Schema definitions for this provider's data models.

CategoryCountResponse

2 properties

JSON SCHEMA

CategoryListResponse

1 properties

JSON SCHEMA

CategoryQuestionCount

4 properties

JSON SCHEMA

Category

2 properties

JSON SCHEMA

GlobalCountResponse

2 properties

JSON SCHEMA

GlobalCounts

4 properties

JSON SCHEMA

QuestionResponse

3 properties

JSON SCHEMA

Question

6 properties

JSON SCHEMA

TokenResponse

3 properties

JSON SCHEMA

Scroll for all 9

JSON Structure 9

JSON Structure definitions describing this provider's data shapes.

Open Trivia Category Structure

2 properties

JSON STRUCTURE

Open Trivia Global Counts Structure

4 properties

JSON STRUCTURE

Open Trivia Question Response Structure

3 properties

JSON STRUCTURE

Open Trivia Question Structure

6 properties

JSON STRUCTURE

Open Trivia Token Response Structure

3 properties

JSON STRUCTURE

Scroll for all 9

Examples 9

Example request and response payloads for these APIs.

Scroll for all 9

Security Posture 1

Authentication, domain security, vulnerability disclosure, and trust-center signals.

Open Trivia Domain Security

TLSv1.3 · HSTS

SECURITY

Agentic Access 1

Recommended x-agentic-access execution contracts for AI agents.

Open Trivia Agentic Access

5 operations

5 operations · 0 acting

AGENTIC

Resources

Documentation 1

Reference material describing how the API behaves

Agent Surfaces 1

MCP servers, agent skills, and machine-readable catalogs

Build 11

SDKs, sample code, and the tooling you integrate with

Scroll for all 11

Access & Security 1

Authentication, authorization, and security posture

Operate 1

Status, limits, changes, and where to get help

Commercial 2

Pricing, plans, and the legal terms of use

Company 1

The organization behind the API

Other 2

Properties that don't map to a standard resource type

Source (apis.yml)

apis.yml Raw ↑
aid: open-trivia
name: Open Trivia Database
description: 'The Open Trivia Database (OpenTDB) is a free, user-contributed trivia question database operated by Pixeltail
  Games LLC. It offers a JSON REST API for retrieving thousands of community-verified trivia questions across 24 categories
  and three difficulty levels, with optional session tokens to prevent duplicate questions. The service is licensed Creative
  Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0), is free at the point of use, and enforces a single throttling
  rule: one request per IP every five seconds.'
url: https://opentdb.com/api_config.php
accessModel:
  pricing: unknown
  onboarding: unknown
  trial: false
  try_now: false
  public: false
  label: Unknown
  confidence: low
  source: []
  generated: '2026-07-22'
  method: derived
image: https://opentdb.com/images/logo-banner.png
humanURL: https://opentdb.com
baseURL: https://opentdb.com
specificationVersion: '0.20'
created: '2026-05-28'
modified: '2026-05-30'
x-source: public-apis/public-apis
x-artifacts:
  openapi: 1
  jsonSchema: 9
  jsonStructure: 9
  jsonLd: 1
  examples: 9
  capabilities: 4
  rules: 1
  vocabulary: 1
  rateLimits: 1
x-category: Games & Comics
x-type: opensource
x-tier: 3
x-tier-reason: Free public service; user-contributed open database with CC BY-SA 4.0 licensing.
x-license: CC-BY-SA-4.0
x-operator: Pixeltail Games LLC
tags:
- Trivia
- Games And Comics
- Quiz
- Open Data
- Public APIs
- Open Source
apis:
- aid: open-trivia:open-trivia-categories-api
  name: Open Trivia Database Categories API
  description: Operations for discovering trivia category metadata and counts.
  humanURL: https://opentdb.com/api_config.php
  baseURL: https://opentdb.com
  tags:
  - Categories
  properties:
  - type: OpenAPI
    url: openapi/open-trivia-categories-api-openapi.yml
  - type: Documentation
    url: https://opentdb.com/api_config.php
  - type: JSONSchema
    url: json-schema/open-trivia-question-schema.json
  - type: JSONSchema
    url: json-schema/open-trivia-category-schema.json
  - type: JSONStructure
    url: json-structure/open-trivia-question-structure.json
  - type: JSONLD
    url: json-ld/open-trivia-context.jsonld
  - type: SpectralRules
    url: rules/open-trivia-rules.yml
  - type: RateLimits
    url: rate-limits/open-trivia-rate-limits.yml
  - type: Vocabulary
    url: vocabulary/open-trivia-vocabulary.yml
  - type: Examples
    url: examples/open-trivia-question-response-example.json
  - type: Signup
    url: https://opentdb.com/api_config.php
  - type: ContributeQuestions
    url: https://opentdb.com/contribute.php
  - type: BrowseQuestions
    url: https://opentdb.com/browse.php
  - type: GameLink
    url: https://opentdb.com/game.php
  - type: Statistics
    url: https://opentdb.com/api_count_global.php
- aid: open-trivia:open-trivia-questions-api
  name: Open Trivia Database Questions API
  description: Operations for retrieving trivia questions from the database.
  humanURL: https://opentdb.com/api_config.php
  baseURL: https://opentdb.com
  tags:
  - Questions
  properties:
  - type: OpenAPI
    url: openapi/open-trivia-questions-api-openapi.yml
  - type: Documentation
    url: https://opentdb.com/api_config.php
  - type: JSONSchema
    url: json-schema/open-trivia-question-schema.json
  - type: JSONSchema
    url: json-schema/open-trivia-category-schema.json
  - type: JSONStructure
    url: json-structure/open-trivia-question-structure.json
  - type: JSONLD
    url: json-ld/open-trivia-context.jsonld
  - type: SpectralRules
    url: rules/open-trivia-rules.yml
  - type: RateLimits
    url: rate-limits/open-trivia-rate-limits.yml
  - type: Vocabulary
    url: vocabulary/open-trivia-vocabulary.yml
  - type: Examples
    url: examples/open-trivia-question-response-example.json
  - type: Signup
    url: https://opentdb.com/api_config.php
  - type: ContributeQuestions
    url: https://opentdb.com/contribute.php
  - type: BrowseQuestions
    url: https://opentdb.com/browse.php
  - type: GameLink
    url: https://opentdb.com/game.php
  - type: Statistics
    url: https://opentdb.com/api_count_global.php
- aid: open-trivia:open-trivia-statistics-api
  name: Open Trivia Database Statistics API
  description: Operations for inspecting overall database statistics.
  humanURL: https://opentdb.com/api_config.php
  baseURL: https://opentdb.com
  tags:
  - Statistics
  properties:
  - type: OpenAPI
    url: openapi/open-trivia-statistics-api-openapi.yml
  - type: Documentation
    url: https://opentdb.com/api_config.php
  - type: JSONSchema
    url: json-schema/open-trivia-question-schema.json
  - type: JSONSchema
    url: json-schema/open-trivia-category-schema.json
  - type: JSONStructure
    url: json-structure/open-trivia-question-structure.json
  - type: JSONLD
    url: json-ld/open-trivia-context.jsonld
  - type: SpectralRules
    url: rules/open-trivia-rules.yml
  - type: RateLimits
    url: rate-limits/open-trivia-rate-limits.yml
  - type: Vocabulary
    url: vocabulary/open-trivia-vocabulary.yml
  - type: Examples
    url: examples/open-trivia-question-response-example.json
  - type: Signup
    url: https://opentdb.com/api_config.php
  - type: ContributeQuestions
    url: https://opentdb.com/contribute.php
  - type: BrowseQuestions
    url: https://opentdb.com/browse.php
  - type: GameLink
    url: https://opentdb.com/game.php
  - type: Statistics
    url: https://opentdb.com/api_count_global.php
- aid: open-trivia:open-trivia-tokens-api
  name: Open Trivia Database Tokens API
  description: Operations for managing session tokens that prevent duplicate questions.
  humanURL: https://opentdb.com/api_config.php
  baseURL: https://opentdb.com
  tags:
  - Tokens
  properties:
  - type: OpenAPI
    url: openapi/open-trivia-tokens-api-openapi.yml
  - type: Documentation
    url: https://opentdb.com/api_config.php
  - type: JSONSchema
    url: json-schema/open-trivia-question-schema.json
  - type: JSONSchema
    url: json-schema/open-trivia-category-schema.json
  - type: JSONStructure
    url: json-structure/open-trivia-question-structure.json
  - type: JSONLD
    url: json-ld/open-trivia-context.jsonld
  - type: SpectralRules
    url: rules/open-trivia-rules.yml
  - type: RateLimits
    url: rate-limits/open-trivia-rate-limits.yml
  - type: Vocabulary
    url: vocabulary/open-trivia-vocabulary.yml
  - type: Examples
    url: examples/open-trivia-question-response-example.json
  - type: Signup
    url: https://opentdb.com/api_config.php
  - type: ContributeQuestions
    url: https://opentdb.com/contribute.php
  - type: BrowseQuestions
    url: https://opentdb.com/browse.php
  - type: GameLink
    url: https://opentdb.com/game.php
  - type: Statistics
    url: https://opentdb.com/api_count_global.php
common:
- type: AgenticAccess
  url: agentic-access/open-trivia-agentic-access.yml
- type: DomainSecurity
  url: security/open-trivia-domain-security.yml
- type: Website
  url: https://opentdb.com
- type: Documentation
  url: https://opentdb.com/api_config.php
- type: Support
  url: https://opentdb.com/contact.php
- type: TermsOfService
  url: https://opentdb.com/terms.php
- type: License
  url: https://creativecommons.org/licenses/by-sa/4.0/
- type: Donate
  url: https://ko-fi.com/pixeltailgames
- type: PublicAPIsListing
  url: https://github.com/public-apis/public-apis
- type: CommunityIntegrations
  title: Community SDKs and Integrations
  url: https://github.com/topics/opentdb
- type: SDKs
  title: Open Trivia DB Wrapper (TypeScript / JavaScript)
  url: https://github.com/Elitezen/open-trivia-db-wrapper
- type: SDKs
  title: Python Trivia API (Python)
  url: https://github.com/MaT1g3R/Python-Trivia-API
- type: SDKs
  title: OpenTDB4j (Java)
  url: https://github.com/crnvl/OpenTDB4j
- type: SDKs
  title: opentdb-api (JavaScript)
  url: https://github.com/blobfysh/opentdb-api
- type: Tools
  title: MCP Server (Community — pipeworx-io)
  url: https://github.com/pipeworx-io/mcp-trivia
- type: Tools
  title: Discord Trivia Bot (Community)
  url: https://github.com/LakeYS/Discord-Trivia-Bot
- type: Tools
  title: OTDB Source Download Script (Community)
  url: https://github.com/QuartzWarrior/OTDB-Source
- type: CodeExamples
  title: Ignite Bowser Trivia App (TypeScript)
  url: https://github.com/robinheinze/ignite-trivia
- type: CodeExamples
  title: React Native Trivia Quiz (JavaScript)
  url: https://github.com/computationalcore/react-native-trivia-quiz
- type: CodeExamples
  title: Vue Quiz App (Vue 3)
  url: https://github.com/supershaneski/vue-quiz-app
maintainers:
- FN: Kin Lane
  email: kin@apievangelist.com