---
title: "Get total coding time (Admin Only)"
method: GET
path: "/api/v1/stats"
tags: ["Stats"]
---

# Get total coding time (Admin Only)

`GET /api/v1/stats`

Returns the total coding time for all users, optionally filtered by user or date range. Requires admin privileges via STATS_API_KEY.

## Query parameters

- `start_date` string
- `end_date` string
- `username` string
- `user_email` string

## Response `200`

successful

## Other responses

- `401` — unauthorized
- `404` — user not found

## Changes

- **2026-01-27** (v1) `b6d6849481da` — 1 breaking, 3 info
  - removed the media type `text/plain` for the response with the status `401`
  - for the `query` request parameter `end_date`, the type/format was generalized from `string`/`date` to `string`/``
  - for the `query` request parameter `start_date`, the type/format was generalized from `string`/`date` to `string`/``
  - removed the non-success response with the status `422`

[Change history](https://skmtc.dev/hackclub/apis/hackatime-api/changes/api/v1/stats/get.md)

---

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