---
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 an OAuth access token with the `read` scope or an 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, the OAuth token lacks the read scope, or the token is invalid.

## Changes

> 27 revisions in range; 2 could not be searched.

- **2026-06-07** (v1) `10d87f00ef0b` — 3 info
  - the endpoint scheme security `Bearer` was added to the API
  - the endpoint scheme security `Bearer AND ApiKeyAuth` was removed from the API
  - added the media type `application/json` for the response with the status `200`
- **2026-01-28** (v1) `a9eaba48a93a` — 2 breaking
  - for the `query` request parameter `end_time`, the type/format was changed from `string`/`` to `string`/`date_time`
  - for the `query` request parameter `start_time`, the type/format was changed from `string`/`` to `string`/`date_time`
- **2026-01-27** (v1) `b6d6849481da` — 1 breaking, 4 info
  - removed the media type `application/json` for the response with the status `200`
  - the endpoint scheme security `Bearer AND ApiKeyAuth` was added to the API
  - the endpoint scheme security `Bearer` was removed from the API
  - for the `query` request parameter `end_time`, the type/format was generalized from `string`/`date_time` to `string`/``
  - …1 more

[Change history](https://skmtc.dev/hackclub/apis/hackatime-api/changes/api/v1/my/heartbeats/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/172c35ec816f/schema)
