03-31-2016 15:54 - edited 04-26-2016 12:50
03-31-2016 15:54 - edited 04-26-2016 12:50
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.
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"
}
}
Answered! Go to the Best Answer.
07-07-2017 10:21
07-07-2017 10:21
Thanks!! I'll try that one.