---
title: "Scan stats for one code"
method: GET
path: "/api/v1/codes/{id}/stats"
tags: ["stats"]
---

# Scan stats for one code

`GET /api/v1/codes/{id}/stats`

## Request

- Base URL: `https://app.qrtap.kg`
- URL: `https://app.qrtap.kg/api/v1/codes/{id}/stats`
- Auth: HTTP bearer

Aggregated, anonymous scan analytics for one code: total, per-day series and device split. Bots are excluded. No visitor IP or user-agent is ever stored.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `from` string, date-time
- `to` string, date-time

## Response `200`

Aggregates for the requested range (all time when from/to omitted).

- CodeStats
  - `total` integer, required: Non-bot scans in range.
  - `by_day` DayCount[], required
    - `day` string, required: YYYY-MM-DD.
    - `count` integer, required
  - `by_device` DeviceCount[], required
    - `device` string, required: Coarse device class: mobile | tablet | desktop | other | unknown.
    - `count` integer, required

## Other responses

- `400`: The id path segment is not a UUID.
- `401`: Missing, invalid or revoked API key.
- `404`: No such object in your organization.
- `429`: Limit exceeded — the request had no effect. `error` is `rate_limited` with `scope: "minute"` (a burst brake: wait `retry_after` seconds and continue) or `quota_exceeded` with `scope: "day"` (the workspace's daily quota, counted in UTC; it returns at `reset_at`, the next UTC midnight, and only a higher plan raises it before then).

---

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