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

Possible to get all data in one call like activites/tracker

Hi

 

I try to get all activities/tracker data in one call instead of 7 or so separate calls. But I receive an error as response saying that it is not possible. So you would like to do this:

 

https://api.fitbit.com/1/user/-/activities/tracker/date/2014-09-21/1d.json

 

but now i have to do this for each item which casues a FitBit Rate limit error rather quickly 😞

 

https://api.fitbit.com/1/user/-/activities/tracker/calories/date/2014-09-21/1d.json

https://api.fitbit.com/1/user/-/activities/tracker/steps/date/2014-09-21/1d.json

https://api.fitbit.com/1/user/-/activities/tracker/steps/distance/2014-09-21/1d.json

etc .....

 

 

Thanks Peter

Best Answer
0 Votes
8 REPLIES 8

Hello,

Please check out this page: https://wiki.fitbit.com/display/API/API-Get-Activity-Stats

is seems to have what are you looking for.

 

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

see next post for better format

Best Answer
0 Votes

The call is:

https://api.fitbit.com/1/user/-/activities/date/"2014-09-20".json

I know for sure there is Fitbit Tracker data for that date.

Is your documentation incorrect or is my call incorrect?

{
"summary": {
"fairlyActiveMinutes": 187,
"caloriesBMR": 1809,
"marginalCalories": 800,
"sedentaryMinutes": 724,
"lightlyActiveMinutes": 291,
"activityCalories": 1844,
"steps": 11641,
"veryActiveMinutes": 2,
"distances": [
{
"distance": 8.22,
"activity": "total"
},
{
"distance": 8.22,
"activity": "tracker"
},
{
"distance": 0,
"activity": "loggedActivities"
},
{
"distance": 0.13,
"activity": "veryActive"
},
{
"distance": 5.52,
"activity": "moderatelyActive"
},
{
"distance": 2.57,
"activity": "lightlyActive"
},
{
"distance": 0,
"activity": "sedentaryActive"
}
],
"caloriesOut": 3133,
"activeScore": -1
},
"goals": {
"activeMinutes": 30,
"distance": 8.05,
"steps": 10000,
"caloriesOut": 2184
},
"activities": []
}

Best Answer
0 Votes

When you look on the Fitbit.com web site, do you see activities logged for that account?

 

PM me the email address for the account and I can help you take a look.

Best Answer
0 Votes

I looked at the account you private messaged me. The reason those events do not show up on the activity log is they are activity annotations. Unfortunately annotations aren't part of activity logs at this time.

Best Answer
0 Votes

Ok a bit puzzled now. So i have to stick to calls like below in order to get the Fitbit tracker data per day?

 

https://api.fitbit.com/1/user/-/activities/tracker/calories/date/2014-09-21/1d.json
https://api.fitbit.com/1/user/-/activities/tracker/steps/date/2014-09-21/1d.json
etc....

 

The big issue is that i hit the Fitbit rate limit very quikcly because i make 7 or more calls just to get the Fitbit tracker data for just one day. Not very efficient.

 

Any chance you can update the API to have a call like this which returns all tracker data for one day

https://api.fitbit.com/1/user/-/activities/tracker/date/2014-09-21/1d.json

 

Best Answer
0 Votes

@myfitnesscomp wrote:

Ok a bit puzzled now. So i have to stick to calls like below in order to get the Fitbit tracker data per day?

 

https://api.fitbit.com/1/user/-/activities/tracker/calories/date/2014-09-21/1d.json
https://api.fitbit.com/1/user/-/activities/tracker/steps/date/2014-09-21/1d.json
etc....

 

The big issue is that i hit the Fitbit rate limit very quikcly because i make 7 or more calls just to get the Fitbit tracker data for just one day. Not very efficient.

 

Any chance you can update the API to have a call like this which returns all tracker data for one day

https://api.fitbit.com/1/user/-/activities/tracker/date/2014-09-21/1d.json

 


It sounds like you should be able to get most of that data from:

https://wiki.fitbit.com/display/API/API-Get-Activities for a particular day.

The summary object contains calories, steps, distance, etc.

Best Answer
0 Votes

Yes that one is better! It gives the info i needed. Thanks!

Best Answer
0 Votes