website logo
⌘K
Quickstart
User
Metrics
Webhooks
Mobile SDK
V2
React Native
Flutter
Android (Kotlin)
Swift
V1
Errors
FAQ
Docs powered by
Archbee
Metrics
API Version 1 (V1)

Daily Calories

You can retrieve user calories data by user_id and filter by date range


Get a calories 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
|
import requests

url = "https://api.spikeapi.com/metrics/calories/?user_id=282812818&start_date=2020-05-01&end_date=2020-05-03"
headers = {}
headers['x-spike-auth'] = 'fa0b3803-1111-2222-9788-eccce210d30c'
response = requests.request("GET", url, headers=headers)

print(response.text)
RESPONSES
200
|
{
    "user_key": "19291291291",
    "start_date": "2020-05-01",
    "end_date": "2020-05-03",
    "type": "calories",
    "sources": [
        {
            "name": "fitbit",
            "status": "ok"
        }
    ],
    "data": [
        {
            "date": "2020-05-01",
            "value": 1234,
            "intraday_data": [
                {
                    "level": 0,
                    "mets": 10,
                    "time": "2022-05-01T00:00:00",
                    "value": 1.21
                },
                {
                    "level": 0,
                    "mets": 10,
                    "time": "2022-05-01T00:01:00",
                    "value": 1.27
                }
            ]
            "source": "fitbit"
        }
    ]
} 

<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">Calories.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: 2020-05-01</li>
</ul><p class="description">Date of measurement. For Whoop, date when the cycle ended</p>

<h3 class="h3">Calories.value</h3>
<ul class="list-wrapper">
    <li class="list">Type: Int</li>
    <li class="list">Unit: kcal</li>
    <li class="list">Example: 2321</li>
</ul><p class="description">Estimated calories per day</p>

<h3 class="h3">Calories.intraday_data.level</h3>
<ul class="list-wrapper">
    <li class="list">Type: Int</li>
    <li class="list">Example: 1</li>
</ul><p class="description">Numerical value representing the user's activity-level at the moment when the resource was recorded.
0 = sedentary
1 = lightly active
2 = fairly/moderately active
3 = very active</p>

<h3 class="h3">Calories.intraday_data.mets</h3>
<ul class="list-wrapper">
    <li class="list">Type: Int</li>
    <li class="list">Example: 10</li>
</ul><p class="description">Metabolic Equivalent of Task (MET) - One MET equals 1 calorie per kilogram of body weight per hour. One MET is equivalent to the amount of energy a person would expend sitting quietly and doing nothing.</p>

<h3 class="h3">Calories.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-02-19T00:00:15</li>
</ul><p class="description">The time of the measurement</p>

<h3 class="h3">Calories.intraday_data.value</h3>
<ul class="list-wrapper">
    <li class="list">Type: Float</li>
    <li class="list">Example: 10.54</li>
</ul><p class="description">Estimated calories</p>

<h3 class="h3">Calories.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>





Did this page help you?
PREVIOUS
Sleep
NEXT
Daily Distance
Docs powered by
Archbee
Get Calories data
TABLE OF CONTENTS
GET
Get Calories data
Docs powered by
Archbee