Command Palette
Search for a command to run...
GET /v1/categories#
GET
/api/v1/categories Public — no key Returns the full list of categories with localized name. No API key required — rate-limited per IP, cached aggressively (Cache-Control: public, s-maxage=3600, stale-while-revalidate=300).
Use this for dropdowns, filter UIs, and landing page counts. Categories change rarely — fetch once, cache for hours.
Parameters#
| Parameter | Type | Default | Description |
|---|---|---|---|
| lang | enum | en | Supported: `en`, `pl`. Sets the language of `name`. Falls back to English where a category translation is missing. Any other value returns `400`. |
Examples#
Response#
{
"data": [
{ "id": 1, "slug": "general-knowledge", "name": "Wiedza ogólna", "opentdbId": 9, "parentId": null },
{ "id": 3, "slug": "film", "name": "Rozrywka: Film", "opentdbId": 11, "parentId": null },
{ "id": 14, "slug": "geography", "name": "Geografia", "opentdbId": 22, "parentId": null },
{ "id": 15, "slug": "history", "name": "Historia", "opentdbId": 23, "parentId": null }
],
"meta": { "count": 24, "language": "pl", "requestId": "req_..." }
}{
"type": "https://quizbase.runriva.com/errors/invalid_query_param",
"title": "Invalid query parameters",
"status": 400,
"detail": "lang: lang \"xyz\" is not supported. Supported: en, pl",
"instance": "/api/v1/categories?lang=xyz",
"code": "invalid_query_param",
"errors": [
{ "path": "lang", "message": "lang \"xyz\" is not supported. Supported: en, pl" }
]
}Performance#
- p50 (warm): ~25ms
- p95: ~30ms (sustained 50 RPS, baseline)
- Last measured: 2026-05-07
- SLO: p95 < 500ms, error rate < 1%
- CDN cache:
s-maxage=3600, stale-while-revalidate=300— most requests served by CDN edge.
See also#
- GET /v1/stats — per-category counts
- GET /v1/languages — language whitelist accepted by
?lang= - Migrating from OpenTDB — id mapping in practice