# Open Trivia DB on Onekey > 2 endpoints for Open Trivia DB (2 stable, 0 beta), 5 credits each. Category: Fun & utilities. One key, one JSON shape. Base URL: https://api.onekey.dev Auth: header `x-api-key: `. Call shape: `GET /v1/{platform}/{endpoint}?{params}`. Every response is `{success, data, metadata, error}`; check `success` first. Cost is in `metadata.credits_charged`. Free when served from cache (0.2 credit for a cached response over 100 KB). Failed and not-found calls are refunded. Status: stable = verified against the live source; beta = not yet verified, fields may be missing. Page: https://onekey.dev/platforms/opentdb Reference (Markdown): https://onekey.dev/docs/api/opentdb.md All docs: https://onekey.dev/llms.txt ## Canonical fields returned Unified-schema fields (same names on every platform), with how many of the 2 mapped Open Trivia DB endpoints return each: - `content.text` (string): 1 - `entity.category` (string): 1 - `entity.id` (string): 1 - `entity.name` (string): 1 - `entity.type` (string): 1 - plus 2 platform-specific fields under `ext.` ## Endpoints ### opentdb.categories Open Trivia DB categories. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/opentdb/categories` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `entity.id`, `entity.name` - Reference: https://onekey.dev/docs/api/opentdb/categories.md ### opentdb.questions Trivia questions (Open Trivia DB; limited to 1 call per 5 s per IP). - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/opentdb/questions?amount=5` with header `x-api-key: YOUR_API_KEY` - Parameters: - `amount` (string, optional, default 5): Number of questions (1-10) - Fields returned: `content.text`, `entity.category`, `entity.type`, `ext.difficulty`, `ext.answer` - Reference: https://onekey.dev/docs/api/opentdb/questions.md ## Sample request ```bash curl "https://api.onekey.dev/v1/opentdb/categories" \ -H "x-api-key: YOUR_API_KEY" ```