Command Palette
Search for a command to run...
GET /v1/stats#
GET
/api/v1/stats Public — no key Aggregate counters — total questions, per-language, per-source, per-category. No API key required. Cached for 5 minutes server-side (Redis) 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": 1294009,
"byLanguage": {
"en": 646194,
"pl": 647815
},
"bySource": {},
"byCategory": [
{ "slug": "geography", "name": "geography", "count": 146384 },
{ "slug": "history", "name": "history", "count": 146171 },
{ "slug": "music", "name": "music", "count": 139247 }
],
"byDifficulty": { "easy": 0, "medium": 0, "hard": 0, "unrated": 0 },
"byTopic": [
{ "slug": "biography", "label": "Biografie", "count": 245103 },
{ "slug": "american-history", "label": "Historia Stanów Zjednoczonych", "count": 71860 },
{ "slug": "us-presidents", "label": "Prezydenci USA", "count": 60348 }
],
"byTag": [
{ "slug": "united-states", "label": "united-states", "count": 15281 },
{ "slug": "nfl", "label": "nfl", "count": 14630 }
],
"meta": {
"generatedAt": "2026-05-05T16:32:09.001Z",
"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): ~25ms
- p95: ~30ms (sustained 50 RPS, baseline)
- Last measured: 2026-05-07
- SLO: p95 < 500ms, error rate < 1%
- Read path:
public_stats_snapshotstable, then a 5 min Redis cache. 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