Command Palette
Search for a command to run...
GET /v1/stats#
GET
/api/v1/stats API key required Aggregate counters — total questions, per-language, per-source, per-category. Requires X-API-Key (or Authorization: Bearer …). Cached for 5 minutes server-side with Cache-Control: public, s-maxage=300, stale-while-revalidate=60.
Use this for landing pages, dashboards, and status boards.
Parameters#
| Parameter | Type | Default | Description |
|---|---|---|---|
| lang | enum | en | Supported: `en`, `pl`. Sets the language of `byCategory[].name`. Counts themselves are not per-language — `byLanguage` always returns all languages present in the catalog. Any other value returns `400`. |
Examples#
Response#
{
"total": 1173456,
"byLanguage": {
"en": 586401,
"pl": 587055
},
"bySource": {
"entityq": 420195,
"mintaka": 274951,
"nq-open": 151732,
"kqa-pro": 138634,
"opentriviaqa": 90336,
"creak": 15226,
"arc": 14209,
"mkqa": 10834,
"opentdb": 9862,
"webq": 7916,
"qasc": 6649,
"quizbase": 10
},
"byCategory": [
{ "slug": "history", "name": "Historia", "count": 130093 },
{ "slug": "music", "name": "Muzyka", "count": 129747 },
{ "slug": "celebrities", "name": "Znane osoby", "count": 126115 }
],
"byDifficulty": { "trivial": 52616, "easy": 175454, "medium": 235073, "hard": 361326, "expert": 316085, "unrated": 0 },
"byTopic": [
{ "slug": "biography", "label": "Biografie", "count": 227274 },
{ "slug": "american-history", "label": "Historia Stanów Zjednoczonych", "count": 65496 },
{ "slug": "us-presidents", "label": "Prezydenci USA", "count": 54970 }
],
"byTag": [
{ "slug": "nfl", "label": "NFL", "count": 13135 },
{ "slug": "us-presidency", "label": "Prezydentura USA", "count": 13117 }
],
"topRegions": [
{ "code": "us", "label": "United States", "count": 309090 },
{ "code": "gb", "label": "United Kingdom", "count": 91708 },
{ "code": "de", "label": "Germany", "count": 25504 }
],
"byQualityHigh": { "en": 333193, "pl": 331870 },
"meta": {
"generatedAt": "2026-05-22T10:45:35.480Z",
"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/stats?lang=xyz",
"code": "invalid_query_param",
"errors": [
{ "path": "lang", "message": "lang \"xyz\" is not supported. Supported: en, pl" }
]
}Performance#
- p50 (warm): ~23ms
- p95: ~41ms (sustained 50 RPS, 5-min baseline). Single-request warm: ~30ms.
- Last measured: 2026-05-30
- SLO: p95 < 500ms, error rate < 1%
- Read path: pre-aggregated snapshot, then a 5-minute cache layer. No live aggregation on the request path.
See also#
- GET /v1/categories — category list with
opentdbIdmapping - GET /v1/languages — language whitelist behind
byLanguage - Languages & translations — what each
byLanguagekey means