Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FITBIT web api for activities return empty array for activities Options

ANSWERED

we are trying to read fitbit activity data for authorised user, using FITBIT WEB API, IMPLICIT FLOW WITH Client Authorisation for this we are using.

 

1. Activity data and summary

https://api.fitbit.com/1/user/-/activities/date/2017-10-27.json

 

{
"activities": [],
"goals": {
"activeMinutes": 30,
"caloriesOut": 2717,
"distance": 5.05,
"floors": 10,
"steps": 6000
},
"summary": {
"activeScore": -1,
"activityCalories": 811,
"calorieEstimationMu": 2100,
"caloriesBMR": 1643,
"caloriesOut": 2349,
"caloriesOutUnestimated": 2349,
"distances": [{
"activity": "total",
"distance": 5.47
}, {
"activity": "tracker",
"distance": 5.47
}, {
"activity": "loggedActivities",
"distance": 0
}, {
"activity": "veryActive",
"distance": 0.06
}, {
"activity": "moderatelyActive",
"distance": 0.87
}, {
"activity": "lightlyActive",
"distance": 4.53
}, {
"activity": "sedentaryActive",
"distance": 0
}],
"elevation": 18.29,
"fairlyActiveMinutes": 15,
"floors": 6,
"heartRateZones": [{
"caloriesOut": 74.1715,
"max": 93,
"min": 30,
"minutes": 62,
"name": "Out of Range"
}, {
"caloriesOut": 1426.375,
"max": 130,
"min": 93,
"minutes": 645,
"name": "Fat Burn"
}, {
"caloriesOut": 13.46498,
"max": 158,
"min": 130,
"minutes": 2,
"name": "Cardio"
}, {
"caloriesOut": 0,
"max": 220,
"min": 158,
"minutes": 0,
"name": "Peak"
}],
"lightlyActiveMinutes": 168,
"marginalCalories": 438,
"restingHeartRate": 95,
"sedentaryMinutes": 1256,
"steps": 7618,
"useEstimation": true,
"veryActiveMinutes": 1
}
}

 

Here: "activities": [] is always empty where as the fitbit doc says it must have the list of activities recorded. 

 

2. Activity Log

https://api.fitbit.com/1/user/-/activities/list.json?afterDate=2017-10-27&sort=asc&offset=0&limit=20

 

in this api we are not getting distance information for activity with "auto-detect" key values.

 

Kindly provide solution for the same as we need to read the summary and activity details of user who authorize fitbit implicit flow.

 

Regards,

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@lior.inbar

 

You will need to use the Activity Timeseries API documented here - https://dev.fitbit.com/build/reference/web-api/activity/#activity-time-series but also need intraday data access. See the "Get Activity Intraday Time Series" section for details about getting access to intraday data.

View best answer in original post

Best Answer
4 REPLIES 4
Best Answer
0 Votes

Sorry for the confusion, but the term "Activity" here has a specific meaning and is different from general user "activeness" throughout the day (which is represented in the summary section).

 

An "activity" (one that will show up in the "activities": array response value) represents a recorded activity such as a workout or a run that was either started/stopped manually or automatically detected and logged. Normal actions, such as walking that aren't explicitly marked by the user as a named activity (ie yoga, running, weightlifting) will not show up as an activity in this API.

 

Please let me know if I misunderstood your question or you have further questions.

 

Thanks,

Chris

Best Answer
0 Votes

Thank you @ChrisMFitbit for your reply,

So let me just make sure I understand:  If we want to know the user's number of steps per hour, we should use another API for that or does this resolution is simply not provided?

thanks,

Lior

 

Best Answer
0 Votes

@lior.inbar

 

You will need to use the Activity Timeseries API documented here - https://dev.fitbit.com/build/reference/web-api/activity/#activity-time-series but also need intraday data access. See the "Get Activity Intraday Time Series" section for details about getting access to intraday data.

Best Answer