Body Fat

Get Body Fat Logs

The Get Body Fat Logs API retrieves a list of all user's body fat log entries for a given day in the format requested. Body fat log entries are available only to authorized user. If you need to fetch only the most recent entry, you can use the Get Body Measurements endpoint.

Resource URL

There are three acceptable formats for retrieving body fat log data:

  1. GET https://api.fitbit.com/1/user/[user-id]/body/log/fat/date/[date].json

  2. GET https://api.fitbit.com/1/user/[user-id]/body/log/fat/date/[date]/[period].json

  3. GET https://api.fitbit.com/1/user/[user-id]/body/log/fat/date/[base-date]/[end-date].json

user-idThe encoded ID of the user. Use "-" (dash) for current logged-in user.
dateThe date in the format yyyy-MM-dd.
base-dateThe end date when period is provided; range start date when a date range is provided. In the format yyyy-MM-dd or today.
periodThe date range period. One 1d, 7d, 1w, 1m.
end-dateRange end date when date range is provided. Note: The range should not be longer than 31 days.

Request Headers

Accept-LanguageoptionalThe measurement unit system to use for response values.

Response Fields

dateLog entry date; in the format yyyy-MM-dd.
fatBody fat percentage; in the format X.XX.
logIdBody Fat Log IDs are unique to the user, but not globally unique.
timeTime of the measurement; hours and minutes in the format HH:mm:ss, set to the last second of the day if not provided.
sourceThe source of the fat log; the field is optional.

Example Response

{
    "fat":[
        {
            "date":"2012-03-05",
            "fat":14,
            "logId":1330991999000,
            "time":"23:59:59",
            "source": "API"
        },
        {
            "date":"2012-03-05",
            "fat":13.5,
            "logId":1330991999000,
            "time":"21:20:59",
            "source":"Aria"
        }
    ]
}

Log Body Fat

The Log Body Fat API creates a log entry for body fat and returns a response in the format requested.

Note: The returned Body Fat Log IDs are unique to the user, but not globally unique.

Resource URL

POST https://api.fitbit.com/1/user/[user-id]/body/log/fat.json

user-idThe encoded ID of the user. Use "-" (dash) for current logged-in user.

POST Parameters

fatrequiredBody fat; in the format X.XX, in the unit system that corresponds to the Accept-Language header provided.
daterequiredLog entry date; in the format yyyy-MM-dd.
timeoptionalTime of the measurement; hours and minutes in the format HH:mm:ss, set to the last second of the day if not provided.

Request Headers

Accept-LanguageoptionalThe measurement unit system to use for response values.
{
    "weightLog": {
        "bmi": 23.57,
        "date": "2012-03-05",
        "fat": 14.5,       
        "logId": 1330991999000,
        "time": "23:59:59",
        "source": "API"
    }
}

Delete Body Fat Log

The Delete Body Fat Log API deletes a user's body fat log entry with the given ID.

Note: A successful request returns a 204 status code with an empty response body.

Resource URL

DELETE https://api.fitbit.com/1/user/[user-id]/body/log/fat/[body-fat-log-id].json

user-idThe encoded ID of the user. Use "-" (dash) for current logged-in user.
body-fat-log-idThe ID of the body fat log entry.

Body Time Series

Get Body Time Series

The Get Body Time Series API returns time series data in the specified range for a given resource in the format requested using units in the unit systems that corresponds to the Accept-Language header provided.

Note: If you provide earlier dates in the request, the response retrieves only data since the user's join date or the first log entry date for the requested collection.

Resource URL

There are two acceptable formats for retrieving time series data:

  1. GET /1/user/[user-id]/body/[resource-path]/date/[date]/[period].json

  2. GET /1/user/[user-id]/body/[resource-path]/date/[base-date]/[end-date].json

api-versionThe API version. Currently version 1.
user-idThe encoded ID of the user. Use "-" (dash) for current logged-in user.
resource-pathThe resource path. Options are "bmi", "fat", or "weight".
base-dateThe range start date, in the format yyyy-MM-dd or today.
end-dateThe end date of the range.
dateThe end date of the period specified in the format yyyy-MM-dd or today.
periodThe range for which data will be returned. Options are 1d, 7d, 30d, 1w, 1m, 3m, 6m, 1y, or max.

Request Headers

Accept-LanguageoptionalThe language to use for response values. Language is used to determine the activity measurement units returned.

Goals

Get Body Goals

The Get Body Goals API retrieves a user's current body fat percentage or weight goal using units in the unit systems that corresponds to the Accept-Language header provided in the format requested.

Resource URL

GET https://api.fitbit.com/1/user/[user-id]/body/log/[goal-type]/goal.json

user-idThe encoded ID of the user. Use "-" (dash) for current logged-in user.
goal-typeweight or fat

Request Headers

Accept-LanguageoptionalThe measurement unit system to use for response values.

Example Responses

For Weight

{
    "goal":{
        "startDate": "2015-01-15",
        "startWeight": "150";,
        "weight": "140";
    }
}

For Fat

{
    "goal":{
        "fat": "12"
    }
}

Update Body Fat Goal

The Update Body Fat Goal API creates or updates user's fat percentage goal.

Resource URL

POST https://api.fitbit.com/1/user/[user-id]/body/log/fat/goal.json

user-idThe encoded ID of the user. Use "-" (dash) for current logged-in user.

POST Parameters

fatrequiredTarget body fat percentage; in the format X.XX.

Example Response

{
    "goal":{
        "fat": "12"
    }
}

Update Weight Goal

The Update Weight Goal API creates or updates user's fat or weight goal using units in the unit systems that corresponds to the Accept-Language header provided in the format requested.

Resource URL

POST https://api.fitbit.com/1/user/[user-id]/body/log/weight/goal.json

user-idThe encoded ID of the user. Use "-" (dash) for current logged-in user.

Request Headers

Accept-LanguageoptionalThe measurement unit system to use for response values.

POST Parameters

startDaterequiredWeight goal start date; in the format yyyy-MM-dd.
startWeightrequiredWeight goal start weight; in the format X.XX, in the unit systems that corresponds to the Accept-Language header provided.
weightrequired/optionalWeight goal target weight; in the format X.XX, in the unit systems that corresponds to the Accept-Language header provided; required if user doesn't have an existing weight goal.

Example Responses

{
    "goal":{
        "startDate": "2015-01-15",
        "startWeight": "150";,
        "weight": "140";
    }
}

Weight

Get Weight Logs

The Get Weight Logs API retrieves a list of all user's body weight log entries for a given day using units in the unit systems which corresponds to the Accept-Language header provided. Body weight log entries are available only to authorized user. Body weight log entries in response are sorted exactly the same as they are presented on the Fitbit website.

Resource URL

There are three acceptable formats for retrieving weight log data:

  1. GET https://api.fitbit.com/1/user/[user-id]/body/log/weight/date/[date].json

  2. GET https://api.fitbit.com/1/user/[user-id]/body/log/weight/date/[base-date]/[period].json

  3. GET https://api.fitbit.com/1/user/[user-id]/body/log/weight/date/[base-date]/[end-date].json

user-idThe encoded ID of the user. Use "-" (dash) for current logged-in user.
dateThe date in the format yyyy-MM-dd.
base-dateThe end date when period is provided, in the format yyyy-MM-dd; range start date when a date range is provided.
periodThe date range period. One of 1d, 7d, 30d, 1w, 1m.
end-dateRange end date when date range is provided. Note: The period must not be longer than 31 days.

Request Headers

Accept-LanguageoptionalThe measurement unit system to use for response values.

Response Fields


bmiCalculated BMI in the format X.XX.
dateLog entry date; in the format yyyy-MM-dd.
weightWeight in the format X.XX, in the unit system that corresponds to the Accept-Language header provided or if not provided in metric.
logIdWeight Log IDs are unique to the user, but not globally unique.
timeTime of the measurement; hours and minutes in the format HH:mm:ss, set to the last second of the day if not provided.
sourceThe source of the weight log; the field is optional.

Example Response

{
    "weight":[
        {
            "bmi":23.57,
            "date":"2015-03-05",
            "logId":1330991999000,
            "time":"23:59:59",
            "weight":73,
            "source": "API"
        },
        {
            "bmi":22.57,
            "date":"2015-03-05",
            "logId":1330991999000,
            "time":"21:10:59",
            "weight":72.5,
            "source": "Aria"
        }
    ]
}

Log Weight

The Log Weight API creates log entry for a body weight using units in the unit systems that corresponds to the Accept-Language header provided and get a response in the format requested.

Note: The returned Weight Log IDs are unique to the user, but not globally unique.

Resource URL

POST https://api.fitbit.com/1/user/[user-id]/body/log/weight.json

user-idThe encoded ID of the user. Use "-" for current logged-in user.

POST Parameters

weightrequiredWeight - in the format X.XX.
daterequiredLog entry date - in the format yyyy-MM-dd.
timeoptionalTime of the measurement - hours and minutes in the format HH:mm:ss, which is set to the last second of the day if time is not provided.

Request Headers

Accept-LanguageoptionalThe measurement unit system to use for response values.

Example Response

{
    "weightLog": [
        {
            "bmi": 23.57,
            "date": "2012-03-05",
            "logId": 1330991999000,
            "time": "23:59:59",
            "weight": 73,
            "source": "API"
        }
    ]
}

Delete Weight Log

The Delete Weight Log API deletes a user's body weight log entry with the given ID.

Note: A successful request returns a 204 status code with an empty response body.

Resource URL

DELETE https://api.fitbit.com/1/user/[user-id]/body/log/weight/[body-weight-log-id].json

user-idThe encoded ID of the user. Use "-" (dash) for current logged-in user.
body-weight-log-idThe ID of the body weight log entry.