---
title: "Topic detail with facets"
method: GET
path: "/api/v1/topics/{slug}"
tags: ["Discovery"]
---

# Topic detail with facets

`GET /api/v1/topics/{slug}`

## Request

- Base URL: `https://quizbase.runriva.com`
- URL: `https://quizbase.runriva.com/api/v1/topics/{slug}`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Single topic + facets (byCategory, byDifficulty, byLanguage, coOccurringTags, coOccurringSubcategories) + 3 sample questions.

## Path parameters

- `slug` string, required: Curated topic slug or alias.

## Query parameters

- `lang` 'en' | 'pl': Display language for category names + slug labels (subcategories/tags)

## Response `200`

Topic detail.

- TopicDetailResponse
  - `topic` TopicEntry, required
    - `slug` string, required
    - `kind` 'tag' | 'subcategory', required
    - `label` string, required
    - `aliases` string[], required
    - `count` integer, required
  - `facets` TopicFacets, required
    - `byCategory` object[], required
      - `slug` string, required
      - `name` string, required
      - `count` integer, required
    - `byDifficulty` object, required
    - `byLanguage` object, required
    - `coOccurringTags` StatsTagEntry[], required
      - `slug` string, required
      - `label` string, required
      - `count` integer, required
    - `coOccurringSubcategories` StatsTagEntry[], required
      - `slug` string, required
      - `label` string, required
      - `count` integer, required
  - `samples` TopicSampleQuestion[], required
    - `id` string, uuid, required
    - `text` string, required
    - `type` 'multiple' | 'boolean' | 'text_input', required
    - `difficulty` 'trivial' | 'easy' | 'medium' | 'hard' | 'expert' | 'null', nullable, required
    - `language` string, required
  - `meta` MetaBasic, required
    - `language` string, required: Language of the response content.
    - `requestId` string, uuid, required: Unique request identifier (also in `X-Request-Id` response header).

## Other responses

- `401`: Missing, malformed, invalid, or revoked API key.
- `403`: IP not allowed (per-key allowlist).
- `404`: Topic not found.
- `429`: Rate limit exceeded. See `Retry-After` header.
- `500`: Server error.

---

[API](https://skmtc.dev/runriva/apis/quizbase-api.md) · [All operations](https://skmtc.dev/runriva/apis/quizbase-api/llms.txt) · [OpenAPI document](https://skmtc.dev/runriva/apis/quizbase-api/revisions/4c2f9be78ec9?raw)
