My Data
Get 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).
get/api/v1/my/heartbeats
Query parameters
start_timestring date_time
Start time (ISO 8601). Defaults to the beginning of the current day when omitted.
end_timestring date_time
End time (ISO 8601). Defaults to the end of the current day when omitted.
Response
successful
Example response
{
"start_time": "2024-03-20T00:00:00Z",
"end_time": "2024-03-20T23:59:59Z",
"total_seconds": 3600,
"heartbeats": [
{
"id": 1024,
"entity": "/Users/orpheus/hackatime/app/services/chaos_monkey_service.rb",
"type": "file",
"category": "coding",
"time": 1709251200,
"project": "hackatime",
"branch": "main",
"language": "Ruby",
"is_write": true,
"editor": "VS Code",
"operating_system": "Mac",
"machine": "Orpheus-MacBook-Pro",
"cursorpos": 123,
"lineno": 42,
"lines": 100,
"line_additions": 5,
"line_deletions": 2
}
]
}