Metrics
API Version 2 (V2)
Activities Summary
You can retrieve user activities summary data by user_id and filter by date range
Get a activity summary 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
timezone_offset
optional
Integer
Timezone offset in secods
Header Parameters
authorizationtoken
optional
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/activities_summary/?user_id=fa1e3803-6068-4ea7-9788-eccce210d30c&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-eccce210d30c",
3 "start_date": "2020-05-01",
4 "end_date": "2020-05-03",
5 "type": "activities_summary",
6 "source": [
7 {
8 "name": "garmin",
9 "status": "ok"
10 }
11 ],
12 "data": [{
13 "date": "2022-05-01",
14 "calories_bmr": 2128,
15 "calories_total": 3002,
16 "calories_active": 874,
17 "steps": 9268,
18 "daily_movement": 9000,
19 "distance": 7656.0,
20 "low": 100,
21 "medium": 18,
22 "high": 6,
23 "elevation": 0,
24 "resting_hr": 51,
25 "floors": 0,
26 "sedentary_minutes": 802,
27 "min_hr": 49,
28 "avg_hr": 78,
29 "max_hr": 122,
30 "avg_stress_level": 38,
31 "max_stress_level": 99,
32 "stress_duration": 21780,
33 "low_stress_duration": 4800,
34 "medium_stress_duration": 3000,
35 "high_stress_duration": 13980,
36 "provider_timestamp": "2022-05-01T12:00:00",
37 "source": "garmin"
38 },
39 {
40 "date": "2022-05-02",
41 "calories_bmr": 1151,
42 "calories_total": 2097,
43 "calories_active": 945,
44 "steps": 30203,
45 "daily_movement": null,
46 "distance": 21109.46,
47 "low": 339,
48 "medium": 66,
49 "high": 215,
50 "elevation": 381,
51 "resting_hr": null,
52 "floors": null,
53 "sedentary_minutes": null,
54 "min_hr": 52,
55 "avg_hr": 82,
56 "max_hr": 153,
57 "avg_stress_level": null,
58 "max_stress_level": null,
59 "stress_duration": null,
60 "low_stress_duration": null,
61 "medium_stress_duration": null,
62 "high_stress_duration": null,
63 "provider_timestamp": "2022-05-02T05:37:09",
64 "source": "garmin"
65 },
66 {
67 "date": "2022-05-03",
68 "calories_bmr": 1148,
69 "calories_total": 2427,
70 "calories_active": 1278,
71 "steps": 29330,
72 "daily_movement": null,
73 "distance": 20185.89,
74 "low": 374,
75 "medium": 43,
76 "high": 247,
77 "elevation": 171,
78 "resting_hr": null,
79 "floors": null,
80 "sedentary_minutes": null,
81 "min_hr": 48,
82 "avg_hr": 88,
83 "max_hr": 146,
84 "avg_stress_level": null,
85 "max_stress_level": null,
86 "stress_duration": null,
87 "low_stress_duration": null,
88 "medium_stress_duration": null,
89 "high_stress_duration": null,
90 "provider_timestamp": "2022-05-03T05:37:10",
91 "source": "garmin"
92 }
93 ]
94}
95
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">Activity_summary.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: 2021-05-01</li>
37</ul><p class="description">Summary date in YYYY-MM-DD format. For Whoop, date when the cycle ended</p>
38
39<h3 class="h3">Activity_summary.calories_bmr</h3>
40<ul class="list-wrapper">
41 <li class="list">Type: Int</li>
42 <li class="list">Unit: kcal</li>
43 <li class="list">Example: 1973</li>
44</ul><p class="description">Total BMR calories burned for the day.</p>
45
46<h3 class="h3">Activity_summary.calories_total</h3>
47<ul class="list-wrapper">
48 <li class="list">Type: Int</li>
49 <li class="list">Unit: kcal</li>
50 <li class="list">Example: 2500</li>
51</ul><p class="description">Total calories burned for the day (daily timeseries total)</p>
52
53<h3 class="h3">Activity_summary.calories_active</h3>
54<ul class="list-wrapper">
55 <li class="list">Type: Int</li>
56 <li class="list">Unit: kcal</li>
57 <li class="list">Example: 350</li>
58</ul><p class="description">The number of calories burned for the day during periods the user was active above sedentary level..</p>
59
60<h3 class="h3">Activity_summary.steps</h3>
61<ul class="list-wrapper">
62 <li class="list">Type: Int</li>
63 <li class="list">Unit: step</li>
64 <li class="list">Example: 8000</li>
65</ul><p class="description">Total steps taken for the day</p>
66
67<h3 class="h3">Activity_summary.daily_movement</h3>
68<ul class="list-wrapper">
69 <li class="list">Type: Int</li>
70 <li class="list">Unit: Meters</li>
71 <li class="list">Example: 700</li>
72</ul><p class="description">Daily physical activity as equal meters i.e. amount of walking needed to get the same amount of activity. Physical activity on a daily basis can be quantified in terms of the distance one would need to walk in order to achieve an equivalent level of activity. This is determined by calculating the amount of energy expended during the activity and expressing it as an equivalent walking distance in meters. </p>
73
74<h3 class="h3">Activity_summary.distance</h3>
75<ul class="list-wrapper">
76 <li class="list">Type: Float</li>
77 <li class="list">Unit: Meters</li>
78 <li class="list">Example: 1700.0</li>
79</ul><p class="description">Distance for a day</p>
80
81<h3 class="h3">Activity_summary.low</h3>
82<ul class="list-wrapper">
83 <li class="list">Type: Int</li>
84 <li class="list">Unit: Minutes</li>
85 <li class="list">Example: 300</li>
86</ul><p class="description">Number of minutes during the day with low intensity activity</p>
87
88<h3 class="h3">Activity_summary.medium</h3>
89<ul class="list-wrapper">
90 <li class="list">Type: Int</li>
91 <li class="list">Unit: Minutes</li>
92 <li class="list">Example: 200</li>
93</ul><p class="description">Number of minutes during the day with medium intensity activity </p>
94
95<h3 class="h3">Activity_summary.high</h3>
96<ul class="list-wrapper">
97 <li class="list">Type: Int</li>
98 <li class="list">Unit: Minutes</li>
99 <li class="list">Example: 100</li>
100</ul><p class="description">Number of minutes during the day with high intensity activity </p>
101
102<h3 class="h3">Activity_summary.elevation</h3>
103<ul class="list-wrapper">
104 <li class="list">Type: Int</li>
105 <li class="list">Unit: Meters</li>
106 <li class="list">Example: 200</li>
107</ul><p class="description">The elevation traveled for the day (meters)</p>
108
109<h3 class="h3">Activity_summary.resting_hr</h3>
110<ul class="list-wrapper">
111 <li class="list">Type: Int</li>
112 <li class="list">Unit: Beats per minute</li>
113 <li class="list">Example: 77</li>
114</ul><p class="description">Resting heart rate</p>
115
116<h3 class="h3">Activity_summary.floors</h3>
117<ul class="list-wrapper">
118 <li class="list">Type: Int</li>
119 <li class="list">Example: 2</li>
120</ul><p class="description">The equivalent floors climbed for the day</p>
121
122<h3 class="h3">Activity_summary.sedentary_minutes</h3>
123<ul class="list-wrapper">
124 <li class="list">Type: Int</li>
125 <li class="list">Unit: Minutes</li>
126 <li class="list">Example: 802</li>
127</ul><p class="description">Total minutes the user was sedentary</p>
128
129<h3 class="h3">Activity_summary.min_hr</h3>
130<ul class="list-wrapper">
131 <li class="list">Type: Int</li>
132 <li class="list">Unit: Beats per minute</li>
133 <li class="list">Example: 48</li>
134</ul><p class="description">Minimum heart rate</p>
135
136<h3 class="h3">Activity_summary.avg_hr</h3>
137<ul class="list-wrapper">
138 <li class="list">Type: Int</li>
139 <li class="list">Unit: Beats per minute</li>
140 <li class="list">Example: 66</li>
141</ul><p class="description">Average heart rate</p>
142
143<h3 class="h3">Activity_summary.max_hr</h3>
144<ul class="list-wrapper">
145 <li class="list">Type: Int</li>
146 <li class="list">Unit: Beats per minute</li>
147 <li class="list">Example: 117</li>
148</ul><p class="description">Maximum heart rate</p>
149
150<h3 class="h3">Activity_summary.avg_stress_level</h3>
151<ul class="list-wrapper">
152 <li class="list">Type: Int</li>
153 <li class="list">Example: 32</li>
154</ul><p class="description">An abstraction of the user’s average stress level in this monitoring period, measured from 1 to 100, or -1 if there is not enough data to calculate average stress.</p>
155
156<h3 class="h3">Activity_summary.max_stress_level</h3>
157<ul class="list-wrapper">
158 <li class="list">Type: Int</li>
159 <li class="list">Example: 99</li>
160</ul><p class="description">The highest stress level measurement taken during this monitoring period.</p>
161
162<h3 class="h3">Activity_summary.stress_duration</h3>
163<ul class="list-wrapper">
164 <li class="list">Type: Int</li>
165 <li class="list">Unit: Seconds</li>
166 <li class="list">Example: 10680</li>
167</ul><p class="description">The number of seconds in this monitoring period where stress level measurements were in the stressful range (26-100).</p>
168
169<h3 class="h3">Activity_summary.low_stress_duration</h3>
170<ul class="list-wrapper">
171 <li class="list">Type: Int</li>
172 <li class="list">Unit: Seconds</li>
173 <li class="list">Example: 5580</li>
174</ul><p class="description">The portion of the user’s stress duration where the measured stress score was in the low range (26-50).</p>
175
176<h3 class="h3">Activity_summary.medium_stress_duration</h3>
177<ul class="list-wrapper">
178 <li class="list">Type: Int</li>
179 <li class="list">Unit: Seconds</li>
180 <li class="list">Example: 2280</li>
181</ul><p class="description">The portion of the user’s stress duration where the measured stress score was in the medium range (51-75).</p>
182
183<h3 class="h3">Activity_summary.high_stress_duration</h3>
184<ul class="list-wrapper">
185 <li class="list">Type: Int</li>
186 <li class="list">Unit: Seconds</li>
187 <li class="list">Example: 2820</li>
188</ul><p class="description">The portion of the user’s stress duration where the measured stress score was in the high range (76-100).</p>
189
190<h3 class="h3">Activity_summary.provider_timestamp</h3>
191<ul class="list-wrapper">
192 <li class="list">Type: String</li>
193 <li class="list">Format: Date, YYYY-MM-DDThh:mm:ss</li>
194 <li class="list">Example: 2022-04-22T12:00:00</li>
195</ul><p class="description">Provider Timestamp in YYYY-MM-DDThh:mm:ss format.</p>
196
197<h3 class="h3">Activity_summary.source</h3>
198<ul class="list-wrapper">
199 <li class="list">Type: String</li>
200 <li class="list">Example: fitbit</li>
201</ul><p class="description">Source the data has come from</p>
202