Open Trivia DB — Get Questions
opentdb.trivia.questionsFetch random trivia questions filtered by category, difficulty, and type to build quizzes; returns up to 50 questions with shuffled answers and decoded HTML.
Instructions
Fetch random trivia questions from the Open Trivia Database. Returns up to 50 questions per call with category, difficulty, correct answer, incorrect answers, and a shuffled all_answers list for quiz presentation. HTML entities are decoded automatically. Filter by category (use opentdb.trivia.categories to get IDs), difficulty (easy/medium/hard), and type (multiple-choice or True/False). Examples: 10 general knowledge questions (no params), 5 hard science questions (category=17, amount=5, difficulty=hard), True/False history questions (category=23, type=boolean). Source: opentdb.com — CC BY-SA 4.0, user-contributed, 5000+ verified questions, 24 categories, free unlimited.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Question type: multiple (4 choices) or boolean (True/False). Omit for both types. | |
| amount | No | Number of trivia questions to return (default 10, max 50). | |
| category | No | Category ID to filter by (e.g. 9=General Knowledge, 17=Science & Nature, 21=Sports, 23=History). Use opentdb.trivia.categories to list all 24 IDs. | |
| difficulty | No | Difficulty filter: easy, medium, or hard. Omit for mixed difficulty. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present only when the call failed. Includes error code, message, request_id, and any provider-specific extras. | |
| result | No | Tool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response. |