---
title: "Get Download Stats"
method: GET
path: "/api/admin/downloads/stats"
tags: ["Admin"]
---

# Get Download Stats

`GET /api/admin/downloads/stats`

Get product download statistics (gateway, sdk_pypi, extension_vscode).

## Query parameters

- `period` string — Time period: last_day, last_week, last_month, last_90_days, last_year, custom
- `start_date` string, nullable — Start date for custom period (ISO format: YYYY-MM-DD)
- `end_date` string, nullable — End date for custom period (ISO format: YYYY-MM-DD)
- `source` string, nullable — Filter by source: gateway, sdk_pypi, extension_vscode (or None for all)

## Response `200`

Successful Response

- DownloadStatsResponse
  - `success` boolean
  - `period` string, required — Time period (last_hour, last_day, etc.)
  - `period_start` string, required — Start of period (ISO)
  - `period_end` string, required — End of period (ISO)
  - `total_downloads` integer — Total downloads in period
  - `time_series` DownloadTimeSeriesPoint[] — Time series data for charting
    - `timestamp` string, required — ISO timestamp
    - `downloads` integer — Number of downloads
    - `source` string, nullable — Product source (gateway, sdk_pypi, extension_vscode)
  - `by_source` object — Downloads by source in period: gateway, sdk_pypi, extension_vscode
  - `by_source_total` object — All-time downloads by source for display cards
  - `by_os` object — Downloads by OS
  - `by_country` object — Downloads by country

## Other responses

- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/compresr/apis/compresr-platform-api.md) · [All operations](https://skmtc.net/compresr/apis/compresr-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/compresr/compresr-platform-api/revisions/93ee959dfa51/schema)
