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
1 BEST ANSWER

Accepted Solutions

@stepank: This is more complicated than it might seem and will involve multiple fixes.

 

For now, you should consider timestamps of manually created activity logs from apps other than Fitbit's mobile apps to have the incorrect timezone. The work around is to ignore the Z/UTC declaration and assume the user's local time zone (listed in the profile endpoint) instead. This is functionally equivalent to fetching the manually logged activities from the Get Daily Activity Summary endpoint, which does not return time zone.

 

Within the next 3 weeks, newly created manual activity logs will be saved with the user's timezone setting as of the time of creation. We will announce when this fix is released.

 

Within the next few months, we will update existing manual activity logs to have the timezone matching the tracker data synced at that time. If there is no tracker data for that time period, the user's timezone setting as of the migration will be used. We will announce when this update starts and ends.

View best answer in original post

Best Answer
60 REPLIES 60

Hi

I have to be honest what has been posted means nothing to me.

Will the fitbit tracker add all running activities into the log or not

 

Best Answer
0 Votes

@runningalong wrote:

Hi

I have to be honest what has been posted means nothing to me.

Will the fitbit tracker add all running activities into the log or not

 


 

I believe the announcement "This endpoint is how applications can retrieve all types of activity logs." means that you can get all activities from the API.

Best Answer
0 Votes

Awesome.

Best Answer
0 Votes

@runningalong: Previously, only "manual" activity log types were returned. Soon, all activity types (as described in the original post) will be returned. Also, the structure of the JSON response has changed.

Best Answer
0 Votes

Maybe i'm missing something, but the old method will work after april 18?

Best Answer
0 Votes

@freeubi: The response object is different in many ways (different property names), so apps using this beta endpoint will need to be updated.

Best Answer
0 Votes

This is nice.  I was wondering, does the 10-activity limit apply per API call, or is it per hour like the user rate limit?  And can we specify both the beforeDate and afterDate parameters (for example, if we wanted activities only from a certain date)?  Or is there another way to get only activities from a particular date?

Best Answer
0 Votes
Great! Does the `logType` parameter accept multiple values, e.g. `logType=fitstar,manual,mobile_run,tracker` to get all activities except "auto_detected" activities?
Eric Jain
Got data? Get answers at zenobase.com.
Best Answer
0 Votes

@rMirage: 10 exercise logs per request. The rate limit remains the same.

Best Answer
0 Votes

@ejain: logType is a property in the response object. It's not a URL parameter for filtering. All exercise types will be returned.

Best Answer
0 Votes
@JeremiahFitbit: Thanks for the clarification. Would of course be useful if there was a parameter to exclude auto_detected activities, as most people have a lot of those, which means you can easily hit the hourly rate limit when trying to retrieve a user's manual activities...
Eric Jain
Got data? Get answers at zenobase.com.
Best Answer
0 Votes

Thank you for the communication and detail!

 

I'm sure you've been asked this before, but I don't really understand the posted answers. Does this mean that we will be able to POST to the tracker and have credit for "reported" steps?

Best Answer
0 Votes

@ejain: Analyzing the logging behavior of most people, I do not anticipate this being an issue. If the logging behavior and rate limit become a problem, we'll consider it.

Best Answer
0 Votes

@rikrok: You can already log "manual" activities that override tracker data. See the activity logging documentation.

Best Answer
0 Votes

Thank you!

 

One last question, I swear, but does this mean manual reporting steps will show with the fitbit tracking steps?

Best Answer
0 Votes

@rikrok: Manually reported steps are part of the step total for the day. However, manually logged steps will not appear in the tracker time series, which Fitbit's Leaderboard and Challenges features use (no cheating! Smiley Wink).

Best Answer
0 Votes

@JeremiahFitbit thank you for the clarity on this, I'm sure you've covered this many times. It's always good to read your posts, as they are very detailed and to the point!

 

As for your side note, I'd like to add that adding steps that my fitbit didn't catch (such as mowing the lawn, you gotta hold the handle to push the mower or stroller walking or even grocery cart walking) is not cheating. And yes, I'm very certain that the steps measured by my Samsung Galaxy Note is accurate.

Best Answer
0 Votes

Hi Jeremiah,

 

Thanks for inform us !

 

Just have a question concerning the get daily activities : Does it include the entire of logtype?

Concerning the tracker type in the get daily activities, does it give us the walking activity ? (distance via podometer) or just the tracker exercise mode ?

 

 

Best Answer
0 Votes

The distance value appears to have an explicit distanceUnit (presumably this reflects the value of the Accept-Language header), but what are the units for the speed and pace values?

Eric Jain
Got data? Get answers at zenobase.com.
Best Answer
0 Votes