---
title: "Get workspace analytics"
method: GET
path: "/workspace/{workspace_id}/analytics/"
tags: ["Analytics"]
---

# Get workspace analytics

`GET /workspace/{workspace_id}/analytics/`

## Request

- Base URL: `https://hovercode.com/api/v2`
- URL: `https://hovercode.com/api/v2/workspace/{workspace_id}/analytics/`
- Auth: API key in header `Authorization`

One aggregate for the whole workspace, same shape as code analytics plus `top_codes` ranked within the same window.

## Path parameters

- `workspace_id` string, uuid, required

## Query parameters

- `days` integer
- `start` string
- `end` string
- `top` integer

## Response `200`

OK

- WorkspaceAnalytics
  - `qr_code_id` string, uuid
  - `period_days` integer
  - `start` string, date-time
  - `end` string, date-time
  - `total_scans` integer
  - `unique_scans` integer
  - `scans_by_day` object[]
    - `date` string, date, nullable
    - `scans` integer
  - `top_countries` object[]
    - `value` string
    - `scans` integer
  - `top_cities` object[]
    - `value` string
    - `scans` integer
  - `top_os` object[]
    - `value` string
    - `scans` integer
  - `top_browsers` object[]
    - `value` string
    - `scans` integer
  - `workspace` string, uuid
  - `top_codes` object[]
    - `id` string, uuid
    - `display_name` string, nullable
    - `destination` string, nullable
    - `scans` integer
    - `unique_scans` integer

## Other responses

- `400`: Validation error.
- `401`: Missing or invalid API token.
- `404`: Not found, or not in a workspace you belong to.
- `429`: Rate limit exceeded. Wait `Retry-After` seconds before retrying.

---

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