Metrics
API Version 2 (V2)
Heart
You can retrieve user resting heart rate (HR) data by user_id and filter by date range
Get a heart data by user_id
GET
Request
Query Parameters
user_id
required
String
User ID returned by add integration request. This key should be stored in your database against the user and used for all interactions with the Spike API.
start_date
required
String
Date from in YYYY-MM-DD format
end_date
required
String
Date to in YYYY-MM-DD format
Header Parameters
authorizationtoken
required
String
Client access token (deprecated)
x-spike-auth
required
String
Client access token
Python
Node.js
Ruby
Java
Curl
1import requests
2
3url = "https://api.spikeapi.com/v2/metrics/heart/?user_id=fa1e3803-6068-4ea7-9788-eccce210daa1&start_date=2020-05-01&end_date=2020-05-03"
4headers = {}
5headers['x-spike-auth'] = 'fa0b3803-1111-2222-9788-eccce210d30c'
6response = requests.request("GET", url, headers=headers)
7
8print(response.text)
Responses
200
1{
2 "user_id": "fa1e3803-6068-4ea7-9788-eccce210daa1",
3 "start_date": "2020-05-01",
4 "end_date": "2020-05-03",
5 "type": "heart",
6 "source": [
7 {
8 "name": "fitbit",
9 "status": "ok"
10 }
11 ],
12 "data": [
13 {
14 "date": "2020-05-01",
15 "timezone_offset": 7200,
16 "resting_hr": 56,
17 "min_hr": 48,
18 "avg_hr": 66,
19 "max_hr": 117,
20 "heart_rate_samples": [
21 {
22 "time": "2022-05-01T00:00:15",
23 "value": 56
24 },
25 {
26 "time": "2022-05-01T00:00:30",
27 "value": 56
28 },
29 ],
30 "heart_rate_variability": {
31 "day_hrv": 77.1,
32 "sleep_hrv": 89
33 },
34 "intraday_hrv": [
35 {
36 "value": {
37 "rmssd": 28.492,
38 "coverage": 0.945,
39 "hf": 97.61,
40 "lf": 121.196
41 },
42 "time": "2022-05-01T00:00:15",
43 }
44 ],
45 "source": "fitbit"
46 }
47 ]
48}
1<style>
2@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');
3
4.h2, .h3, .list, .description{
5 font-family: 'Poppins', sans-serif;
6 font-weight: 500;
7}
8
9.h2 {
10 margin-top: -20px;
11 margin-bottom: 20px;
12
13 font-size: 30px;
14}
15
16.h3 {
17 font-size: 22px;
18 margin-top: -20px;
19}
20
21.list-wrapper {
22 white-space: normal;
23 margin-top: -10px;
24}
25
26.list, .description {
27 font-size: 14px;
28}
29
30</style>
31<h2 class="h2">Fields</h2>
32<h3 class="h3">Heart.date</h3>
33<ul class="list-wrapper">
34 <li class="list">Type: String</li>
35 <li class="list">Format: Date, YYYY-MM-DD</li>
36 <li class="list">Example: 2020-05-01</li>
37</ul><p class="description">Date of measurement. For Whoop, date when the cycle ende</p>
38
39<h3 class="h3">Heart.resting_hr</h3>
40<ul class="list-wrapper">
41 <li class="list">Type: Int</li>
42 <li class="list">Unit: Beats per minute</li>
43 <li class="list">Example: 56</li>
44</ul><p class="description">Average resting heart rate</p>
45
46<h3 class="h3">Heart.min_hr</h3>
47<ul class="list-wrapper">
48 <li class="list">Type: Int</li>
49 <li class="list">Unit: Beats per minute</li>
50 <li class="list">Example: 56</li>
51</ul><p class="description">Minimum of heart rate values captured during the monitoring period, in beats per minute.</p>
52
53<h3 class="h3">Heart.avg_hr</h3>
54<ul class="list-wrapper">
55 <li class="list">Type: Int</li>
56 <li class="list">Unit: Beats per minute</li>
57 <li class="list">Example: 56</li>
58</ul><p class="description">Average of heart rate values captured during the monitoring period, in beats per minute.</p>
59
60<h3 class="h3">Heart.max_hr</h3>
61<ul class="list-wrapper">
62 <li class="list">Type: Int</li>
63 <li class="list">Unit: Beats per minute</li>
64 <li class="list">Example: 156</li>
65</ul><p class="description">Maximum of heart rate values captured during the monitoring period, in beats per minute.</p>
66
67<h3 class="h3">Heart.heart_rate_samples.time</h3>
68<ul class="list-wrapper">
69 <li class="list">Type: string</li>
70 <li class="list">Format: Date time, YYYY-MM-DDThh:mm:ss</li>
71 <li class="list">Example: 2022-02-19T00:00:15</li>
72</ul><p class="description">The time of the measurement</p>
73
74<h3 class="h3">Heart.heart_rate_samples.value</h3>
75<ul class="list-wrapper">
76 <li class="list">Type: Int</li>
77 <li class="list">Unit: Beats per minute</li>
78 <li class="list">Example: 156</li>
79</ul><p class="description">Heart rate value recorded for that time, in beats per minute. Each entry is a representative sample of the previous 15 seconds from the given time</p>
80
81<h3 class="h3">Heart.heart_rate_variability.day_hrv</h3>
82<ul class="list-wrapper">
83 <li class="list">Type: Float</li>
84 <li class="list">Unit: Milliseconds (ms)</li>
85 <li class="list">Example: 39.657</li>
86</ul><p class="description">The Root Mean Square of Successive Differences (RMSSD) between heart beats. It measures short-term variability in the user’s daily heart rate in milliseconds (ms).</p>
87
88<h3 class="h3">Heart.heart_rate_variability.sleep_hrv</h3>
89<ul class="list-wrapper">
90 <li class="list">Type: Float</li>
91 <li class="list">Unit: Milliseconds (ms)</li>
92 <li class="list">Example: 42.157</li>
93</ul><p class="description">The Root Mean Square of Successive Differences (RMSSD) between heart beats. It measures short-term variability in the user’s heart rate while in deep sleep, in milliseconds (ms).</p>
94
95<h3 class="h3">Heart.intraday_hrv.value.rmssd</h3>
96<ul class="list-wrapper">
97 <li class="list">Type: Float</li>
98 <li class="list">Unit: Milliseconds (ms)</li>
99 <li class="list">Example: 28.492</li>
100</ul><p class="description">The Root Mean Square of Successive Differences (RMSSD) between heart beats. It measures short-term variability in the user’s heart rate in milliseconds (ms).</p>
101
102<h3 class="h3">Heart.intraday_hrv.value.coverage</h3>
103<ul class="list-wrapper">
104 <li class="list">Type: Float</li>
105 <li class="list">Example: 0.945</li>
106</ul><p class="description">Data completeness in terms of the number of interbeat intervals.</p>
107
108<h3 class="h3">Heart.intraday_hrv.value.hf</h3>
109<ul class="list-wrapper">
110 <li class="list">Type: Float</li>
111 <li class="list">Example: 97.61</li>
112</ul><p class="description">The power in interbeat interval fluctuations within the high frequency band (0.15 Hz - 0.4 Hz).</p>
113
114<h3 class="h3">Heart.intraday_hrv.value.lf</h3>
115<ul class="list-wrapper">
116 <li class="list">Type: Float</li>
117 <li class="list">Example: 121.196</li>
118</ul><p class="description">The power in interbeat interval fluctuations within the low frequency band (0.04 Hz - 0.15 Hz).</p>
119
120<h3 class="h3">Heart.intraday_hrv.time</h3>
121<ul class="list-wrapper">
122 <li class="list">Type: string</li>
123 <li class="list">Format: Date time, YYYY-MM-DDThh:mm:ss</li>
124 <li class="list">Example: 2022-02-19T00:00:15</li>
125</ul><p class="description">The time of the measurement</p>
126
127<h3 class="h3">Heart.source</h3>
128<ul class="list-wrapper">
129 <li class="list">Type: String</li>
130 <li class="list">Example: fitbit</li>
131</ul><p class="description">Data source</p>
132