{"openapi":"3.1.0","info":{"title":"Open Trivia Database API","version":"1.0.0","description":"Trivia questions via the open Open Trivia Database (OpenTDB) — no key. The questions endpoint returns multiple-choice and true/false questions filtered by category, difficulty (easy, medium, hard) and type, each with the question text, the correct answer and the incorrect options; answers are decoded server-side to clean text. The categories endpoint lists all 24 trivia categories with their ids, and count returns a category's question-count breakdown by difficulty. A random endpoint pulls a single question with the same filters. Real trivia data straight from OpenTDB, fetched fresh — no key. 5 endpoints. Ideal for quiz and trivia games, pub-quiz generators, icebreakers, study apps and chatbot mini-games.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/opentdb-api","description":"oanor gateway"}],"tags":[{"name":"Trivia"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/categories":{"get":{"operationId":"get_v1_categories","tags":["Trivia"],"summary":"All trivia categories","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":24,"categories":[{"id":9,"name":"General Knowledge"},{"id":10,"name":"Entertainment: Books"},{"id":11,"name":"Entertainment: Film"},{"id":12,"name":"Entertainment: Music"},{"id":13,"name":"Entertainment: Musicals & Theatres"},{"id":14,"name":"Entertainment: Television"},{"id":15,"name":"Entertainment: Video Games"},{"id":16,"name":"Entertainment: Board Games"},{"id":17,"name":"Science & Nature"},{"id":18,"name":"Science: Computers"},{"id":19,"name":"Science: Mathematics"},{"id":20,"name":"Mythology"},{"id":21,"name":"Sports"},{"id":22,"name":"Geography"},{"id":23,"name":"History"},{"id":24,"name":"Politics"},{"id":25,"name":"Art"},{"id":26,"name":"Celebrities"},{"id":27,"name":"Animals"},{"id":28,"name":"Vehicles"},{"id":29,"name":"Entertainment: Comics"},{"id":30,"name":"Science: Gadgets"},{"id":31,"name":"Entertainment: Japanese Anime & Manga"},{"id":32,"name":"Entertainment: Cartoon & Animations"}]},"meta":{"timestamp":"2026-06-08T09:48:48.310Z","request_id":"051ff1f1-0dda-4353-9601-47241ff5712a"},"status":"ok","message":"Categories retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/count":{"get":{"operationId":"get_v1_count","tags":["Trivia"],"summary":"Question counts for a category","description":"","parameters":[{"name":"category","in":"query","required":true,"description":"Category id","schema":{"type":"string"},"example":"9"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"easy":215,"hard":77,"total":469,"medium":177,"category_id":9},"meta":{"timestamp":"2026-06-08T09:48:48.877Z","request_id":"921ce4c2-89a2-4468-91ed-64f95e0ff3f4"},"status":"ok","message":"Count retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/questions":{"get":{"operationId":"get_v1_questions","tags":["Trivia"],"summary":"Trivia questions","description":"","parameters":[{"name":"amount","in":"query","required":false,"description":"Number of questions (1-50, default 10)","schema":{"type":"string"},"example":"10"},{"name":"category","in":"query","required":false,"description":"Category id (see /v1/categories)","schema":{"type":"string"},"example":"9"},{"name":"difficulty","in":"query","required":false,"description":"easy, medium or hard","schema":{"type":"string"},"example":"easy"},{"name":"type","in":"query","required":false,"description":"multiple or boolean","schema":{"type":"string"},"example":"multiple"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":10,"questions":[{"type":"multiple","category":"General Knowledge","question":"In \"Katamari Damacy\", you control a character known as:","difficulty":"easy","correct_answer":"The Prince","incorrect_answers":["Fujio","Ichigo ","Foomin"]},{"type":"multiple","category":"General Knowledge","question":"In DC comics where does the Green Arrow (Oliver Queen) live?","difficulty":"easy","correct_answer":"Star City","incorrect_answers":["Central City","Gotham City","Metropolis"]},{"type":"multiple","category":"General Knowledge","question":"When one is \"envious\", they are said to be what color?","difficulty":"easy","correct_answer":"Green","incorrect_answers":["Red","Blue","Yellow"]},{"type":"multiple","category":"General Knowledge","question":"Who was the 1st President of Mexico?","difficulty":"easy","correct_answer":"Guadalupe Victoria","incorrect_answers":["Benito Juárez","Miguel Hidalgo Y Costilla","Vicente Guerrero"]},{"type":"multiple","category":"General Knowledge","question":"According to the Book of Genesis in the Old Testament, how many days did it take God to create the world?","difficulty":"easy","correct_answer":"Six","incorrect_answers":["Seven","One","Twelve"]},{"type":"multiple","category":"General Knowledge","question":"How many letters are there in the English alphabet?","difficulty":"easy","correct_answer":"26","incorrect_answers":["28","23","24"]},{"type":"multiple","category":"General Knowledge","question":"What is the official language of Brazil?","difficulty":"easy","correct_answer":"Portuguese","incorrect_answers":["Brazilian","Spanish","English"]},{"type":"multiple","category":"General Knowledge","question":"What is the nickname of the US state of California?","difficulty":"easy","correct_answer":"Golden State","incorrect_answers":["Sunshine State","Bay State","Treasure State"]},{"type":"multiple","category":"General Knowledge","question":"How many syllables make up a haiku?","difficulty":"easy","correct_answer":"17","incorrect_answers":["15","10","21"]},{"type":"multiple","category":"General Knowledge","question":"Which country, not including Japan, has the most people of Japanese descent?","difficulty":"easy","correct_answer":"Brazil","incorrect_answers":["China","South Korea","United States of America"]}]},"meta":{"timestamp":"2026-06-08T09:48:49.102Z","request_id":"9a4e4cb6-2109-40e3-baf2-413e22468d73"},"status":"ok","message":"Questions retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/random":{"get":{"operationId":"get_v1_random","tags":["Trivia"],"summary":"A single random question","description":"","parameters":[{"name":"category","in":"query","required":false,"description":"Category id","schema":{"type":"string"},"example":"9"},{"name":"difficulty","in":"query","required":false,"description":"easy, medium or hard","schema":{"type":"string"}},{"name":"type","in":"query","required":false,"description":"multiple or boolean","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"question":{"type":"boolean","category":"General Knowledge","question":"Slovakia is a member of European Union-","difficulty":"easy","correct_answer":"True","incorrect_answers":["False"]}},"meta":{"timestamp":"2026-06-08T09:48:50.292Z","request_id":"a4a0dca8-a139-40ac-9030-55ffb31d21ee"},"status":"ok","message":"Random question retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"service":"opentdb-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/count":"Question-count breakdown for a category (category=<id>).","GET /v1/random":"A single random question (same filters as /questions).","GET /v1/questions":"Trivia questions (amount=1-50, category=<id>, difficulty=easy|medium|hard, type=multiple|boolean).","GET /v1/categories":"All 24 trivia categories with ids."},"description":"Trivia questions via the open Open Trivia Database (OpenTDB): fetch multiple-choice and true/false questions filtered by category, difficulty and type; list the 24 categories; read a category's question-count breakdown; or pull a single random question. Answers are decoded to clean text. Real trivia data, no key."},"meta":{"timestamp":"2026-06-08T09:48:50.402Z","request_id":"94872fd4-5e38-4e3a-97f9-092640f8614c"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":6400,"rps_limit":2,"hard_limit":true},{"slug":"basic","name":"Basic","price_cents_month":750,"monthly_call_quota":85500,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2600,"monthly_call_quota":548500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7900,"monthly_call_quota":2690000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/opentdb-api"}