The Google Fit APIs, including the Google Fit REST API, will no longer be available after June 30, 2025. As of May 1, 2024, developers cannot sign up to use these APIs.
Stay organized with collections
Save and categorize content based on your preferences.
For data that can be continuously recorded (with multiple data points over a time
period), the Google Fit platform can aggregate this data and return the
calculated results. This can be an average measurement or a summary/total. You
can save time on these calculations and show your app users useful summaries or
averages easily by reading aggregated data.
To read aggregated data, you need to pick a data type, time range, and something
to 'bucket' (or group) the data by. You can bucket data in a few different ways:
Time period
Bucket aggregated data by per hour or per day. For example, see steps or calories burned per day.
Activity type
Bucket aggregated data by activity type. For example, for sleep data over a week, there will be a bucket for each sleep activity type (light, deep and REM).
Activity segment
Bucket aggregated data by the activity segments over a time period. For example, if a user went for a run between 9am and 10am but ran for the first 20 minutes, sat down for 10 minutes, walked for 15 minutes and ran for 15 minutes, these are considered 4 activity segments and would return 4 buckets.
Session
Use the time boundaries of sessions to aggregate data. For example, if a user went for 2 runs which were logged as 2 sessions (a morning run and an afternoon run), you can bucket by session to learn the average steps or average speed of each run.
Activity
Use these data types to read aggregated health and wellness data.
Activity summary
Total time and number of segments for a particular activity over a time period.
Each data point represents a summary of all activity segments for a particular
activity type over a time interval.
The type of activity the user was doing. See the list of activity types here.
duration (int—milliseconds)
The total time spent on an activity across all segments in the time range.
number of segments (int—count)
The number of distinct activity segments over the time interval of this data point.
Android
Name
com.google.activity.summary
Data type object
AGGREGATE_ACTIVITY_SUMMARY
Fields (format—units)
FIELD_ACTIVITY (int—enum)
The type of activity the user was doing. See the list of activity types here.
FIELD_DURATION (int—milliseconds)
The total time spent on an activity across all segments in the time range.
FIELD_NUM_SEGMENTS (int—count)
The number of distinct activity segments over the time interval of this data point.
Basal metabolic rate (BMR) summary
Each data point represents the user's average, maximum and minimum basal metabolic rate
over the time range, in kilocalories per day. This is useful if the user has
gained or lost weight and therefore their BMR has changed.
The aggregate or total calories burned, in kilocalories, over a time period.
This data type and its fields are the same as for the instantaneous data
type.
Heart Points summary
Each data point represents the number of heart points earned over the time period.
The user's average power generated over the time period, in watts.
max (float—watts)
The user's maximum power generated over the time period, in watts.
min (float—watts)
The user's minimum power generated over the time period, in watts.
Android
Name
com.google.power.summary
Data type object
AGGREGATE_POWER_SUMMARY
Fields (format—units)
FIELD_AVERAGE (float—watts)
The user's average power generated over the time period, in watts.
FIELD_MAX (float—watts)
The user's maximum power generated over the time period, in watts.
FIELD_MIN (float—watts)
The user's minimum power generated over the time period, in watts.
Step count delta summary
Each data point represents the total number of steps over the time period.
This data type and its fields are the same as for the instantaneous data
type.
Body
Use these data types to read aggregated body measurement data.
Body fat percentage summary
Each data point represents the user's average, maximum and minimum body fat percentage
over a time period.
REST
Name
com.google.body.fat.percentage.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.body.read
Fields (format—units)
average (float—percent)
The user's average percentage of total body mass that is body fat, over a time period.
max (float—percent)
The user's maximum percentage of total body mass that is body fat, over a time period.
min (float—percent)
The user's minimum percentage of total body mass that is body fat, over a time period.
Android
Name
com.google.body.fat.percentage.summary
Data type object
AGGREGATE_BODY_FAT_PERCENTAGE_SUMMARY
Fields (format—units)
FIELD_AVERAGE (float—percent)
The user's average percentage of total body mass that is body fat, over a time period.
FIELD_MAX (float—percent)
The user's maximum percentage of total body mass that is body fat, over a time period.
FIELD_MIN (float—percent)
The user's minimum percentage of total body mass that is body fat, over a time period.
Heart rate summary
Each data point represents the user's average, maximum and minimum heart rate over the
time period, in beats per minute.
REST
Name
com.google.heart_rate.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.body.read
Fields (format—units)
average (float—bpm)
The user's average heart rate in beats per minute, over a time period.
max (float—bpm)
The user's maximum heart rate in beats per minute, over a time period.
min (float—bpm)
The user's minimum heart rate in beats per minute, over a time period.
Android
Name
com.google.heart_rate.summary
Data type object
AGGREGATE_HEART_RATE_SUMMARY
Fields (format—units)
FIELD_AVERAGE (float—bpm)
The user's average heart rate in beats per minute, over a time period.
FIELD_MAX (float—bpm)
The user's maximum heart rate in beats per minute, over a time period.
FIELD_MIN (float—bpm)
The user's minimum heart rate in beats per minute, over a time period.
Height summary
Each data point represents the user's average, maximum and minimum height over a time
period, in meters.
REST
Name
com.google.height.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.body.read
Fields (format—units)
average (float—meters)
The user's average height over a time period, in meters.
max (float—meters)
The user's maximum height over a time period, in meters.
min (float—meters)
The user's minimum height over a time period, in meters.
Android
Name
com.google.height.summary
Data type object
AGGREGATE_HEIGHT_SUMMARY
Fields (format—units)
FIELD_AVERAGE (float—meters)
The user's average height over a time period, in meters.
FIELD_MAX (float—meters)
The user's maximum height over a time period, in meters.
FIELD_MIN (float—meters)
The user's minimum height over a time period, in meters.
Weight summary
Each data point represents the user's average, maximum and minimum weight over a
time period, in kilograms.
REST
Name
com.google.weight.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.body.read
Fields (format—units)
average (float—kg)
The user's average body weight over a time period, in kilograms.
max (float—kg)
The user's maximum body weight over a time period, in kilograms.
min (float—kg)
The user's minimum body weight over a time period, in kilograms.
Android
Name
com.google.weight.summary
Data type object
AGGREGATE_WEIGHT_SUMMARY
Fields (format—units)
FIELD_AVERAGE (float—kg)
The user's average body weight over a time period, in kilograms.
FIELD_MAX (float—kg)
The user's maximum body weight over a time period, in kilograms.
FIELD_MIN (float—kg)
The user's minimum body weight over a time period, in kilograms.
Location
Use these data types to read aggregated location data.
Distance delta
Each data point represents the user's total distance travelled over a time
period, in meters. This data type and its fields are the same as for the
instantaneous data type.
Location bounding box
Each data point represents the bounding
box computed over the user's
location points over a time period. Each bounding box has four fields
representing the four corners of the bounding box.
The user's average speed over a time period, in meters per second.
max (float—meters per second)
The user's maximum speed over a time period, in meters per second.
min (float—meters per second)
The user's minimum speed over a time period, in meters per second.
Android
Name
com.google.speed.summary
Data type object
AGGREGATE_SPEED_SUMMARY
Fields (format—units)
average (float—meters per second)
The user's average speed over a time period, in meters per second.
max (float—meters per second)
The user's maximum speed over a time period, in meters per second.
min (float—meters per second)
The user's minimum speed over a time period, in meters per second.
Nutrition
Use these data types to read aggregated nutrition data.
Hydration summary
Each data point represents the total volume of water consumed by a user over a
time period, in liters. This data type and its fields are the same as for the
instantaneous data type.
Nutrition summary
Each data point represents the sum of all nutrition entries over a time period.
In the nutrients field, each value represents the sum of the nutrient over all
of the entries in the time period.
If the nutrient was not in any of the entries, it won't be in the aggregate map
either. If all entries in the time period are for the same meal, the meal type
will also be set.
The total nutrients in the food eaten over a time period.
Accepted values
"key": "calories" // Calories in kcal
"key": "fat.total" // Total fat in grams
"key": "fat.saturated" // Saturated fat in grams
"key": "fat.unsaturated" // Unsaturated fat in grams
"key": "fat.polyunsaturated" // Polyunsaturated fat in grams
"key": "fat.monounsaturated" // Monounsaturated fat in grams
"key": "fat.trans" // Trans fat in grams
"key": "cholesterol" // Cholesterol in milligrams
"key": "sodium" // Sodium in milligrams
"key": "potassium" // Potassium in milligrams
"key": "carbs.total" // Total carbohydrates in grams
"key": "dietary_fiber" // Dietary fiber in grams
"key": "sugar" // Amount of sugar in grams
"key": "protein" // Protein amount in grams
Android
Name
com.google.nutrition.summary
Data type object
AGGREGATE_NUTRITION_SUMMARY
Fields (format—units)
FIELD_MEAL_TYPE (int—enum)
What kind of meal the user ate (present if all entries in the time period are for the same meal).
The total nutrients in the food eaten over a time period.
Accepted values
NUTRIENT_CALORIES // Calories in kcal
NUTRIENT_TOTAL_FAT // Total fat in grams
NUTRIENT_SATURATED_FAT // Saturated fat in grams
NUTRIENT_UNSATURATED_FAT // Unsaturated fat in grams
NUTRIENT_POLYUNSATURATED_FAT // Polyunsaturated fat in grams
NUTRIENT_MONOUNSATURATED_FAT // Monounsaturated fat in grams
NUTRIENT_TRANS_FAT // Trans fat in grams
NUTRIENT_CHOLESTEROL // Cholesterol in milligrams
NUTRIENT_SODIUM // Sodium in milligrams
NUTRIENT_POTASSIUM // Potassium in milligrams
NUTRIENT_TOTAL_CARBS // Total carbohydrates in grams
NUTRIENT_DIETARY_FIBER // Dietary fiber in grams
NUTRIENT_SUGAR // Amount of sugar in grams
NUTRIENT_PROTEIN // Protein amount in grams
Health
Use these data types to read aggregated medical, health data.
Blood glucose summary
Each data point represents the average, minimum and maximum blood glucose level
or concentration over the time range, measured in mmol/L where 1 mmol/L is 18
mg/dL.
If the values for each of these fields are the same for all measurements taken
during the time range, you'll see the field value in the returned data:
temporal relation to a meal
temporal relation to sleep
specimen source
If the values are different across the measurements, the field will be excluded.
The user's average blood glucose level or concentration over a time period.
max (float—mmol/L)
The user's maximum blood glucose level or concentration over a time period.
min (float—mmol/L)
The user's minimum blood glucose level or concentration over a time period.
temporal relation to meal (int—enum) (optional field)
When the reading was taken compared to when the user ate.
Accepted values
"intVal": 1 // Reading wasn't taken before or after a meal
"intVal": 2 // Reading was taken during a fasting period
"intVal": 3 // Reading was taken before a meal
"intVal": 4 // Reading was taken after a meal
meal type (int—enum) (optional field)
What type of meal the user ate around when the reading was taken.
temporal relation to sleep (int—enum) (optional field)
When the reading was taken compared to when the user slept.
Accepted values
"intVal": 1 // User was fully awake
"intVal": 2 // Before the user fell asleep
"intVal": 3 // After the user woke up
"intVal": 4 // While the user was still sleeping
specimen source (int—enum) (optional field)
Type of body fluid used to measure the blood glucose.
When the reading was taken compared to when the user ate.
Accepted values
FIELD_TEMPORAL_RELATION_TO_MEAL_GENERAL // Reading wasn't taken before or after a meal
FIELD_TEMPORAL_RELATION_TO_MEAL_FASTING // Reading was taken during a fasting period
FIELD_TEMPORAL_RELATION_TO_MEAL_BEFORE_MEAL // Reading was taken before a meal
FIELD_TEMPORAL_RELATION_TO_MEAL_AFTER_MEAL // Reading was taken after a meal
FIELD_MEAL_TYPE (int—enum) (optional field)
What type of meal the user ate around when the reading was taken.
When the reading was taken compared to when the user slept.
Accepted values
TEMPORAL_RELATION_TO_SLEEP_FULLY_AWAKE // User was fully awake.
TEMPORAL_RELATION_TO_SLEEP_BEFORE_SLEEP // Before the user fell asleep.
TEMPORAL_RELATION_TO_SLEEP_ON_WAKING // After the user woke up.
TEMPORAL_RELATION_TO_SLEEP_DURING_SLEEP // While the user was still sleeping.
The user's average diastolic blood pressure over a time period.
FIELD_BLOOD_PRESSURE_DIASTOLIC_MAX (float—mmHg)
The user's maximum diastolic blood pressure over a time period.
FIELD_BLOOD_PRESSURE_DIASTOLIC_MIN (float—mmHg)
The user's minimum diastolic blood pressure over a time period.
FIELD_BODY_POSITION (int—enum) (optional field)
The user's body position when the measurement was taken.
Accepted values
BODY_POSITION_STANDING // Standing up
BODY_POSITION_SITTING // Sitting down
BODY_POSITION_LYING_DOWN // Lying down
BODY_POSITION_SEMI_RECUMBENT // Reclining
Which arm and part of the arm the measurement was taken.
Accepted values
BLOOD_PRESSURE_MEASUREMENT_LOCATION_LEFT_WRIST // Left wrist
BLOOD_PRESSURE_MEASUREMENT_LOCATION_RIGHT_WRIST // Right wrist
BLOOD_PRESSURE_MEASUREMENT_LOCATION_LEFT_UPPER_ARM // Left upper arm
BLOOD_PRESSURE_MEASUREMENT_LOCATION_RIGHT_UPPER_ARM // Right upper arm
Body temperature summary
Each data point represents the average, minimum and maximum body temperature of
the user over a time range.
It will also have the location the measurement was made on the body, if the
measurement location was the same for all data points in the time interval.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-20 UTC."],[[["Google Fit uses aggregate data types to provide summaries of health and wellness metrics, like steps, calories, and heart rate, over specific time periods."],["Developers can retrieve aggregated data by specifying the data type, time range, and how the data should be grouped (e.g., by time period, activity type, or session)."],["Data is categorized into activity, body, and location, each with specific data types and fields providing aggregated values like totals, averages, minimums, and maximums."],["Aggregate data types are read-only, meaning you can only retrieve data, not write or modify it."],["Accessing aggregate data types requires appropriate OAuth permissions, and Google Fit offers both REST and Android APIs for retrieval."]]],[]]