09-08-2020 02:48
09-08-2020 02:48
With reference from https://dev.fitbit.com/build/reference/web-api/heart-rate/
API GET https://api.fitbit.com/1/user/[user-id]/activities/heart/date/[date]/[period].json
We have noticed that the above API returns an incorrect heart rate log of 1440 minutes (24hrs) even though tracker was not worn.
Example of response returned: https://imgur.com/a/if1dinQ
What could be wrong here?
09-08-2020 16:10
09-08-2020 16:10
Hi @hi_SG
That is correct. For accounts that have a device supporting heart rate, we record the time of 1440 minutes even if the device was not worn for the "out of range" zone. You'll see the caloriesOut has a value. We calculate the minimum number of calories your body would burn at rest based on your biometric data entered. Since you're not wearing the device, we're assuming your body is still burning calories and you still have a heart rate. We put that information in the "out of range" heart rate zone.
09-08-2020 18:26
09-08-2020 18:26
Hi @Gordon-C, thanks for the prompt reply.
Is this something new? Previously we were getting the caloriesOut and minutes being undefined when the user did not wear the tracker.
{
"max" : 90,
"min" : 30,
"name" : "Out of Range"
},
How can I then determine if the user has legitimately worn the device?
09-10-2020 09:27
09-10-2020 09:27
I know this has been the API response for a while. What are you trying to achieve that requires knowing if a user legitimately worn a device?
09-13-2020 14:29
09-13-2020 14:29
Hi @hi_SG
The only way I was able to generate the output you have for heart rate is to remove all devices of the account, including MobileTrack. Probably the best way to determine if some is not wearing a device is to look at the activity data. If you see sedentaryMinutes = 1440 and steps = 0, then you can assume the user is not wearing the device.
09-22-2020 20:15 - edited 09-22-2020 20:15
09-22-2020 20:15 - edited 09-22-2020 20:15
Hi Gordon, thanks for your reply,
We are looking for two things in particular
1. See if the user has worn the device for a given day.
2. Calculate the total wear time (For how long the user wear the device) for a user for a given day in minutes ( and not just to see if the user has worn the device)
For 1, we could consider relying on the activity data to see if sedentaryMinutes = 1440 and steps =0 , but this could also happen if the user is resting / sleeping or having bed rest for the day , such that the is no steps?
For 2, Do you have any suggestions ? Could we maybe consider the intra day heart rate data to determine (a non zero value) to see if a minute should be counted ? Or does the heart rate intra day also get set even if the user is not wearing the device ?
09-23-2020 00:53 - edited 09-23-2020 00:53
09-23-2020 00:53 - edited 09-23-2020 00:53
From observation it seem like activities-heart-intraday.dataset will be an empty array if user did not wear the tracker. Seem like just checking the length of the activities-heart-intraday.dataset array might be a better approach to get the legitimate wear time. Can you confirm if this approach will be good @Gordon-C ?
09-28-2020 02:18
09-28-2020 02:18
@Gordon-C Could you help to confirm that having non empty activities-heart-intraday.dataset can be used as the indicator that user did wear the tracker and use it for calculating the wear time ?
10-02-2020 10:13
10-02-2020 10:13
Hi @hi_SG,
Sorry for the delay. I'm trying to determine if there is an absolute method for determining when someone is wearing a Fitbit device. There isn't an endpoint that returns this information, so I'm trying to make a determination based on my own data. Unfortunately, I'm not coming up with much.
Probably the best way would be put some restrictions on your program.
With these restrictions, you could use the Heart Rate Intraday endpoints to see if the heart beat data is collected throughout the day signifying the participant is wearing their device. The reasons for these restrictions are:
10-04-2020 22:05 - edited 10-05-2020 22:42
10-04-2020 22:05 - edited 10-05-2020 22:42
Hi @Gordon-C Thanks for your reply.
From the program perspective our users are issued devices such as Ionic and Inspire which support Heart Rate data. Users are further advised to use only one device and not their personal device.
On Restricting usage of the Fitbit MobileTrack
I am guessing that we will have to continuously keep checking the /devices api as users could set this up at any time. It might also be a sequential step to first verify /devices and then to obtain health data. I'm a bit cautious of this approach given the extra effort and edge cases. Would there be other preventive approaches?
Could I also double check if the Fitbit MobileTrack only captures steps (using pedometer) and the Heart Rate will only come from a tracker device ? (I am assuming yes, based on your previous reply, just wanted to sure on this)
10-10-2020 19:15
10-10-2020 19:15
Hi @hi_SG
The best way to determine if a user has MobileTrack enabled is to use the Get Devices endpoint to see what devices are paired with the account. This endpoint will also state when the user last synced their device, so that information might be useful for you.
It is not technically possible to send heart rate data to a user's accounts through MobileTrack or a 3rd party application. So, all heart rate data will come from the device. This article will tell you what information is recorded by the mobile app/MobileTrack.
10-11-2020 19:13
10-11-2020 19:13
Hi @Gordon-C ,
Thanks for that clarification on MobileTrack. We'll not be using this in our research programme, and affected participants have noted that they are not using it either.
Back to the original topic : Due to the incorrect 1440 minutes in heart rate zones, would using intraday-heart-rate be the most efficient way to track duration HR trackers are worn? Or are there other options since heart rate zones should not be used?
Available Options:
10-12-2020 14:44
10-12-2020 14:44
For your specific use case, checking the output of the Intraday heart rate endpoint could be used to see if the device is being worn.