---
title: "Get Entity Stats"
method: GET
path: "/api/v1/entities/stats"
tags: ["entities"]
---

# Get Entity Stats

`GET /api/v1/entities/stats`

## Request

- Base URL: `https://api.gnosari.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gnosari.com/api/v1/entities/stats`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-AUTH-TOKEN`

Get entity extraction statistics for dashboard.

When group_by_agent is True, returns per-agent breakdown.
When agent_id is provided, filters stats for that specific agent.

## Query parameters

- `days` integer, nullable: Time window in days; omit for all-time
- `agent_id` integer, nullable: Filter stats by specific agent
- `group_by_agent` boolean: Return stats broken down per agent

## Response `200`

Successful Response

- union
  - StatsRead: Entity extraction statistics -- matches actual return shape.
    - `status_counts` object
    - `type_counts` TypeCountItem[]
      - `template_id` integer, required
      - `template_name` string, required
      - `count` integer, required
    - `agent_counts` AgentCountItem[]
      - `agent_id` integer, required
      - `agent_name` string, required
      - `count` integer, required
    - `total` integer
    - `period_days` integer, nullable
  - StatsByAgentRead: Stats grouped by agent -- matches actual return shape.
    - `agents` AgentStatsItem[]
      - `agent_id` integer, required
      - `agent_name` string, required
      - `status_counts` object
      - `type_counts` TypeCountItem[]
        - `template_id` integer, required
        - `template_name` string, required
        - `count` integer, required
      - `total` integer
    - `total` integer
    - `period_days` integer, nullable

## Other responses

- `422`: Validation Error

---

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