---
title: "Query statistics"
method: GET
path: "/api/v1/query/stats"
tags: ["query"]
---

# Query statistics

`GET /api/v1/query/stats`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `Authorization`

Summarises data query activity over a window from hourly rollups: totals, a series and the busiest callers, sources and tables. Callers without access:view only see their own activity. The window defaults to the last 24 hours.

## Query parameters

- `from` string
- `to` string
- `interval` string
- `limit` integer

## Response `200`

OK

- QueryStats
  - `from` string
  - `interval` string
  - `series` QueryStatsPoint[]
    - `bucket` string
    - `denied` integer
    - `failed` integer
    - `succeeded` integer
  - `to` string
  - `top_callers` QueryStatsGroup[]
    - `allowed` integer
    - `denied` integer
    - `key` string
    - `label` string
    - `plugin_id` string
    - `principal_type` string
    - `tags` string[]
    - `total` integer
  - `top_sources` QueryStatsGroup[]
    - `allowed` integer
    - `denied` integer
    - `key` string
    - `label` string
    - `plugin_id` string
    - `principal_type` string
    - `tags` string[]
    - `total` integer
  - `top_tables` QueryStatsGroup[]
    - `allowed` integer
    - `denied` integer
    - `key` string
    - `label` string
    - `plugin_id` string
    - `principal_type` string
    - `tags` string[]
    - `total` integer
  - `totals` QueryStatsTotals
    - `allowed` integer
    - `callers` integer
    - `denied` integer
    - `failed` integer
    - `queries` integer
    - `tables` integer

## Other responses

- `400`: Bad Request

## Changes

> 65 revisions in range; 1 not diffed.

- **2026-10-22** `b5eb291dd2fe`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/marmotdata/apis/marmot-api/changes/api/v1/query/stats/get.md)

---

[API](https://skmtc.dev/marmotdata/apis/marmot-api.md) - [All operations](https://skmtc.dev/marmotdata/apis/marmot-api/llms.txt) - [OpenAPI document](https://skmtc.dev/marmotdata/apis/marmot-api/revisions/18c57b576cb6?raw)
