---
title: "Get Analytics"
method: GET
path: "/api/analytics"
tags: ["Analytics"]
---

# Get Analytics

`GET /api/analytics`

## Request

- Base URL: `https://api.soeru.biz` (the document declares no server; this is the origin it was published from)
- URL: `https://api.soeru.biz/api/analytics`
- Auth: none declared. Required headers: `authorization`

Get full analytics data for the analytics page.

Perf note (2026-04-23): the five queries below (monthly counts ×2 +
30-day paginated aggregations ×3 over message_history) used to run
serially on the request thread. They are now executed in parallel
via ``asyncio.gather`` + ``asyncio.to_thread`` — each inner function
still owns its own try/except so a single sub-query failure degrades
to safe defaults without taking the whole endpoint down. Wall-clock
improves roughly ``Σ latencies → max latency`` for this endpoint,
which is the dominant cost for ``/dashboard/insights``.

## Headers

- `x-shop-id` string, nullable: Optional shop ID
- `authorization` string, required: Bearer <token>

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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