An Activity segment is a discrete workout with a start time and an end time.
Activity Summaries are an overview of an individual's activity for a 24 hour period (midnight - midnight based on the users timezone).
The same is true for all periodic data types, including sleep. See more information on accessing this type of data here.
Additionally, to see what type of data is returned by each source, see the Data Network page. You can retrieve demo data from many sources or view payload examples in the side bar of the API Reference.
Getting Daily Totals
An activity summary will always have the full day's worth of data, while individual activities are snapshots of what happened throughout a day but do not necessarily sum to the activity summary. Thus, there is no need to sum up the values counted in individual Activity records if the value is also contained in an Activity Summary.
Take Fitbit for example:
{
"calories": 2827,
"createdAt": "2015-11-08T01:06:16.244Z",
"date": "2015-11-08",
"distance": 9720,
"duration": 17400,
"humanId": "",
"id": "",
"light": 187,
"moderate": 39,
"sedentary": 722,
"source": "fitbit",
"sourceData": {
"tracker": {
"calories": 2246,
"distance": 6767.98,
"elevation": 0,
"floors": 0,
"steps": 8921
}
},
"steps": 12245,
"timeSeries": {},
"updatedAt": "2015-11-09T12:01:16.625Z",
"vigorous": 64
}
You'll see that in "sourceData" there is an object called "tracker", which is the direct input we get from Fitbit. This object quotes what the device reported for that day, showing 8921 steps. In contrast, the steps property outside of "sourceData" shows 12245 steps. This is because we have added steps from the user's manually-entered activity segments to the tracker steps value to get the full days worth of steps taken.
Comments
0 comments
Article is closed for comments.