---
title: "Get top documents for a topic (JSON)"
method: GET
path: "/{k}/topics/{topic_no}.json"
tags: ["Models", "Topics", "Documents"]
---

# Get top documents for a topic (JSON)

`GET /{k}/topics/{topic_no}.json`

Returns a JSON array of documents associated with a topic in model `k`. Each returned document includes `id`, `label`, `metadata`, plus: - `prob`: similarity/probability value (as emitted by server) - `topics`: map of topic-id to probability for that document Supports `n` query parameter to limit the number of documents. Supports conditional requests via ETag / If-None-Match.

## Path parameters

- `k` integer, required
- `topic_no` integer, required

## Query parameters

- `n` integer

## Response `200`

Array of documents with topic mixtures

- DocWithTopics[]
  - `id` string, required — Document identifier (label key used by server).
  - `label` string, required — Human-readable label for the document.
  - `metadata` Metadata, required — Arbitrary metadata fields from the corpus.
  - `prob` number, float, required — Probability/similarity score emitted by the server.
  - `topics` object, required — Map of topic id (string) to probability for this document.

## Other responses

- `304` — Not Modified (If-None-Match matched)
- `400` — Invalid model `k` (no model for k)

---

[API](https://skmtc.dev/inpho/apis/topic-explorer-server-api.md) · [All operations](https://skmtc.dev/inpho/apis/topic-explorer-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/inpho/topic-explorer-server-api/revisions/04253424f5bb/schema)
