Metrics
API Version 2 (V2)
Daily Glucose
You can retrieve user glucose data by user_id and filter by date range
Get a glucose 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
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/glucose/?user_id=fa1e3803-6068-4ea7-9788-eccce210daa1&start_date=2020-05-01&end_date=2020-05-01"
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-01",
5 "type":"glucose",
6 "source":[
7 {
8 "name":"dexcom",
9 "status":"ok"
10 }
11 ],
12 "data":[
13 {
14 "date":"2020-05-01",
15 "avg_value":108.0,
16 "min_value":106.0,
17 "max_value":121.0,
18 "unit":"mg/dL",
19 "source":"dexcom",
20 "timezone_offset":0,
21 "intraday_data":[
22 {
23 "time":"2020-05-01T17:52:00",
24 "value":50.0,
25 "realtime_value":121.0,
26 "smoothed_value":122.0,
27 "status":"high",
28 "trend":"flat",
29 "trend_rate":-0.5,
30 "source":null
31 },
32 {
33 "time":"2020-05-01T17:52:00",
34 "value":50.0,
35 "realtime_value":121.0,
36 "smoothed_value":122.0,
37 "status":"high",
38 "trend":"flat",
39 "trend_rate":-0.5,
40 "source":null
41 }
42 ],
43 "extra": null
44 }
45 ]
46}
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
33<h3 class="h3">Glucose.date</h3>
34<ul class="list-wrapper">
35 <li class="list">Type: String</li>
36 <li class="list">Format: Date, YYYY-MM-DD</li>
37 <li class="list">Example: 2023-02-04</li>
38</ul>
39<p class="description">Date of the record</p>
40
41<h3 class="h3">Glucose.min_value</h3>
42<ul class="list-wrapper">
43 <li class="list">Type: Float</li>
44 <li class="list">Example: 106.0</li>
45</ul>
46<p class="description">Minimum glucose value</p>
47
48<h3 class="h3">Glucose.avg_value</h3>
49<ul class="list-wrapper">
50 <li class="list">Type: Float</li>
51 <li class="list">Example: 108.0</li>
52</ul>
53<p class="description">Average glucose value</p>
54
55<h3 class="h3">Glucose.max_value</h3>
56<ul class="list-wrapper">
57 <li class="list">Type: Float</li>
58 <li class="list">Example: 121.0</li>
59</ul>
60<p class="description">Maximum glucose value</p>
61
62<h3 class="h3">Glucose.unit</h3>
63<ul class="list-wrapper">
64 <li class="list">Type: String</li>
65 <li class="list">Example: mg/dL</li>
66</ul>
67<p class="description">Unit of measurement for glucose value</p>
68
69<h3 class="h3">Glucose.source</h3>
70<ul class="list-wrapper">
71 <li class="list">Type: String</li>
72 <li class="list">Example: fitbit</li>
73</ul>
74<p class="description">Data source</p>
75
76<h3 class="h3">Glucose.timezone_offset</h3>
77<ul class="list-wrapper">
78 <li class="list">Type: Float</li>
79 <li class="list">Example: 0.0</li>
80</ul>
81<p class="description">Timezone offset</p>
82
83<h3 class="h3">Glucose.intraday_data.time</h3>
84<ul class="list-wrapper">
85 <li class="list">Type: String</li>
86 <li class="list">Format: Date time, YYYY-MM-DDThh:mm:ss</li>
87 <li class="list">Example: 2022-03-05T17:52:00</li>
88</ul>
89<p class="description">Time of the intraday glucose record</p>
90
91<h3 class="h3">Glucose.intraday_data.value</h3>
92<ul class="list-wrapper">
93 <li class="list">Type: Float</li>
94 <li class="list">Example: 50.0</li>
95</ul>
96<p class="description">Glucose value</p>
97
98<h3 class="h3">Glucose.intraday_data.realtime_value</h3>
99<ul class="list-wrapper">
100 <li class="list">Type: Float</li>
101 <li class="list">Example: 121.0</li>
102</ul>
103<p class="description">Estimated glucose value presented on receiving device in realtime</p>
104
105<h3 class="h3">Glucose.intraday_data.smoothed_value</h3>
106<ul class="list-wrapper">
107 <li class="list">Type: Float</li>
108 <li class="list">Example: 122.0</li>
109</ul>
110<p class="description">Estimated glucose value presented retrospectively on receiving device after smoothing</p>
111
112<h3 class="h3">Glucose.intraday_data.status</h3>
113<ul class="list-wrapper">
114 <li class="list">Type: String</li>
115 <li class="list">Example: "high"</li>
116</ul>
117<p class="description">Explanation of the glucose record; used when the value field is outside the measuring range.</p>
118
119<h3 class="h3">Glucose.intraday_data.trend</h3>
120<ul class="list-wrapper">
121 <li class="list">Type: String</li>
122 <li class="list">Example: flat</li>
123</ul>
124<p class="description">General trend of the glucose value movement</p>
125
126<h3 class="h3">Glucose.intraday_data.trend_rate</h4>
127<ul class="list-wrapper">
128 <li class="list">Type: Float</li>
129 <li class="list">Example: -0.5</li>
130</ul>
131<p class="description">Rate at which glucose value is moving up or down</p>
132
133<h3 class="h3">Glucose.intraday_data.source</h4>
134<ul class="list-wrapper">
135 <li class="list">Type: String</li>
136 <li class="list">Example: "unique_example"</li>
137</ul>
138<p class="description">Measurement device identifier</p>
139
140<h3 class="h3">Glucose.extra</h4>
141<ul class="list-wrapper">
142 <li class="list">Type: List</li>
143 <li class="list">Example: ["extra_key": "extra_value"]</li>
144</ul>
145<p class="description">List of extra information key-value pairs</p>
146