Get Activity Intraday by Date Range
chevron down
 

Get Activity Intraday by Date Range

Retrieves the activity intraday time series data for a given resource on a specific date range for a 24 hour period.

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
start-date required The date in the format yyyy-MM-dd or today.
end-datedate required The date in the format yyyy-MM-dd or today.
detail-level required Number of data points to include.
Supported: 1min | 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

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.
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 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

Devices that support on-device or connected GPS will record distance when the exercise is initiated using the on-device Exercise application. For auto-detected exercises, we use steps and the stride length of the user to estimate distance. To determine how the exercise was recorded, see the Get Activity Log List response element "logType".