quizbase
Skip to content
Command Palette
Search for a command to run...
QuizBase · Docs

GET /v1/topics/:slug#

GET /api/v1/topics/:slug API key required

Detail view of a single curated topic. Returns the topic record (label, aliases, total count) plus facets broken down by category, difficulty, and language, the top co-occurring tags and subcategories, and 3 sample questions so you can preview the topic before composing a quiz round.

This is the “what’s actually in this topic” endpoint — the answer to “we have 1,599 Star Wars questions, but how do they break down across the five LLM-calibrated difficulty levels? mostly films, or also books and games?“.

Requires X-API-Key (or Authorization: Bearer …). Cached for 1h server-side.

Path parameters#

ParameterTypeDefaultDescription
slug *kebab-caseTopic slug from [GET /v1/topics](/docs/api/topics). Aliases also resolve — `/v1/topics/star-wars-saga` redirects to the canonical `star-wars` topic.

Query parameters#

ParameterTypeDefaultDescription
lang enumenDisplay language for `label` (topic and all facet labels). Supported: `en`, `pl`. Other values return `400`.

When you’ll get 404#

  • The slug doesn’t match any curated topic or alias
  • The topic was retired (very rare; we keep aliases pointing to surviving topics where possible)

Examples#

Response#

Response fields#

  • topic — same shape as a single entry from /v1/topics: {slug, kind, label, aliases, count}. kind is tag or subcategory depending on which discovery layer the topic was promoted from.
  • facets.byCategory — top-level category breakdown for this topic. name is localized to your ?lang=. Sorted by count desc.
  • facets.byDifficulty — fixed shape with 5 LLM-calibrated keys: trivial, easy, medium, hard, expert. Only keys with count > 0 are populated; missing keys mean zero. unrated does not appear here even when present in the catalog.
  • facets.byLanguage — counts per supported language (en, pl at launch). Tells you whether a topic has parity across languages.
  • facets.coOccurringTags / coOccurringSubcategories — top tags and subcategories that appear alongside this topic in questions, sorted by frequency. Use this to suggest related topics in a quiz UI (“if you liked Star Wars, try…”) or to compose multi-tag rounds.
  • samples — 3 example questions (id, text, type, difficulty, language). Just a preview — fetch full content via /v1/questions or /v1/questions/random?topic=….

Performance#

  • p50 (warm): ~50ms
  • p95: ~110ms (sustained 50 RPS; estimated — not in load mix). Single-request warm: ~60ms.
  • Last measured: 2026-05-27
  • SLO: p95 < 500ms, error rate < 1%
  • Cached for 1h after first request per (slug, lang) pair.

See also#