---
title: "Get Stats Timeseries"
method: GET
path: "/v1/stats/timeseries"
tags: ["stats"]
---

# Get Stats Timeseries

`GET /v1/stats/timeseries`

## Request

- Base URL: `https://api.linktodm.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.linktodm.com/v1/stats/timeseries`
- Auth: HTTP bearer

Per-bucket time series of hits + clicks. Bucket granularity is derived
from the range (hour / day / month) and missing buckets are zero-filled
so the chart line is continuous. Same channel semantics as `/overview`.

## Query parameters

- `range` 'all' | '24h' | '7d' | '30d': Time-range window applied to every metric on the stats page. Mirrors the frontend tabs (`All time / 24 hours / 7 days / 30 days`).
- `channel_id` string, nullable

## Response `200`

Successful Response

- StatsTimeseriesResponse: Per-bucket time series matching `StatsOverviewResponse` (hits + clicks). Bucket granularity is derived from `range`: - `24h` → hour buckets (24 points, past 24 hours) - `7d` → day buckets (7 points, past 7 days) - `30d` → day buckets (30 points, past 30 days) - `all` → month buckets (12 points, past 12 months including current) `labels` are ISO-8601 bucket-start timestamps (UTC); the frontend formats them for display based on the active range. Every metric array has the same length as `labels`; missing buckets are zero-filled server-side.
  - `labels` string[], required
  - `hits` integer[], required
  - `clicks` integer[], required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/linktodm/apis/salesmorph.md) - [All operations](https://skmtc.dev/linktodm/apis/salesmorph/llms.txt) - [OpenAPI document](https://skmtc.dev/linktodm/apis/salesmorph/revisions/4af0ad5dbe92?raw)
