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

Activity Enpoint Retuning Data before date bracelet was registered

Hello,

 

I am pulling activity data out of the Activity EndPoint.

 

So for example, here I am asking for activity data for 17th March 2016

 

https://api.fitbit.com/1/user/4DFGVL/activities/date/2016-03-17.json

 

And the API is returning data.. ActiveMinutes=30, CaloriesOut=2500 and a ton of other data.

 

BUT. I didn't even own a bracelet on that date.

 

I don't understand where this data is coming from?

 

Can anyone help please?

 

Trev

Best Answer
0 Votes
7 REPLIES 7

@TrevorJDaniel I think you're referring to this:

 

"goals": {
    "activeMinutes": 30,
    "caloriesOut": 3000,
    "distance": 8.05,
    "floors": 10,
    "steps": 10000

Even if you don't have a tracker, those goals are there by default. The rest of the data returned (or the majority of it) should be zeros since you didn't have a tracker or any logged activities.

 

Hope that helps. Robot Happy

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

Hi Andrew,

 

Thanks for the reply.

 

I am pulling out activity data and pushing it into an offline database for further analysis.

 

Which of the return values, or combination, would you recommend using to determine that there were no activities?

 

I notice and "ActivitiesScore" with a value of -1. Would that be a good "flag" to use?

 

Trev

Best Answer
0 Votes

@TrevorJDaniel If you're strictly looking for activities, then I would check the size of the 'activities' array. Keep in mind there could still be tracker data even if no activities are listed. Here's an example response from my account using this endpoint: https://api.fitbit.com/1/user/-/activities/date/2016-03-24.json

 

{
  "activities": [],
  "goals": {},
  "summary": {
    "activeScore": -1,
    "activityCalories": 444,
    "caloriesBMR": 1599,
    "caloriesOut": 1954,
    "distances": [
      {
        "activity": "total",
        "distance": 3.73
      },
      {
        "activity": "tracker",
        "distance": 3.73
      },
      {
        "activity": "loggedActivities",
        "distance": 0
      },
      {
        "activity": "veryActive",
        "distance": 2.45
      },
      {
        "activity": "moderatelyActive",
        "distance": 0.53
      },
      {
        "activity": "lightlyActive",
        "distance": 0.71
      },
      {
        "activity": "sedentaryActive",
        "distance": 0
      }
    ],
    "elevation": 0,
    "fairlyActiveMinutes": 12,
    "floors": 0,
    "lightlyActiveMinutes": 40,
    "marginalCalories": 294,
    "sedentaryMinutes": 1360,
    "steps": 5038,
    "veryActiveMinutes": 28
  }
}

 

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

@TrevorJDaniel wrote:

I notice and "ActivitiesScore" with a value of -1. Would that be a good "flag" to use?


No, that's a field for a feature that has been removed, so it just returns -1.

Best Answer
0 Votes

Hi Jeremiah,

 

Thanks for your responses.

 

We have been having a chat here and have come up with a possible solution for our situation.

 

Basically, we need to, based on the responses from the activities, heart and sleep endpoints, decide whether a user has synced their data...

 

What do you think about using the "SedentaryMinutes" in the Activities Summary?

 

If the value = 1440 (24hours) then the user hasn't synced their bracelet?

 

This seems to make sense to us but would love your thoughts?

 

Trev

Best Answer
0 Votes

Does anyone have any thoughts on this please?

 

I have been using the SedentaryMinutes = 1440 to determine if a bracelet hasn't been synced.

 

I have just had an API response for a day where SedentaryMinutes = 1440 but the user also has 30 activeMinutes...??

 

How can someone be Sedentary for all 24 hours but have done 30 activeMinutes, 2769 caloriesOut with a distance of 8.05 miles??

 

I need some way to determine if someone hasn't synced for that particular day?

 

Any ideas guys?

 

Trev

Best Answer
0 Votes

To see when a person last synced their device, use the Get Devices endpoint, which contains lastSyncTime.

Best Answer
0 Votes