---
title: "Get similar documents to a document (JSON)"
method: GET
path: "/{k}/docs_topics/{doc_id}.json"
tags: ["Models", "Documents", "Topics"]
---

# Get similar documents to a document (JSON)

`GET /{k}/docs_topics/{doc_id}.json`

Returns a JSON array of up to `n` documents most similar to the focal document `doc_id` in model `k`. Each document includes `id`, `label`, `metadata`, plus: - `prob` - `topics` (topic mixture map) Supports conditional requests via ETag / If-None-Match.

## Path parameters

- `k` integer, required
- `doc_id` string, required

## Query parameters

- `n` integer

## Response `200`

Array of similar 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)
