---
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. Requires an active Admin API Key supplied via the Bearer header. Admin API Keys are never accepted in the api_key query param. During migration, STATS_API_KEY is accepted via the Bearer header or api_key query param only when the allow_legacy_stats_api_key Flipper flag is enabled. 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 the Admin API Key is missing, revoked, or incorrect. (Auth is bypassed in the development environment.)
- `404` — user not found
- `422` — invalid date

---

[API](https://skmtc.net/hackclub/apis/hackatime-api.md) · [All operations](https://skmtc.net/hackclub/apis/hackatime-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hackclub/hackatime-api/versions/4214f8ab061e/schema)
