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
Params
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
|
curl -X GET \ 'https://api.spikeapi.com/v2/metrics/glucose/?user_id=282812818&start_date=2020-05-01&end_date=2020-05-03' \ -H 'x-spike-auth: fa0b3803-1111-2222-9788-eccce210d30c'
RESPONSES
200
|
{ "user_id": "19291291291", "start_date": "2020-05-01", "end_date": "2020-05-03", "type": "glucose", "source": [ { "name": "fitbit", "status": "ok" } ], "data": [ { "date": "2023-02-04", "avg_value": 108.0, "unit": "mg/dL", "source": "fitbit", "intraday_data": [ { "time": "2022-03-05T17:52:00", "value": 50.0, "realtime_value": 121.0, "smoothed_value": 122.0, "status": "high", "trend": "flat", "trend_rate": -0.5 }, { "time": "2022-03-05T17:52:00", "value": 50.0, "realtime_value": 121.0, "smoothed_value": 122.0, "status": "high", "trend": "flat", "trend_rate": -0.5 } ] } ] }
<style> @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap'); .h2, .h3, .list, .description{ font-family: 'Poppins', sans-serif; font-weight: 500; } .h2 { margin-top: -20px; margin-bottom: 20px; font-size: 30px; } .h3 { font-size: 22px; margin-top: -20px; } .list-wrapper { white-space: normal; margin-top: -10px; } .list, .description { font-size: 14px; } </style> <h2 class="h2">Fields</h2> <h3 class="h3">Glucose.date</h3> <ul class="list-wrapper"> <li class="list">Type: String</li> <li class="list">Format: Date, YYYY-MM-DD</li> <li class="list">Example: 2023-02-04</li> </ul> <p class="description">Date of the record</p> <h3 class="h3">Glucose.avg_value</h3> <ul class="list-wrapper"> <li class="list">Type: Float</li> <li class="list">Example: 108.0</li> </ul> <p class="description">Average glucose value</p> <h3 class="h3">Glucose.unit</h3> <ul class="list-wrapper"> <li class="list">Type: String</li> <li class="list">Example: mg/dL</li> </ul> <p class="description">Unit of measurement for glucose value</p> <h3 class="h3">Glucose.source</h3> <ul class="list-wrapper"> <li class="list">Type: String</li> <li class="list">Example: fitbit</li> </ul> <p class="description">Data source</p> <h3 class="h3">Glucose.intraday_data.time</h3> <ul class="list-wrapper"> <li class="list">Type: String</li> <li class="list">Format: Date time, YYYY-MM-DDThh:mm:ss</li> <li class="list">Example: 2022-03-05T17:52:00</li> </ul> <p class="description">Time of the intraday glucose record</p> <h3 class="h3">Glucose.intraday_data.value</h3> <ul class="list-wrapper"> <li class="list">Type: Float</li> <li class="list">Example: 50.0</li> </ul> <p class="description">Glucose value</p> <h3 class="h3">Glucose.intraday_data.realtime_value</h3> <ul class="list-wrapper"> <li class="list">Type: Float</li> <li class="list">Example: 121.0</li> </ul> <p class="description">Estimated glucose value presented on receiving device in realtime</p> <h3 class="h3">Glucose.intraday_data.smoothed_value</h3> <ul class="list-wrapper"> <li class="list">Type: Float</li> <li class="list">Example: 122.0</li> </ul> <p class="description">Estimated glucose value presented retrospectively on receiving device after smoothing</p> <h3 class="h3">Glucose.intraday_data.status</h3> <ul class="list-wrapper"> <li class="list">Type: String</li> <li class="list">Example: "high"</li> </ul> <p class="description">Explanation of the glucose record; used when the value field is outside the measuring range.</p> <h3 class="h3">Glucose.intraday_data.trend</h3> <ul class="list-wrapper"> <li class="list">Type: String</li> <li class="list">Example: flat</li> </ul> <p class="description">General trend of the glucose value movement</p> <h3 class="h4">Glucose.intraday_data.trend_rate</h4> <ul class="list-wrapper"> <li class="list">Type: Float</li> <li class="list">Example: -0.5</li> </ul> <p class="description">Rate at which glucose value is moving up or down</p>