Get Activity Log List
chevron down
 

Get Activity Log List

Retrieves a list of a user's activity log entries before or after a given day.

Scope: activity


Request

GET /1/user/[user-id]/activities/list.json

URI Arguments
user-id required The encoded ID of the user. Use "-" (dash) for current logged-in user.

Query Parameters
beforeDate optional / required The date in the format yyyy-MM-ddTHH:mm:ss. Only yyyy-MM-dd is required. Either beforeDate or afterDate must be specified. string ($date or $timestamp)
afterDate optional / required The date in the format yyyy-MM-ddTHH:mm:ss. Only yyyy-MM-dd is required. Either beforeDate or afterDate must be specified. string ($date or $timestamp)
sort required The sort order of entries by date. Use asc (ascending) when using afterDate. Use desc (descending) when sing before date. string
limit required The number of entries returned.

Maximum: 100
integer
offset required Supported: 0

See "offset" Query Parameter for more information.
integer

Request Headers
authorization required Specify the token type and Fitbit user’s access token.
Token type: Bearer
accept optional The media type of the response content the client is expecting.
Supported: application/json
accept-language optional The measurement unit system to use for response values. See Localization.
accept-locale optional The locale to use for response values. See Localization.

Examples
GET https://api.fitbit.com/1/user/-/activities/list.json?afterDate=2019-01-01&sort=asc&offset=0&limit=2
GET https://api.fitbit.com/1/user/GGNJL9/activities/list.json?afterDate=2019-01-01&sort=asc&offset=0&limit=2
curl -X GET "https://api.fitbit.com/1/user/-/activities/list.json?afterDate=2019-01-01&sort=asc&offset=0&limit=2" \
-H "accept: application/json" \
-H "authorization: Bearer <access_token>"


Response

Element Name Description
activities : activeDuration The amount of time (milliseconds) within each activityLevel.
activeZoneMinutes : minutesInHeartRateZones : minuteMultiplier
activeZoneMinutes : minutesInHeartRateZones : minutes
activeZoneMinutes : minutesInHeartRateZones : order
activeZoneMinutes : minutesInHeartRateZones : type Supported: OUT_OF_ZONE | FAT_BURN | CARDIO | PEAK
activeZoneMinutes : minutesInHeartRateZones : zoneName Supported: Out of Range | Fat Burn | Cardio | Peak
activeZoneMinutes : totalMinutes
activities: activityLevel : minutes Total number of minutes the user spent during the specified activity level for that day.
activities: activityLevel : name Name of the activity level.
Supported: sedentary | lightly | fairly | very
activities : activityName Name of the recorded exercise.
activities : activityTypeId The activityName's identifier number.
activities : averageHeartRate The Heart Rate scope is required to see this value;
the average heart rate during the exercise.
activities : calories Number of calories burned during the exercise.
activities : caloriesLink Web API endpoint to call to get the specific calories burned for the named exercise.
activities : detailsLink An endpoint that provides additional details about the user's activity either manually logged on the mobile application or API, or auto-recognized by the Fitbit device. Activities recorded using the device's exercise app are not supported.
activities : distance Distance traveled during the exercise.
activities : distanceUnit Distance units defined by the Accept-Language header.
activities : duration The length in time (milliseconds) after the exercise was edited. If the exercise was not edited, the duration = originalDuration. This value will contain pauses during the exercise.
activities : elevationGain Elevation gained during the exercise.
activities : hasActiveZoneMinutes The Heart Rate scope is required to see this value.
Supported: true | false
activities : heartRateLink The Heart Rate scope is required to see this value.
activities : heartRateZones : caloriesOut The Heart Rate scope is required to see this value.
activities : heartRateZones : max The Heart Rate scope is required to see this value.
activities : heartRateZones : min The Heart Rate scope is required to see this value.
activities : heartRateZones : minutes The Heart Rate scope is required to see this value.
activities : heartRateZones : name The Heart Rate scope is required to see this value. Supported: Cardio | Fat Burn | Out of Range | Peak
activities : lastModified The timestamp the exercise was last modified.
activities : logId The activity log identifier for the exercise.
activities : logType The type of activity log created.

Supported: auto_detected | manual | mobile_run | tracker | the name of the 3rd party application
activities : manualValuesSpecified : calories A boolean value stating if calories was provided when recording the exercise.
activities : manualValuesSpecified : distance A boolean value stating if distance was provided when recording the exercise.
activities : manualValuesSpecified : steps A boolean value stating if steps was provided when recording the exercise.
activities : originalDuration The initial length in time (milliseconds) that the exercise was recorded. This value will contain pauses during the exercise.
activities : originalStartTime The initial start datetime that the exercise was recorded.
activities : pace Calculated average pace during the exercise.
activities : source : id Identifier associated to the source of the exercise. If the source is a 3rd party applicaton, the ID will be the application's client ID.
activities : source : name The name associated with the source identifier.
activities : source : trackerFeatures Supported: CALORIES | DISTANCE | ELEVATION | GPS | HEARTRATE | PACE | STEPS | VO2_MAX
activities : source : type The source type.
activities : source : url The URL associated with the source.
activities : speed Average speed during the exercise.
activities : startTime The start datetime after the exercise was edited. If the exercise was not edited, the startTime = originalStartTime.
activities : steps Number of steps taken during the exercise.
activities : tcxLink URL to download the TCX file.
pagination : afterDate
pagination : limit
pagination : next
pagination : offset
pagination : previous
pagination : sort
{
  "activities": [
    {
      "activeDuration": 1536000,
      "activityLevel": [
        {
          "minutes": 3,
          "name": "sedentary"
        },
        {
          "minutes": 9,
          "name": "lightly"
        },
        {
          "minutes": 2,
          "name": "fairly"
        },
        {
          "minutes": 11,
          "name": "very"
        }
      ],
      "activityName": "Walk",
      "activityTypeId": 90013,
      "calories": 204,
      "caloriesLink": "https://api.fitbit.com/1/user/-/activities/calories/date/2019-01-03/2019-01-03/1min/time/12:08/12:34.json",
      "duration": 1536000,
      "elevationGain": 0,
      "lastModified": "2019-01-04T19:31:15.000Z",
      "logId": 19018673358,
      "logType": "auto_detected",
      "manualValuesSpecified": {
        "calories": false,
        "distance": false,
        "steps": false
      },
      "originalDuration": 1536000,
      "originalStartTime": "2019-01-03T12:08:29.000-08:00",
      "startTime": "2019-01-03T12:08:29.000-08:00",
      "steps": 1799,
      "tcxLink": "https://api.fitbit.com/1/user/-/activities/19018673358.tcx"
    }
  ],
  "pagination": {
    "afterDate": "2019-01-01",
    "limit": 1,
    "next": "https://api.fitbit.com/1/user/-/activities/list.json?offset=0&limit=1&sort=asc&afterDate=2019-01-01",
    "offset": 0,
    "previous": "",
    "sort": "asc"
  }
}
      

Response Headers
content-type The media type of the response content being sent to the client.
Supported: application/json
fitbit-rate-limit-limit The quota number of calls.
fitbit-rate-limit-remaining The number of calls remaining before hitting the rate limit.
fitbit-rate-limit-reset The number of seconds until the rate limit resets.

Note: The rate limit headers are approximate and asynchronously updated. This means that there may be a minor delay in the decrementing of remaining requests. This could result in your application receiving an unexpected 429 response if you don't track the total number of requests you make yourself.

Response Type

HTTP Status Code HTTP response code. List of codes are found in the Troubleshooting Guide.
Status Message Description of the status code.
Response Body Contains the JSON response to the API call. When errors are returned by the API call, the errorType, fieldName and message text will provide more information to the cause of the failure.

Response Codes
200 A successful request.
400 The request had bad syntax or was inherently impossible to be satisfied.
401 The request requires user authentication.

Note: For a complete list of response codes, please refer to the Troubleshooting Guide.

Additional Information

Using units in the unit system which corresponds to the Accept-Language header provided.

"logType" values

The source of the activity log can be determined by the logType response element.

  • auto_detected activity logs are those created by Fitbit’s SmartTrack feature.
  • manual activity logs are user specified overrides of some or all tracker data.
  • mobile_run activity logs are created after completing a MobileRun.
  • tracker activity logs are those created using the multisport exercise mode on a Fitbit device.

Distance, pace and speed

The Fitbit devices use the following formulas to calculate distance, pace and speed. Please note, stride length is approximated by the person's height and gender.

distance = steps * stride length
pace = time(sec) / distance
speed = distance / time(hour)

Daily activity summary and auto-detected exercises' (recorded using Smart Track) distance are estimated values based on steps and stride length. Devices that support on-device or connected GPS will record distance, pace and speed from the GPS data when the exercise is initiated using the on-device Exercise application. If the person begins moving before receiving a GPS signal, steps and stride length are used to calculate distance until the GPS connects. Intraday distance values, returned by the Intraday endpoints or Activity TCX endpoint, can be more accurate since they use the GPS data. To determine how the exercise was recorded, see "logType" values.

Some people have noticed that the standard formula for calculating pace and speed doesn't always provide accurate results. That's because pace and speed are calculated from the GPS data, while the total distance is an approximate value based on how the tracker calculates distance (GPS vs steps & stride length). The mobile application duplicates the tracker distance value by displaying the exercise summary view. This is done to provide a better user experience for the consumer. When the user drills down into the exercise details, like data charts or maps, they should see the more accurate data coming from the GPS or Intraday data.

Developers who need to display the most accurate distance values, we suggest using only the intraday distance data points instead of the activity summary.

See How does my Fitbit device calcuate my daily activity? for more information.

"offset" query parameter

The offset query parameter is not fully supported and it's future is unknown. Therefore, the only supported value is 0. To paginate, request the next and previous links in the pagination response object. Using the "offset" query parameter in any other capacity could cause your application to break.

Webhook notifications

The Fitbit Web API can send notifications when a Fitbit user has new data to download. This is possible by implementing the Subscription API and subscribing to one or more data collections. See Using Subscriptions. Whenever the activity service recognizes a change to the user’s data, a notification is sent to your application’s subscriber.

The activity collection recognizes changes to a user’s recorded activities, step count, calories burned, distance traveled, etc. Keep in mind that even when a person is not in motion, their body is burning calories. It’s possible to receive activity notifications representing calorie burn even when the user is sleeping or stationary. Today, you cannot subscribe to a subset of the user’s activity data. So, it is the responsibility of your application to query the necessary activity endpoint(s) to reconcile the data in your system.