---
title: "Get admin user stats"
method: GET
path: "/api/admin/v1/user/stats"
tags: ["Admin Utils"]
---

# Get admin user stats

`GET /api/admin/v1/user/stats`

Get detailed stats for a user (Admin view). When start_date/end_date are provided, heartbeats are filtered to that range; otherwise the single date param (default: current date) is used.

## Query parameters

- `user_id` string
- `id` string
- `start_date` string
- `end_date` string
- `date` string, date

## Response `200`

successful

- object
  - `user_id` integer
  - `username` string
  - `start_date` string, date
  - `end_date` string, date
  - `timezone` string, nullable
  - `total_heartbeats` integer
  - `total_duration` number
  - `heartbeats` object[]
    - `id` integer
    - `time` string
    - `created_at` string, date_time
    - `project` string, nullable
    - `branch` string, nullable
    - `category` string, nullable
    - `dependencies` string, nullable
    - `editor` string, nullable
    - `entity` string, nullable
    - `language` string, nullable
    - `machine` string, nullable
    - `operating_system` string, nullable
    - `type` string, nullable
    - `user_agent` string, nullable
    - `line_additions` integer, nullable
    - `line_deletions` integer, nullable
    - `lineno` integer, nullable
    - `lines` integer, nullable
    - `cursorpos` integer, nullable
    - `project_root_count` integer, nullable
    - `is_write` boolean, nullable
    - `source_type` string, nullable
    - `ip_address` string, nullable

## Other responses

- `404` — user not found

---

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