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

Breaking change to Get Activity Logs List

ANSWERED

2016-04-26 update: Please see known issues here.

 

2016-04-19 5:00 PM PDT update: This change is now live.

 

2015-04-18 update: We're delaying the release one day.

 

Original post below.

—————

 

Fitbit will be make breaking changes to the Get Activity Logs List endpoint. As this endpoint is in beta, it will not follow our 30 day breaking change policy. These changes will be released on Tuesday, April 19th.

 

This endpoint is how applications can retrieve all types of activity logs. The type of activity log can be determined by the “logType” property.

  • “auto_detected” activity logs are those created by Fitbit’s SmartTrack feature.
  • “fitstar” activity logs are created after completing a FitStar workout.
  • “manual” activity logs override some or all tracker data.
  • “mobile_run” activity logs are created after completing a MobileRun.
  • “tracker” activity logs are those created using the exercise mode on a Fitbit device.

 

For more information about each type of activity log type, see the help article “How do I track my exercise and activities with Fitbit?”.

 

Pagination is date based. For activity logs descending by date, use sort=desc and beforeDate. For ascending by date, use sort=asc and afterDate. You can request up to 10 exercise logs at a time.

 

Here is an example response for the request https://api.fitbit.com/1/user/-/activities/list.json?beforeDate=2015-03-30&sort=desc&limit=10:

{
    "activities": [{
        "activeDuration": 1734000,
        "activityLevel": [{
            "minutes": 4,
            "name": "sedentary"
        }, {
            "minutes": 14,
            "name": "lightly"
        }, {
            "minutes": 4,
            "name": "fairly"
        }, {
            "minutes": 6,
            "name": "very"
        }],
        "activityName": "FitStar: Personal Trainer",
        "activityTypeId": 17589491,
        "averageHeartRate": 94,
        "calories": 136,
        "caloriesLink": "https://api.fitbit.com/1/user/-/activities/calories/date/2016-03-29/2016-03-29/1min/time/8:45/9:13.json",
        "distance": 1.071811,
        "distanceUnit": "Kilometer",
        "duration": 1734000,
        "heartRateLink": "https://api.fitbit.com/1/user/-/activities/heart/date/2016-03-29/2016-03-29/1sec/time/08:45:00/09:13:54.json",
        "heartRateZones": [{
            "max": 94,
            "min": 30,
            "minutes": 16,
            "name": "Out of Range"
        }, {
            "max": 131,
            "min": 94,
            "minutes": 9,
            "name": "Fat Burn"
        }, {
            "max": 159,
            "min": 131,
            "minutes": 1,
            "name": "Cardio"
        }, {
            "max": 220,
            "min": 159,
            "minutes": 0,
            "name": "Peak"
        }],
        "lastModified": "2016-03-29T17:41:53.000Z",
        "logId": 2067350363,
        "logType": "fitstar",
        "manualValuesSpecified": {
            "calories": false,
            "distance": false,
            "steps": false
        },
        "source": {
            "id": "228T4Z",
            "name": "FitStar",
            "type": "app",
            "url": "http://www.fitstar.com"
        },
        "speed": 2.2252131487889275,
        "startTime": "2016-03-29T08:45:00.000-07:00",
        "steps": 1354
    }, {
        "activeDuration": 1001000,
        "activityLevel": [{
            "minutes": 0,
            "name": "sedentary"
        }, {
            "minutes": 0,
            "name": "lightly"
        }, {
            "minutes": 17,
            "name": "fairly"
        }, {
            "minutes": 0,
            "name": "very"
        }],
        "activityName": "Bike",
        "activityTypeId": 90001,
        "averageHeartRate": 93,
        "calories": 77,
        "caloriesLink": "https://api.fitbit.com/1/user/-/activities/calories/date/2016-03-28/2016-03-28/1min/time/19:05/19:22.json",
        "distance": 4.1978,
        "distanceUnit": "Kilometer",
        "duration": 1001000,
        "heartRateLink": "https://api.fitbit.com/1/user/-/activities/heart/date/2016-03-28/2016-03-28/1sec/time/19:05:31/19:22:12.json",
        "heartRateZones": [{
            "max": 94,
            "min": 30,
            "minutes": 7,
            "name": "Out of Range"
        }, {
            "max": 131,
            "min": 94,
            "minutes": 10,
            "name": "Fat Burn"
        }, {
            "max": 159,
            "min": 131,
            "minutes": 0,
            "name": "Cardio"
        }, {
            "max": 220,
            "min": 159,
            "minutes": 0,
            "name": "Peak"
        }],
        "lastModified": "2016-03-29T03:03:12.000Z",
        "logId": 2068007929,
        "logType": "manual",
        "manualValuesSpecified": {
            "calories": true,
            "distance": true,
            "steps": true
        },
        "source": {
            "id": "22997K",
            "name": "Fitbit + Strava",
            "type": "app",
            "url": "https://strava.fitbit.com/"
        },
        "speed": 15.096983016983017,
        "startTime": "2016-03-28T19:05:31.000-07:00",
        "steps": 0
    }, {
        "activeDuration": 1503000,
        "activityLevel": [{
            "minutes": 4,
            "name": "sedentary"
        }, {
            "minutes": 11,
            "name": "lightly"
        }, {
            "minutes": 3,
            "name": "fairly"
        }, {
            "minutes": 7,
            "name": "very"
        }],
        "activityName": "Walk",
        "activityTypeId": 90013,
        "averageHeartRate": 96,
        "calories": 134,
        "caloriesLink": "https://api.fitbit.com/1/user/-/activities/calories/date/2016-03-26/2016-03-26/1min/time/14:49/15:14.json",
        "duration": 1503000,
        "heartRateLink": "https://api.fitbit.com/1/user/-/activities/heart/date/2016-03-26/2016-03-26/1sec/time/14:49:05/15:14:08.json",
        "heartRateZones": [{
            "max": 94,
            "min": 30,
            "minutes": 8,
            "name": "Out of Range"
        }, {
            "max": 131,
            "min": 94,
            "minutes": 17,
            "name": "Fat Burn"
        }, {
            "max": 159,
            "min": 131,
            "minutes": 0,
            "name": "Cardio"
        }, {
            "max": 220,
            "min": 159,
            "minutes": 0,
            "name": "Peak"
        }],
        "lastModified": "2016-03-26T22:34:17.000Z",
        "logId": 2047712815,
        "logType": "auto_detected",
        "manualValuesSpecified": {
            "calories": false,
            "distance": false,
            "steps": false
        },
        "startTime": "2016-03-26T14:49:05.000-07:00",
        "steps": 1662
    }, {
        "activeDuration": 2766000,
        "activityLevel": [{
            "minutes": 5,
            "name": "sedentary"
        }, {
            "minutes": 6,
            "name": "lightly"
        }, {
            "minutes": 2,
            "name": "fairly"
        }, {
            "minutes": 33,
            "name": "very"
        }],
        "activityName": "Workout",
        "activityTypeId": 3000,
        "averageHeartRate": 147,
        "calories": 416,
        "caloriesLink": "https://api.fitbit.com/1/user/-/activities/calories/date/2016-03-05/2016-03-05/1min/time/15:31/16:17.json",
        "duration": 2766000,
        "heartRateLink": "https://api.fitbit.com/1/user/-/activities/heart/date/2016-03-05/2016-03-05/1sec/time/15:31:17/16:17:23.json",
        "heartRateZones": [{
            "max": 94,
            "min": 30,
            "minutes": 3,
            "name": "Out of Range"
        }, {
            "max": 131,
            "min": 94,
            "minutes": 8,
            "name": "Fat Burn"
        }, {
            "max": 159,
            "min": 131,
            "minutes": 4,
            "name": "Cardio"
        }, {
            "max": 220,
            "min": 159,
            "minutes": 30,
            "name": "Peak"
        }],
        "lastModified": "2016-03-06T00:20:21.000Z",
        "logId": 1846159807,
        "logType": "tracker",
        "manualValuesSpecified": {
            "calories": false,
            "distance": false,
            "steps": false
        },
        "source": {
            "id": "47086726",
            "name": "Charge HR",
            "type": "tracker",
            "url": "https://www.fitbit.com/"
        },
        "startTime": "2016-03-05T15:31:17.000-08:00",
        "steps": 683,
        "tcxLink": "https://api.fitbit.com/1/user/-/activities/1846159807.json"
    }, {
        "activeDuration": 784739,
        "activityLevel": [{
            "minutes": 0,
            "name": "sedentary"
        }, {
            "minutes": 1,
            "name": "lightly"
        }, {
            "minutes": 0,
            "name": "fairly"
        }, {
            "minutes": 12,
            "name": "very"
        }],
        "activityName": "Run",
        "activityTypeId": 90009,
        "averageHeartRate": 125,
        "calories": 124,
        "caloriesLink": "https://api.fitbit.com/1/user/-/activities/calories/date/2016-01-31/2016-01-31/1min/time/19:11/19:24.json",
        "distance": 2.534752,
        "distanceUnit": "Kilometer",
        "duration": 784000,
        "heartRateLink": "https://api.fitbit.com/1/user/-/activities/heart/date/2016-01-31/2016-01-31/1sec/time/19:11:49/19:24:53.json",
        "heartRateZones": [{
            "max": 94,
            "min": 30,
            "minutes": 2,
            "name": "Out of Range"
        }, {
            "max": 131,
            "min": 94,
            "minutes": 1,
            "name": "Fat Burn"
        }, {
            "max": 159,
            "min": 131,
            "minutes": 10,
            "name": "Cardio"
        }, {
            "max": 220,
            "min": 159,
            "minutes": 0,
            "name": "Peak"
        }],
        "lastModified": "2016-02-01T03:25:03.000Z",
        "logId": 1546680089,
        "logType": "mobile_run",
        "manualValuesSpecified": {
            "calories": false,
            "distance": false,
            "steps": false
        },
        "pace": 309.30047594399764,
        "source": {
            "id": "2295XJ",
            "name": "Fitbit for Windows Phone",
            "type": "app",
            "url": "https://www.fitbit.com/"
        },
        "speed": 11.628206575689497,
        "startTime": "2016-01-31T19:11:49.000-08:00",
        "steps": 1827,
        "tcxLink": "https://api.fitbit.com/1/user/-/activities/1546680089.json"
    }, {
        "activeDuration": 6226000,
        "activityLevel": [{
            "minutes": 6,
            "name": "sedentary"
        }, {
            "minutes": 37,
            "name": "lightly"
        }, {
            "minutes": 28,
            "name": "fairly"
        }, {
            "minutes": 32,
            "name": "very"
        }],
        "activityName": "Hike",
        "activityTypeId": 90012,
        "averageHeartRate": 102,
        "calories": 582,
        "caloriesLink": "https://api.fitbit.com/1/user/-/activities/calories/date/2015-05-25/2015-05-25/1min/time/14:08/16:09.json",
        "distance": 5.600688,
        "distanceUnit": "Kilometer",
        "duration": 7272000,
        "heartRateLink": "https://api.fitbit.com/1/user/-/activities/heart/date/2015-05-25/2015-05-25/1sec/time/14:08:12/16:09:24.json",
        "heartRateZones": [{
            "max": 94,
            "min": 30,
            "minutes": 24,
            "name": "Out of Range"
        }, {
            "max": 132,
            "min": 94,
            "minutes": 79,
            "name": "Fat Burn"
        }, {
            "max": 160,
            "min": 132,
            "minutes": 0,
            "name": "Cardio"
        }, {
            "max": 220,
            "min": 160,
            "minutes": 0,
            "name": "Peak"
        }],
        "lastModified": "2015-07-15T23:45:47.000Z",
        "logId": 228167717,
        "logType": "tracker",
        "manualValuesSpecified": {
            "calories": false,
            "distance": false,
            "steps": false
        },
        "pace": 1111.6491402484837,
        "source": {
            "id": "18834976",
            "name": "Surge",
            "type": "tracker",
            "url": "https://www.fitbit.com/"
        },
        "speed": 3.2384318663668488,
        "startTime": "2015-05-25T14:08:12.000-07:00",
        "steps": 7295,
        "tcxLink": "https://api.fitbit.com/1/user/-/activities/228167717.json"
    }],
    "pagination": {
        "beforeDate": "2016-03-30",
        "limit": 10,
        "next": "https://api.fitbit.com/1/user/-/activities/list.json?limit=10&sort=desc&beforeDate=2015-07-15T23:45:47.000Z",
        "sort": "desc"
    }
}

 

Best Answer
60 REPLIES 60

@JeremiahFitbit: Thank you, this is good news.

Best Answer
0 Votes

Hi Jeremiah - were you guys able to crush the heart rate data bug?

Best Answer
0 Votes

@FrankBirchwood: averageHeartRate is now being returned.

Best Answer

Hey Jeremiah,

 

I'm sure when I first started using this endpoint, it was returning a distance value for each record, but now even activity logs that clearly should have a distance (for example, an auto-detected activity with ~3000 steps) don't have a distance or distanceUnit. Am I missing something, or is this just missing?

 

Edit: hmm, is it only manual workouts tracked via the Fitbit app that get a distance tracked? It's not really clear.

Best Answer
0 Votes

Since this change nothing is returned on most of my queries even though I can see my activities in the fitbit dashboard. This is the call I'm using

"https://api.fitbit.com/1/user/-/activities/list.json?afterDate=2016-04-18&offset=0&limit=20&sort=asc".
Can you think of any reason that it would be returning no activities. This was all tested and worked fine back in march.

Best Answer
0 Votes

I'm getting a 404 when trying to call this API:

 https://api.fitbit.com/1/user/-/activities/list.json

 

Is there something wrong or is this no longer available or does it have a new URL?

 

UPDATE: I changed my call from a POST to a GET and it is now working - Sorry for the post but hope it will help others if they are having the same issue.

Best Answer
0 Votes

@JeremiahFitbit wrote:

@BigR wrote:

This endpoint does not seem to be returning "Activity Records" - those entered by clicking the Clock+ icon on https://www.fitbit.com/activities and entering the Name, Date, Start, and End time.

 

It's also not clear which of the logTypes such activities would fall under - they are technically "manual" but don't really override any tracker collected data.


@BigR: At this time, those records are not returned. This is an uncommonly used legacy feature that is only available in the Fitbit Web app. I will relay this feature request internally.


@JeremiahFitbit Do you know if this feature request will be implemented any time soon?  Thanks.

Best Answer
0 Votes
Jeremiah, I have a strong belief in Fitbit and wanted to present my idea to you. I know why Apple is falling apart. And, I know what I can do to help. I do not expect Fitbit to take me seriously but,mi am confident I wil be able to help you launch an idea if you will let me present this to you and keep an open mind. We are facing chaos in the world today, as you know, business are falling, and will continue to fail. I know I have the solution. But, you'll or Fitbit developers will need to innovate the change. There is only one of me, and with your support and open mind, I'm sure your success will top all the "new" trends of today. I believe in Fitbit and want it to succeed and I want to opportunity to help change today's technology of wellness and fitness for the whole world. But, without this one idea, it won't happen.

See you soon,

Kristi
kraft.kristi@yahoo.com
Best Answer
0 Votes

It looks like this endpoint has stopped returning averageHeartRate and heartRateZones some time recently.

 

Bug or permanent change?

Best Answer

@BigR this wasn't the correct behavior for this endpoint. We've corrected this and it should return averageHeartRate and heartRateZones as it did previously. 🙂

Best Answer
0 Votes

Hi Jeremiah,

 

This is great. I am able to see the manually logged activities as well as device-tracked activities. What I can't see from the response though are the "activity records" recorded from the site, using the button on the top right with the timer icon on it.  These records also appear on the Activity History (having a timer icon next to the name), but not on the API endpoint. 

 

Can you confirm if this isn't included in this change? If not, will those "activity records" recorded from the site be included in a future release?

 

Thanks!

Best Answer
0 Votes

@ocajigal: "Activity records" logged via the website are not available via the Web API and we do not have plans at this time to support those.

Best Answer
0 Votes

Just to confirm, activities recorded via a Strava integration are available via the API?

Best Answer
0 Votes

@antikewl: Yes, Strava-to-Fitbit exercise logs appear as manual exercise logs. They only contain summary data, as Fitbit currently does not have a way to import third-party GPS and heart rate data.

Best Answer
0 Votes

does the source id suppose to match the device id from the device list? If yes then mine do not match

Best Answer
0 Votes

@triggi No, the source id and the id from the device endpoint are different.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

Ok so how can I link the data comming from the log list to the device. I  mean I want to be able to say that a workout is comming from a particular device.

Best Answer
0 Votes

From what I can tell, there are 5 activity types that can appear in the Get Activity Logs List endpoint (in the logType field): Fitstar, MobileRun, manual, auto_detected, and tracker.  The first 3 you don't need to worry about if you want the device, as they come from either an app or are manually entered into the app or website.  The last two are from an actual Fitbit device, and the source field should give you an idea of which device they come from.  I don't know if the 'id' subfield under source matches the device ID you would get from the Device endpoint (AndrewFitbit's response indicates no), but you can also look at the 'name' subfield, to see what type of tracker it is (Charge, Charge HR, etc).  If you have different device types, this will work.  If not, maybe there's a way to link the 'id' subfield to the device somehow (as in, one particular device always has this 'id', even if it doesn't match the device ID).  I haven't tried it, but it may work.

Best Answer

I'm having an issue getting any activities that aren't manually entered. I'm using this API call:

 

api.fitbit.com/1/user/USER_ID/activities/date/2017-06-29.json

 

The activities array is empty unless I've entered data manually. What am I doing wrong?

Best Answer
0 Votes

I think you're using the wrong API call.  To get all logged activities (manually entered, tracker, automatically detected, and so on), you need this API call:

 

https://api.fitbit.com/1/user/<UserID>/activities/list.json

this call has attributes beforeDate, afterDate, and sort, so you can specify what date range you would like.  See documentation here

 

Best Answer