Open Trivia Database Questions Scraper
Pricing
from $2.08 / 1,000 item extracteds
Open Trivia Database Questions Scraper
Export decoded Open Trivia Database questions with correct answers, distractors, filters, source status, and retrieval metadata for quiz and content workflows.
Pricing
from $2.08 / 1,000 item extracteds
Rating
0.0
(0)
Developer
Stas Persiianenko
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
20 hours ago
Last modified
Categories
Share
Export decoded open trivia database questions for quizzes, games, education tools, and recurring content pipelines.
Choose an amount, category, difficulty, and question type. The Actor calls the official OpenTDB JSON API, decodes every question and answer, and writes integration-ready records to the default Apify dataset.
No OpenTDB account, API key, browser, or proxy is required.
What does this Open Trivia Database questions scraper do?
The Actor turns an OpenTDB request into clean dataset rows.
It can:
- request 1–50 questions per run;
- filter by OpenTDB category ID;
- filter by easy, medium, or hard difficulty;
- choose multiple-choice or true/false questions;
- decode question text and answers safely;
- preserve correct answers and distractors separately;
- provide a combined answer array;
- optionally shuffle the combined answer array;
- attach source status and retrieval metadata;
- export as JSON, CSV, Excel, XML, or RSS through Apify.
Who is it for?
Quiz and game developers
Populate a prototype, game round, or test environment without writing OpenTDB request and decoding code.
Educators
Create categorized question sets and then review or adapt them for a lesson.
Content teams
Schedule recurring exports for a question-bank ingestion workflow.
Data engineers
Receive stable camelCase fields and request provenance in the default dataset.
Why use this Actor?
OpenTDB already exposes a public API. This Actor adds the operational layer needed in an Apify workflow:
- validated visual input;
- base64 decoding;
- normalized fields;
- structured retrieval metadata;
- dataset exports;
- schedules, webhooks, integrations, and API access;
- bounded retry handling for transient source failures;
- pay-per-result billing.
It intentionally stays close to the source rather than inventing unsupported enrichment.
What data can you extract?
| Field | Description |
|---|---|
question | Decoded question text |
correctAnswer | Decoded correct answer |
incorrectAnswers | Decoded distractor answers |
answers | Correct answer and distractors, optionally shuffled |
category | Category name returned by OpenTDB |
categoryId | Requested category ID, or null without a category filter |
difficulty | easy, medium, or hard |
type | multiple or boolean |
sourceStatus | Normalized source response status |
sourceResponseCode | OpenTDB numeric response code |
sourceUrl | Exact API URL used for retrieval |
retrievedAt | UTC retrieval timestamp |
request | Normalized amount and filters |
How to get started
- Open the Actor in Apify Console.
- Set the number of questions from 1 to 50.
- Optionally choose a category ID, difficulty, and type.
- Choose whether the combined
answersarray should be shuffled. - Click Start.
- Open the Dataset tab when the run finishes.
- Download the data or connect it to another workflow.
A useful first run is:
{"amount": 10,"category": 18,"difficulty": "medium","type": "multiple","shuffleAnswers": true}
Category 18 is OpenTDB's Science: Computers category.
Input parameters
| Input | Type | Default | Description |
|---|---|---|---|
amount | integer | 10 | Questions requested; minimum 1, maximum 50 |
category | integer | unset | Optional OpenTDB category ID from 9 to 32 |
difficulty | string | unset | easy, medium, or hard |
type | string | unset | multiple or boolean |
shuffleAnswers | boolean | false | Randomize only the combined answers array |
Common category IDs include:
9— General Knowledge11— Entertainment: Film12— Entertainment: Music17— Science & Nature18— Science: Computers21— Sports22— Geography23— History
OpenTDB controls its category taxonomy. Check the source documentation if a category changes.
Output example
A dataset item follows this shape:
{"question": "What does CPU stand for?","correctAnswer": "Central Processing Unit","incorrectAnswers": ["Central Process Utility","Computer Personal Unit","Central Processor Utility"],"answers": ["Central Processing Unit","Central Process Utility","Computer Personal Unit","Central Processor Utility"],"category": "Science: Computers","categoryId": 18,"difficulty": "medium","type": "multiple","sourceStatus": "success","sourceResponseCode": 0,"sourceUrl": "https://opentdb.com/api.php?amount=10&encode=base64&category=18&difficulty=medium&type=multiple","retrievedAt": "2026-01-15T12:00:00.000Z","request": {"amount": 10,"category": 18,"difficulty": "medium","type": "multiple"}}
Actual question content varies because OpenTDB chooses the available records.
How much does it cost to export OpenTDB questions?
This Actor uses pay-per-event pricing:
- one small Actor start charge per run;
- one
Question exportedcharge for each saved dataset row.
You are not charged an item event for rejected, missing, or empty records.
The exact tier prices appear in Apify Console before you start a run. Larger subscription tiers receive lower per-question prices. Use the Console estimate as the current source of truth.
For example, a run returning 10 useful questions incurs one start event and 10 question events. A 50-question run incurs one start event and 50 question events.
Recurring quiz-content workflow
Use an Apify schedule to refresh a focused question set:
- Save a Task with category, difficulty, and type filters.
- Set a weekly or monthly schedule.
- Attach a webhook to the successful run event.
- Read the default dataset from the webhook payload.
- Deduplicate or review questions in your own question bank.
OpenTDB can return randomly selected questions. A schedule creates new snapshots; the Actor does not maintain history or compare runs itself.
Export and integrations
The default dataset works with:
- JSON and JSONL ingestion;
- CSV and Excel downloads;
- Google Sheets integrations;
- Make and Zapier workflows;
- webhooks;
- Apify API clients;
- other Actors in a chained workflow.
Use question, category, difficulty, and type as common downstream mapping fields.
Run with the Apify API
Replace YOUR_TOKEN with your Apify API token.
cURL
curl -X POST \"https://api.apify.com/v2/acts/automation-lab~open-trivia-database-questions-export/runs?token=YOUR_TOKEN&waitForFinish=120" \-H "Content-Type: application/json" \-d '{"amount":10,"category":18,"difficulty":"medium","type":"multiple"}'
JavaScript
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('automation-lab/open-trivia-database-questions-export').call({amount: 10,category: 18,difficulty: 'medium',type: 'multiple',shuffleAnswers: true,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
Python
from apify_client import ApifyClientclient = ApifyClient("YOUR_TOKEN")run = client.actor("automation-lab/open-trivia-database-questions-export").call(run_input={"amount": 10,"category": 18,"difficulty": "medium","type": "multiple",})items = client.dataset(run["defaultDatasetId"]).list_items().itemsprint(items)
Use with MCP and AI assistants
Add the Apify MCP server to Claude Code:
claude mcp add --transport http apify \"https://mcp.apify.com?tools=automation-lab/open-trivia-database-questions-export"
Claude Desktop, Cursor, and VS Code setup
Use this MCP configuration in Claude Desktop, Cursor, or VS Code:
{"mcpServers": {"apify": {"url": "https://mcp.apify.com?tools=automation-lab/open-trivia-database-questions-export"}}}
Example prompts:
- "Get 15 easy general knowledge OpenTDB questions and return the answers as a table."
- "Export 20 hard science and nature multiple-choice questions for my review workflow."
- "Run my saved OpenTDB question Task and summarize category counts in its dataset."
Always verify generated educational or factual content before publishing it.
Reliability and failure behavior
The Actor validates inputs before contacting the source.
Transient network errors, HTTP 429 responses, and server errors receive bounded retries. Deterministic input errors are not retried blindly.
A source response with no matching questions completes successfully with an empty dataset. Other OpenTDB response errors fail the run with a readable status.
The Actor does not use a proxy or browser. This keeps runtime and transfer usage small.
Legality and responsible use
- OpenTDB allows at most 50 questions in one API request.
- Availability depends on the selected filter combination.
- Question selection and wording are controlled by OpenTDB.
- Random source selection can return repeated content across separate runs.
- Shuffling affects only the
answersarray. - The separate
correctAnswerandincorrectAnswersfields remain authoritative. - This Actor does not verify each trivia fact.
- This Actor does not detect changes between historical runs.
Follow OpenTDB's terms and attribution guidance. Review content for accuracy, age suitability, bias, and licensing requirements before distribution.
Troubleshooting
Why did my run return fewer or zero questions?
The chosen category, difficulty, and type combination may not contain enough available questions. Try removing one filter or requesting fewer questions.
Why is categoryId null?
You did not set a category filter. OpenTDB still returns a category name for each question, but no single category ID was part of the request.
Why does the answer order change?
shuffleAnswers: true deliberately randomizes the combined answers array on every run. Use the separate answer fields when checking correctness.
Why did the run fail with a source status?
OpenTDB reported an error other than a valid no-results response. Confirm the input and retry later if the source was rate limited or temporarily unavailable.
FAQ
Does it need an OpenTDB token?
No. The Actor uses the anonymous official endpoint.
Can it download more than 50 questions per run?
No. The Actor follows the source's 50-question request limit rather than hiding multiple rate-limited calls behind one run.
Are HTML entities left in the output?
No. The Actor requests base64-encoded values and decodes them into normal Unicode text.
Can I export true/false questions?
Yes. Set type to boolean.
Can I schedule it?
Yes. Save the input as an Apify Task and attach an Apify schedule.
Does it remove duplicates across runs?
No. Store stable historical results in your own dataset or database and apply your preferred deduplication rule.
Related automation-lab Actors
For other structured public-data pipelines, explore Actors published by automation-lab. Choose a related Actor only when its source and output fit your downstream workflow.
Support
If the Actor fails with valid input, include the run ID and non-sensitive input in an Apify issue. Do not include API tokens or private downstream data.