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

Fitbit API only returns activities logged in MyFitnessPal

ANSWERED

I have synced fitbit with MyFitnessPal. I'm no longer getting my fitbit activity data unless it was entered into MyFitnessPal. I want all activities recorded by MyFitnessPal and Fitbit.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@LaceyDomo: You're using the daily activity summary endpoint. Instead, you need to use the Activity Logs List endpoint to get all exercise logs.

View best answer in original post

Best Answer
12 REPLIES 12

Hello @LaceyDomo! According on how was developed the API by MyFitnessPal, as your title described, only exercise logged in MFP will be transfer to Fitbit, however exercises logged in Fitbit wont be share to MFP.

 

Many of third party integration are not under our control as you might know since is the third party developer who uses our open API, so its  harder to implement changes on other apps since we don't have access to their data.

 

At the moment there is one idea in our Suggestion board similar to your feedback. If this is something in which you're interested, please visit this feature suggestion and contribute with your vote and comments. This is a great way to let our developers know what you'd like to see in the future!

 

See you around and thank you for your Feedback.

Roberto | Community Moderator

"Great things are done by a series of small things brought together.” What's Cooking?

Best Answer
0 Votes

@RobertoME I am not sure if you understand the issue. I have succesfully synced MyFitnessPal to Fitbit. But now when I make a request to the Fitbit API for my activities, it is only returning activities that were logged by MyFitnessPal. I am no longer recieving activities that I logged using my Fitbit account. 

Best Answer
0 Votes

@LaceyDomo Okay, I'll need three things from you then:

1. userID

2. endpoint you're hitting

3. response you're getting

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

@AndrewFitbit

 

userID: 4VCP7S

 

endpoint: https://api.fitbit.com/1/user/-/activities/date/2017-02-04.json

 

response: 

{
  "activities": [],
  "goals": {
    "activeMinutes": 90,
    "caloriesOut": 3200,
    "distance": 14.48,
    "floors": 15,
    "steps": 15000
  },
  "summary": {
    "activeScore": -1,
    "activityCalories": 2528,
    "caloriesBMR": 1795,
    "caloriesOut": 3900,
    "distances": [
      {
        "activity": "total",
        "distance": 16.24
      },
      {
        "activity": "tracker",
        "distance": 16.24
      },
      {
        "activity": "loggedActivities",
        "distance": 0
      },
      {
        "activity": "veryActive",
        "distance": 10.15
      },
      {
        "activity": "moderatelyActive",
        "distance": 1.2
      },
      {
        "activity": "lightlyActive",
        "distance": 4.89
      },
      {
        "activity": "sedentaryActive",
        "distance": 0
      }
    ],
    "elevation": 88.39,
    "fairlyActiveMinutes": 31,
    "floors": 29,
    "heartRateZones": [
      {
        "caloriesOut": 2472.25712,
        "max": 92,
        "min": 30,
        "minutes": 1193,
        "name": "Out of Range"
      },
      {
        "caloriesOut": 869.37884,
        "max": 129,
        "min": 92,
        "minutes": 97,
        "name": "Fat Burn"
      },
      {
        "caloriesOut": 356.65226,
        "max": 157,
        "min": 129,
        "minutes": 28,
        "name": "Cardio"
      },
      {
        "caloriesOut": 29.17044,
        "max": 220,
        "min": 157,
        "minutes": 2,
        "name": "Peak"
      }
    ],
    "lightlyActiveMinutes": 268,
    "marginalCalories": 1660,
    "restingHeartRate": 57,
    "sedentaryMinutes": 529,
    "steps": 20801,
    "veryActiveMinutes": 114
  }
}

 

Here is a screen shot from the fitbit UI showing logged activities. As you can see, there are 4 logged activities on Feb 4th. 

Best Answer
0 Votes

@LaceyDomo I can't see the image but I know exactly why you can't see those activities for Feb 4th. Two of the activities are SmartTrack, the other two are Workouts (both of which will not appear in the summary). You'll need to use the Get Activity Logs List endpoint to see those activities. Try this for example:

 

https://api.fitbit.com/1/user/-/activities/list.json?limit=10&sort=desc&beforeDate=2017-02-05&offset=0

That should work.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

@AndrewFitbit I am not seeing any activities that were logged into fitbit. Even those that weren't smart tracked or workouts. Only MyFitnessPal activities.

 

For example, on Feb 3rd there were 5 activities logged. Dog walk, stairclimber, stairclimber, elliptical and weights. However, these are not returned by https://api.fitbit.com/1/user/-/activities/date/2017-02-03.json 

 

Response: 

{
  "activities": [],
  "goals": {
    "activeMinutes": 90,
    "caloriesOut": 3200,
    "distance": 14.48,
    "floors": 15,
    "steps": 15000
  },
  "summary": {
    "activeScore": -1,
    "activityCalories": 2514,
    "caloriesBMR": 1795,
    "caloriesOut": 4001,
    "distances": [
      {
        "activity": "total",
        "distance": 16.5
      },
      {
        "activity": "tracker",
        "distance": 16.5
      },
      {
        "activity": "loggedActivities",
        "distance": 0
      },
      {
        "activity": "veryActive",
        "distance": 11.37
      },
      {
        "activity": "moderatelyActive",
        "distance": 0.88
      },
      {
        "activity": "lightlyActive",
        "distance": 4.25
      },
      {
        "activity": "sedentaryActive",
        "distance": 0
      }
    ],
    "elevation": 88.39,
    "fairlyActiveMinutes": 31,
    "floors": 29,
    "heartRateZones": [
      {
        "caloriesOut": 2238.94853,
        "max": 92,
        "min": 30,
        "minutes": 1237,
        "name": "Out of Range"
      },
      {
        "caloriesOut": 1274.75075,
        "max": 129,
        "min": 92,
        "minutes": 152,
        "name": "Fat Burn"
      },
      {
        "caloriesOut": 419.14054,
        "max": 157,
        "min": 129,
        "minutes": 34,
        "name": "Cardio"
      },
      {
        "caloriesOut": 28.42476,
        "max": 220,
        "min": 157,
        "minutes": 2,
        "name": "Peak"
      }
    ],
    "lightlyActiveMinutes": 211,
    "marginalCalories": 1755,
    "restingHeartRate": 56,
    "sedentaryMinutes": 566,
    "steps": 19431,
    "veryActiveMinutes": 121
  }
}

 

 

Last Weeks Workouts - Tracked in FitBit UI only.png

Best Answer
0 Votes

@LaceyDomo: You're using the daily activity summary endpoint. Instead, you need to use the Activity Logs List endpoint to get all exercise logs.

Best Answer

@JeremiahFitbit shouldn't I be seeing the activities I mentioned above in the daily activity summary endpoint?

Best Answer
0 Votes

@LaceyDomo: No, this is intentional. Only manually logged activities appear in the Get Daily Activity Summary endpoint. To retrieve all activity exercise logs, you need to use the Get Activity Logs List endpoint.

 

We would remove the manual activity logs from the Daily Summary endpoint, but it would be a breaking change, so they've been left in for now.

Best Answer
0 Votes

I have another fitbit account for reference. This activity was logged the same way as a dog walk was logged for user 4VCP7S. What is different for it to be showing up on this account?

 

userID: 38NNH9

 

endpoint: https://api.fitbit.com/1/user/-/activities/date/2017-02-15.json

 

response: 

{
  "activities": [
    {
      "activityId": 17151,
      "activityParentId": 90013,
      "activityParentName": "Walk",
      "calories": 510,
      "description": "Walking less than 2 mph, strolling very slowly",
      "distance": 4.248668,
      "duration": 2081000,
      "hasStartTime": true,
      "isFavorite": false,
      "lastModified": "2017-02-15T17:01:02.000Z",
      "logId": 6095906779,
      "name": "Walk",
      "startDate": "2017-02-15",
      "startTime": "07:00",
      "steps": 5620
    }
  ],
  "goals": {
    "activeMinutes": 30,
    "caloriesOut": 2329,
    "distance": 8.05,
    "floors": 10,
    "steps": 10000
  },
  "summary": {
    "activeScore": -1,
    "activityCalories": 510,
    "caloriesBMR": 1533,
    "caloriesOut": 1996,
    "distances": [
      {
        "activity": "Walk",
        "distance": 4.248668
      },
      {
        "activity": "total",
        "distance": 4.25
      },
      {
        "activity": "tracker",
        "distance": 0
      },
      {
        "activity": "loggedActivities",
        "distance": 4.248668
      },
      {
        "activity": "veryActive",
        "distance": 4.25
      },
      {
        "activity": "moderatelyActive",
        "distance": 0
      },
      {
        "activity": "lightlyActive",
        "distance": 0
      },
      {
        "activity": "sedentaryActive",
        "distance": 0
      }
    ],
    "elevation": 0,
    "fairlyActiveMinutes": 0,
    "floors": 0,
    "lightlyActiveMinutes": 0,
    "marginalCalories": 420,
    "sedentaryMinutes": 1114,
    "steps": 5672,
    "veryActiveMinutes": 35
  }
}
Best Answer
0 Votes

Is this because the first account has been synced with MyFitnessPal? I am just trying to decide how to determine when to use Get Daily Activity Summary endpoint and when to use Get Activity Logs List endpoint. 

 

When I try https://api.fitbit.com/1/user/-/activities/list.json?limit=10&sort=desc&beforeDate=2017-02-15&offset... for account 38NNH9 I get 

{
  "errors": [
    {
      "errorType": "not_found",
      "fieldName": "n/a",
      "message": "The API you are requesting could not be found."
    }
  ],
  "success": false
}
Best Answer
0 Votes

@LaceyDomo To answer your question about "Dog Walk" vs "Walk", I can see the source of "Dog Walk" was actually a tracked "Workout" activity from a Charge HR (which you can see for yourself using the Get Activity Logs List endpoint). That means it will not show up in the activity summary because it is not a manually logged activity. The reason it appears as "Dog Walk" is because the activity was edited to give it a name other than "Workout".

 

As far as the "not_found" error you're getting, I would suggest you double check everything because that endpoint definitely exists and is working properly.

 

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes