Get Activity Intraday by Interval
chevron down
 

Get Activity Intraday by Interval

This endpoint retrieves the activity intraday time series data for a given resource on a specific date range for a 24 hour period. Intraday support can extend the detail-level response to include 1min, 5min and 15min for Activity.

3rd-party developers who want access to retrieve other Fitbit users’ Intraday data through the “Client” or “Server” application type should submit a request by filling out this form. A Fitbit developer’s personal Intraday data is automatically available through the “Personal” application type. You do not need to submit a request.

Scope: activity


Request

GET /1/user/[user-id]/activities/[resource]/date/[start-date]/[end-date]/[detail-level].json

/1/user/[user-id]/activities/[resource]/date/[start-date]/[end-date]/[detail-level]/time/[start-time]/[end-time].json

URI Arguments
user-id required The encoded ID of the user. Use "-" (dash) for current logged-in user.
resource required The resource of the data to be returned.
Supported: calories | distance | elevation | floors | steps | swimming-strokes
start-date required The date in the format yyyy-MM-dd or today.
end-date required The date in the format yyyy-MM-dd or today.

Maximum range: 24 hours
detail-level required Number of data points to include.
Supported: 1min | 5min | 15min
start-time optional The start of the time period in the format HH:mm.
end-time optional The end of the time period in the format HH:mm.

Query Parameters
timezone optional Returns the response from the specified timezone.
Supported: UTC
string

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/steps/date/2019-01-01/2019-01-01/1min.json
GET https://api.fitbit.com/1/user/GGNJL9/activities/steps/date/2019-01-01/2019-01-01/1min.json

GET https://api.fitbit.com/1/user/-/activities/steps/date/2019-01-01/2019-01-01/1min/time/08:00/08:30.json
GET https://api.fitbit.com/1/user/GGNJL9/activities/steps/date/2019-01-01/2019-01-01/1min/time/08:00/08:30.json
curl -X GET "https://api.fitbit.com/1/user/-/activities/steps/date/2019-01-01/2010-01-01/1min.json" \
-H "accept: application/json" \
-H "authorization: Bearer <access_token>"

curl -X GET "https://api.fitbit.com/1/user/-/activities/steps/date/2019-01-01/2019-01-01/1min/time/08:00/08:30.json" \
-H "accept: application/json" \
-H "authorization: Bearer <access_token>"


Response

Element Name Description
activities-<resource> : datetime The date of the recorded resource in the format yyyy-MM-dd.
activities-<resource> : value The specified resource's daily total or the total during the time period specified.
activities-<resource>-intraday : dataset : level Numerical value representing the user's activity-level at the moment when the resource was recorded.

0 = sedentary
1 = lightly active
2 = fairly/moderately active
3 = very active

Returned only when resource = calories.
activities-<resource>-intraday : dataset : mets METs value at the moment when the resource was recorded.

Returned only when resource = calories.
activities-<resource>-intraday : dataset : time The time of the recorded resource.
activities-<resource>-intraday : dataset : value The specified resource's value at the time it is recorded.
{
  "activities-steps": [
    {
      "dateTime": "2019-01-01",
      "value": "0"
    }
  ],
  "activities-steps-intraday": {
    "dataset": [
      {
        "time": "08:00:00",
        "value": 0
      },
      {
        "time": "08:01:00",
        "value": 0
      },
      {
        "time": "08:02:00",
        "value": 0
      },


[...]

      {
        "time": "08:30:00",
        "value": 0
      }
    ],
    "datasetInterval": 1,
    "datasetType": "minute"
  }
}
      

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

Access to the Intraday Time Series for personal use (accessing your own data) is available through the "Personal" App Type.

Restriction: Activity Intraday data cannot be retrieved for more than a 24 hour period. Any requests that expand over a 24 hour period will result with the summary data for the date range specified.

The activity intraday time series data for a given resource is returned in the format requested. The endpoint mimics the Get Activity Time Series endpoints. If your application has the appropriate access, your calls to a time series endpoint for a specific day (by using start and end dates on the same day or a period of 24 hours), the response will include extended intraday values with 1-minute, 5-minute or 15-minute detail level for that day. Unlike other time series calls that allow fetching data of other users, intraday data is available only for and to the authorized user.

Any discrepancies between time series detail-level totals vs daily summary totals is likely due to how the device calculates on-wrist and off-wrist data. On-wrist data is defined as data collected while the device is worn. On-wrist data is also referred to as Intraday data. Off-wrist data is defined as data collected while the device is not worn. For example, step data can be collected if the device was in a bag while driving down a bumpy road. By design, daily summary totals include on-wrist totals and off-wrist totals; while Intraday totals include on-wrist totals only.

Considerations

  1. If a user hasn't synced a tracker for more than seven (7) days, the tracker stores only summary values for the days older than one week. In this case, the intraday data for steps is zero and the intraday calories are calculated from BMR or EER. Intraday steps could be estimated from the total daily summary data by the equation above.
  2. For the current day we will include only values until current timestamp (in the user's timezone).
  3. If a specific time interval was passed to the call via start-time/end-time parameters, data-value will include a summary only for the requested time period (versus whole day).
  4. For the activities/log/calories resource, each data point also includes the level field that reflects calculated activity level for that time period ( 0 - sedentary; 1 - lightly active; 2 - fairly active; 3 - very active).
  5. If BMR or EER have been used to estimate calories for the whole specific day (no tracker data), intraday data for calories would be flat and estimated according to the simple equation calories_1m = BMR(EER)/24/60.

Using BMR/EER Algorithms

If a user had no Fitbit tracker data for the specific day then the greater of Logged Activities + BMR (for minutes when there is no activity) and the calories calculated from the EER for that day (if EER enabled for this user's profile) are taken. In case, there was some data from the tracker for the specific day, that data where available is used and for time where data is unavailable, the BMR is used. If the total is less than 20% greater than BMR then the EER (cals < EER * 0.8) is used. EER never used to calculate calories for today.

Using BMR Formula

Fitbit uses the standard MD Mifflin-St Jeor equation:

9.99 * weightKg + 6.25*heightCm - 4.92*ageYears + s, where s is +5 for
males and -161 for female

EER Formula (TEE total energy expenditure)

The EER Formula is based on http://www.cdc.gov/pcd/issues/2006/oct/pdf/06_0034.pdf, which in turn is based on "Food and Nutrition Board. Dietary reference intakes for energy, carbohydrate, fiber, fat, fatty acids, cholesterol, protein, and amino acids (macronutrients). Washington (DC): National Academy Press; 2005." http://www.nap.edu/openbook.php?isbn=0309085373&page=204

MALE-based EER Formula:

TEE = 864 - 9.72 x age (years) + 1.0 x (14.2 x weight(kg) + 503 x height
(meters))

FEMALE-based EER Formula:

TEE = 387 - 7.31 x age (years) + 1.0 x (10.9 x weight(kg) + 660.7 x height
(meters))

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.

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.