Open Trivia
Trivia Questions
- Authentication
- No auth
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Games & Comics
- Documentation / URL
- https://opentdb.com/api_config.php
Overview
Open Trivia DB is a free, keyless trivia-question API with 4,000+ questions across 24 categories (General Knowledge, Books, Film, Music, Science, Computers, Sports, Geography, History…), three difficulty levels, and both multiple-choice and true/false formats. A favorite for quiz apps, game nights, and chatbot icebreakers.
Verified 2026-08: the API responds normally, but rate limiting is aggressive — a burst of requests returns HTTP 429. Space your calls out (a second or two between requests works).
Quick Start
Get one question:
curl "https://opentdb.com/api.php?amount=1"
Sample response (correct answer included — you decide what to do with it!):
{
"response_code": 0,
"results": [
{
"type": "multiple",
"difficulty": "easy",
"category": "Geography",
"question": "Which Borough is the farthest in the north of New York City?",
"correct_answer": "Bronx",
"incorrect_answers": ["Queens", "Brooklyn", "Manhattan"]
}
]
}
Filter by category / difficulty / type:
curl "https://opentdb.com/api.php?amount=10&category=18&difficulty=medium&type=multiple"
Avoid duplicates across sessions with a session token:
curl "https://opentdb.com/api_token.php?command=request"
curl "https://opentdb.com/api.php?amount=10&token=YOUR_TOKEN"
Categories (subset)
| ID | Category | ID | Category |
|---|---|---|---|
| 9 | General Knowledge | 18 | Science: Computers |
| 10 | Books | 19 | Science: Math |
| 11 | Film | 20 | Mythology |
| 12 | Music | 21 | Sports |
| 15 | Video Games | 22 | Geography |
| 17 | Science & Nature | 27 | Animals |
Authentication
None — keyless. (The session token is optional and only prevents question repeats.)
Rate Limits & Notes
- 429 responses are normal under bursts — throttle your client (a delay between requests).
response_code:0= success,1= no results (e.g. empty token pool),2= invalid parameter,3= token not found,4= token empty (all questions used).- Questions are community-contributed and occasionally contain typos or outdated facts.
- CORS is not guaranteed — call from a server or your own backend for reliability.
FAQ
Is Open Trivia DB free? Yes — free and keyless.
Why do I get HTTP 429? Rate limiting. Space requests out (a second or two apart) and it works fine.
How do I avoid repeated questions?
Request a session token (api_token.php?command=request) and pass it with each call.
More in Games & Comics
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| AmiiboAPI Nintendo Amiibo Information | No auth | Yes | Yes | ↗ |
| Animal Crossing: New Horizons API for critters, fossils, art, music, furniture and villagers | No auth | Yes | Unknown | ↗ |
| Astroworld Free Minecraft data: mobs, biomes, items, enchantments, structures, commands, versions, achievements, trades | No auth | Yes | Yes | ↗ |
| Autochess VNG Rest Api for Autochess VNG | No auth | Yes | Yes | ↗ |
| Barter.VG Provides information about Game, DLC, Bundles, Giveaways, Trading | No auth | Yes | Yes | ↗ |