---
title: "Get aggregated client platform usage statistics."
method: GET
path: "/api/v1/admin/client-stats"
---

# Get aggregated client platform usage statistics.

`GET /api/v1/admin/client-stats`

**Access**: Restricted to users with `role: "SUPERADMIN"`
**Purpose**: Provides visibility into client platform and version usage

**Query Parameters**:
- `days`: Time period in days (7, 14, 30, 60, 90). Default: 30
- `client_type`: Optional filter (qgis_plugin, api_ui, cli)

**Response Schema**:
```json
{
  "period_days": 30,
  "generated_at": "2026-03-18T12:00:00Z",
  "platform_summary": {
    "qgis_plugin": {"active_users": 450, "total_users": 800},
    "api_ui": {"active_users": 50, "total_users": 120}
  },
  "plugin_stats": {
    "by_plugin_version": [
      {
        "version": "2.2.4",
        "user_count": 450,
        "by_qgis_version": [
          {"qgis_version": "3.34", "count": 300}
        ],
        "by_os": [
          {"os": "Windows", "count": 280}
        ]
      }
    ],
    "by_qgis_version": [
      {
        "qgis_version": "3.34",
        "user_count": 500,
        "by_plugin_version": [
          {"version": "2.2.4", "count": 300}
        ]
      }
    ],
    "by_os": [
      {"os": "Windows", "user_count": 520}
    ]
  },
  "api_ui_stats": {
    "by_version": [{"version": "1.5.2", "user_count": 35}]
  },
  "cli_stats": {
    "by_version": [{"version": "1.0.0", "user_count": 10}]
  }
}
```

**Use Cases**:
- Monitor plugin version adoption
- Plan deprecation of old versions
- Understand platform and OS distribution
- Inform release decisions

**Error Responses**:
- `401 Unauthorized`: JWT token required
- `403 Forbidden`: Superadmin access required
- `500 Internal Server Error`: Failed to compute statistics

## Response `200`

Success

- object

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/trends/apis/trends-earth-api.md) · [All operations](https://skmtc.dev/trends/apis/trends-earth-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/trends/trends-earth-api/revisions/6bdbc0b84666/schema)
