---
title: "Get heartbeats"
method: GET
path: "/api/v1/my/heartbeats"
tags: ["My Data"]
---

# Get heartbeats

`GET /api/v1/my/heartbeats`

Returns a list of heartbeats for the authenticated user within a time range. This is the raw data stream. Authenticate with your API key as a Bearer token in the `Authorization` header (HTTP Basic auth with the API key is also accepted).

## Query parameters

- `start_time` string, date_time
- `end_time` string, date_time

## Response `200`

successful

- object
  - `start_time` string, date_time, required — Effective start of the queried range.
  - `end_time` string, date_time, required — Effective end of the queried range.
  - `total_seconds` number, required — Total coding duration in seconds across the returned heartbeats.
  - `heartbeats` Heartbeat[], required — Heartbeats in the range, ordered by time ascending.
    - `id` integer
    - `entity` string, nullable — File path or app name being accessed
    - `type` 'file' | 'app', nullable
    - `category` 'advising' | 'ai coding' | 'animating' | 'browsing' | 'building' | 'code reviewing' | 'coding' | 'communicating' | 'configuring' | 'debugging' | 'designing' | 'indexing' | 'learning' | 'manual testing' | 'meeting' | 'notes' | 'planning' | 'researching' | 'running tests' | 'supporting' | 'translating' | 'writing docs' | 'writing tests', nullable
    - `time` number, float — Unix timestamp of the activity
    - `project` string, nullable
    - `branch` string, nullable
    - `language` string, nullable
    - `is_write` boolean, nullable
    - `editor` string, nullable
    - `operating_system` string, nullable
    - `machine` string, nullable
    - `cursorpos` integer, nullable
    - `lineno` integer, nullable
    - `lines` integer, nullable
    - `line_additions` integer, nullable
    - `line_deletions` integer, nullable

## Other responses

- `401` — unauthorized — Returned when the Authorization header is missing or the token does not match a known API key.

---

[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)
