Open Trivia DB at https://opentdb.com is a free, user-contributed trivia database. Question text is HTML-encoded unless you ask for another encode.
None — no key, no signup. Every example runs as-is.
Full reference: https://opentdb.com/api_config.php
response_code 0 means success.
curl "https://opentdb.com/api.php?amount=2&type=multiple"
{
"response_code": 0,
"results": [
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
"question": "All of the following programs are classified as raster graphics editors EXCEPT:",
"correct_answer": "Inkscape",
"incorrect_answers": [
"Paint.NET",
"GIMP"
]
},
{
"type": "multiple",
"difficulty": "medium",
"category": "Entertainment: Video Games",
"question": "Which town was Seamus "Sledge" Cowden from "Tom Clancy's Rainbow Six Siege" born in?",
"correct_answer": "John O'Groats",
"incorrect_answers": [
"Brawl",
"Kearvaig"
]
}
]
}
Use a category's id as category=.
curl https://opentdb.com/api_category.php
{
"trivia_categories": [
{
"id": 9,
"name": "General Knowledge"
},
{
"id": 10,
"name": "Entertainment: Books"
}
]
}