---
title: "Returns SpanEntityStats for the given SourceDocuments."
method: POST
path: "/statistics/code"
tags: ["statistics"]
---

# Returns SpanEntityStats for the given SourceDocuments.

`POST /statistics/code`

## Query parameters

- `code_id` integer, required
- `sort_by_global` boolean
- `top_k` integer

## Request body

- integer[]

## Response `200`

Successful Response

- SpanEntityStat[]
  - `code_id` integer, required — The ID of the Code related to the SpanAnnotation
  - `span_text` string, required — The SpanText the SpanAnnotation spans
  - `filtered_count` integer, required — Number of occurrences of the SpanEntity in a collection of SourceDocuments.
  - `global_count` integer, required — Number of occurrences of the SpanEntity in a collection of SourceDocuments.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/uhh-lt/apis/discourse-analysis-tool-suite-api.md) · [All operations](https://skmtc.net/uhh-lt/apis/discourse-analysis-tool-suite-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/uhh-lt/discourse-analysis-tool-suite-api/revisions/6b22366ce2d1/schema)
