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

# Get total coding time

`GET /api/v1/stats`

Returns the total coding time for all users, optionally filtered by user or date range. Authenticated with the shared STATS_API_KEY token (Bearer header or api_key query param) — not tied to any user or admin level. Authentication is skipped entirely in development.

## Query parameters

- `start_date` string, date
- `end_date` string, date
- `username` string
- `user_email` string

## Response `200`

successful

## Other responses

- `401` — unauthorized — Returned when STATS_API_KEY is unset/blank or the supplied token is missing or incorrect. (Auth is bypassed in the development environment.)
- `404` — user not found
- `422` — invalid date

## Changes

- **2026-06-07** (v1) `10d87f00ef0b` — 1 info
  - added the non-success response with the status `401`
- **2026-02-21** (v1) `9c5c308ea36c` — 1 info
  - removed the non-success response with the status `401`
- **2026-02-20** (v1) `3b1a9efa4afe` — 1 info
  - added the non-success response with the status `422`
- **2026-01-28** (v1) `a9eaba48a93a` — 2 breaking
  - for the `query` request parameter `end_date`, the type/format was changed from `string`/`` to `string`/`date`
  - for the `query` request parameter `start_date`, the type/format was changed from `string`/`` to `string`/`date`
- **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/10d87f00ef0b/schema)
