Aggregate data types

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.

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.

You can use these data types to read aggregated data.

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.

REST

Namecom.google.activity.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.activity.read
Fields (format—units)
activity (int—enum)
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

Namecom.google.activity.summary
Data type objectAGGREGATE_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.

REST

Namecom.google.calories.bmr.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.activity.read
Fields (format—units)
average (float—kcal per day)
The user's average BMR over a time period.
max (float—kcal per day)
The user's maximum BMR over a time period.
min (float—kcal per day)
The user's minimum BMR over a time period.

Android

Namecom.google.calories.bmr.summary
Data type objectAGGREGATE_BASAL_METABOLIC_RATE_SUMMARY
Fields (format—units)
FIELD_AVERAGE (float—kcal per day)
The user's average BMR over a time period.
FIELD_MAX (float—kcal per day)
The user's maximum BMR over a time period.
FIELD_MIN (float—kcal per day)
The user's minimum BMR over a time period.

Calories burned summary

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.

REST

Namecom.google.heart_minutes.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.activity.read
Fields (format—units)
intensity (float—Heart Points)
The number of Heart Points earned over the time period, including points earned by multipliers (more points earned for more strenuous activity).
duration (float—minutes)
The time the Heart Points were earned in, measured in minutes.

Android

Namecom.google.heart_minutes.summary
Data type objectAGGREGATE_HEART_POINTS
Fields (format—units)
FIELD_INTENSITY (float—Heart Points)
The number of Heart Points earned over the time period, including points earned by multipliers (more points earned for more strenuous activity).
FIELD_DURATION (float—minutes)
The time the Heart Points were earned in, measured in minutes.

Move Minutes summary

The total number of move minutes over the time period. This data type and fields are the same as for the instantaneous data type.

Power summary

Each data point represents the user's average, maximum and minimum power generated in watts, over a time period.

REST

Namecom.google.power.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.activity.read
Fields (format—units)
average (float—watts)
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

Namecom.google.power.summary
Data type objectAGGREGATE_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

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

Namecom.google.body.fat.percentage.summary
Data type objectAGGREGATE_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

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

Namecom.google.heart_rate.summary
Data type objectAGGREGATE_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

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

Namecom.google.height.summary
Data type objectAGGREGATE_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

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

Namecom.google.weight.summary
Data type objectAGGREGATE_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.

REST

Namecom.google.location.bounding_box
OAuth permission scopes
https://www.googleapis.com/auth/fitness.location.read
Fields (format—units)
low latitude (float—degrees)
Minimum latitude of the bounding box, represented as a float, in degrees.
low longitude (float—degrees)
Minimum longitude of the bounding box, represented as a float, in degrees.
high latitude (float—degrees)
Maximum latitude of the bounding box, represented as a float, in degrees.
high longitude (float—degrees)
Maximum longitude of the bounding box, represented as a float, in degrees.

Android

Namecom.google.location.bounding_box
Data type objectAGGREGATE_LOCATION_BOUNDING_BOX
Fields (format—units)
FIELD_LOW_LATITUDE (float—degrees)
Latitude of the lower left corner of the bounding box, represented as a float, in degrees.
FIELD_LOW_LONGITUDE (float—degrees)
Longitude of the lower left corner of the bounding box, represented as a float, in degrees.
FIELD_HIGH_LATITUDE (float—degrees)
Latitude of the upper right corner of the bounding box, represented as a float, in degrees.
FIELD_HIGH_LONGITUDE (float—degrees)
Longitude of the upper right corner of the bounding box, represented as a float, in degrees.

Speed summary

Each data point represents the average, maximum and minimum speed the user travelled over a time period, in meters per second.

REST

Namecom.google.speed.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.location.read
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.

Android

Namecom.google.speed.summary
Data type objectAGGREGATE_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.

REST

Namecom.google.nutrition.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.nutrition.read
Fields (format—units)
meal type (int—enum)
What kind of meal the user ate (present if all entries in the time period are for the same meal).
nutrients (Map<String>—calories/grams)
The total nutrients in the food eaten over a time period.

Android

Namecom.google.nutrition.summary
Data type objectAGGREGATE_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).
FIELD_NUTRIENTS (Map<String>—kilocalories/grams/milligrams)
The total nutrients in the food eaten over a time period.