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

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.

Restricted

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.

REST

Namecom.google.blood_glucose.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.blood_glucose.read
Fields (format—units)
average (float—mmol/L)
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.
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.
specimen source (int—enum) (optional field)
Type of body fluid used to measure the blood glucose.

Android

Namecom.google.blood_glucose.summary
Data type objectAGGREGATE_BLOOD_GLUCOSE_SUMMARY
Fields (format—units)
FIELD_AVERAGE (float—mmol/L)
The user's average blood glucose level or concentration over a time period.
FIELD_MAX (float—mmol/L)
The user's maximum blood glucose level or concentration over a time period.
FIELD_MIN (float—mmol/L)
The user's minimum blood glucose level or concentration over a time period.
FIELD_TEMPORAL_RELATION_TO_MEAL (int—enum) (optional field)
When the reading was taken compared to when the user ate.
FIELD_MEAL_TYPE (int—enum) (optional field)
What type of meal the user ate around when the reading was taken.
FIELD_TEMPORAL_RELATION_TO_SLEEP (int—enum) (optional field)
When the reading was taken compared to when the user slept.
FIELD_BLOOD_GLUCOSE_SPECIMEN_SOURCE (int—enum) (optional field)
Type of body fluid used to measure the blood glucose.

Blood pressure summary

Each data point represents the average, minimum and maximum blood pressure over the time range, measured in mmHg.

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:

  • body position
  • measurement location

If the values are different across the measurements, the field will be excluded.

REST

Namecom.google.blood_pressure.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.blood_pressure.read
Fields (format—units)
average systolic (float—mmHg)
The user's average systolic blood pressure over a time period.
max systolic (float—mmHg)
The user's maximum systolic blood pressure over a time period.
min systolic (float—mmHg)
The user's minimum systolic blood pressure over a time period.
average diastolic (float—mmHg)
The user's average diastolic blood pressure over a time period.
max diastolic (float—mmHg)
The user's maximum diastolic blood pressure over a time period.
min diastolic (float—mmHg)
The user's minimum diastolic blood pressure over a time period.
body position (int—enum) (optional field)
The user's body position when the measurement was taken.
measurement location (int—enum) (optional field)
Which arm and part of the arm the measurement was taken.

Android

Namecom.google.blood_pressure.summary
Data type objectAGGREGATE_BLOOD_PRESSURE_SUMMARY
Fields (format—units)
FIELD_BLOOD_PRESSURE_SYSTOLIC_AVERAGE (float—mmHg)
The user's average systolic blood pressure over a time period.
FIELD_BLOOD_PRESSURE_SYSTOLIC_MAX (float—mmHg)
The user's maximum systolic blood pressure over a time period.
FIELD_BLOOD_PRESSURE_SYSTOLIC_MIN (float—mmHg)
The user's minimum systolic blood pressure over a time period.
FIELD_BLOOD_PRESSURE_DIASTOLIC_AVERAGE (float—mmHg)
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.
FIELD_BLOOD_PRESSURE_MEASUREMENT_LOCATION (int—enum) (optional field)
Which arm and part of the arm the measurement was taken.

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.

REST

Namecom.google.body.temperature.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.body_temperature.read
Fields (format—units)
average (float—celsius)
The user's average body temperature over a time period.
max (float—celsius)
The user's maximum body temperature over a time period.
min (float—celsius)
The user's minimum body temperature over a time period.
measurement location (int—enum) (optional field)
Where on the user's body the temperature measurement was taken from.

Android

Namecom.google.body.temperature.summary
Data type objectAGGREGATE_BODY_TEMPERATURE_SUMMARY
Fields (format—units)
FIELD_AVERAGE (float—celsius)
The user's average body temperature over a time period.
FIELD_MAX (float—celsius)
The user's maximum body temperature over a time period.
FIELD_MIN (float—celsius)
The user's minimum body temperature over a time period.
FIELD_BODY_TEMPERATURE_MEASUREMENT_LOCATION (int—enum) (optional field)
Where on the user's body the temperature measurement was taken from.

Oxygen saturation summary

Each data point represents the average, minimum, and maximum blood oxygen saturation and supplemental oxygen flow rate of the user of a time interval.

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:

  • oxygen therapy administration mode
  • oxygen saturation system
  • oxygen saturation measurement method

If the values are different across the measurements, the field will be excluded.

REST

Namecom.google.oxygen_saturation.summary
OAuth permission scopes
https://www.googleapis.com/auth/fitness.oxygen_saturation.read
Fields (format—units)
average oxygen saturation (float—percentage)
The user's average oxygen saturation over a time period.
max oxygen saturation (float—percentage)
The user's maximum oxygen saturation over a time period.
min oxygen saturation (float—percentage)
The user's minimum oxygen saturation over a time period.
average supplemental oxygen flow rate (float—L/min)
The user's average supplemental oxygen flow rate over a time period.
max supplemental oxygen flow rate (float—L/min)
The user's maximum supplemental oxygen flow rate over a time period.
min supplemental oxygen flow rate (float—L/min)
The user's minimum supplemental oxygen flow rate over a time period.
oxygen therapy administration mode (int—enum) (optional field)
How oxygen therapy is administered.
Can be absent or 1 if administered by nasal canula.
oxygen saturation system (int—enum) (optional field)
Where oxygen saturation is measured.
Can be absent or 1 if measured in peripheral capillaries.
oxygen saturation measurement method (int—enum) (optional field)
How oxygen saturation is measured.
Can be absent or 1 if measured by pulse oximetry.

Android

Namecom.google.oxygen_saturation.summary
Data type objectAGGREGATE_OXYGEN_SATURATION_SUMMARY
Fields (format—units)
FIELD_OXYGEN_SATURATION_AVERAGE (float—percentage)
The user's average oxygen saturation over a time period.
FIELD_OXYGEN_SATURATION_MAX (float—percentage)
The user's maximum oxygen saturation over a time period.
FIELD_OXYGEN_SATURATION_MIN (float—percentage)
The user's minimum oxygen saturation over a time period.
FIELD_SUPPLEMENTAL_OXYGEN_FLOW_RATE_AVERAGE (float—L/min)
The user's average supplemental oxygen flow rate over a time period.
FIELD_SUPPLEMENTAL_OXYGEN_FLOW_RATE_MAX (float—L/min)
The user's maximum supplemental oxygen flow rate over a time period.
FIELD_SUPPLEMENTAL_OXYGEN_FLOW_RATE_MIN (float—L/min)
The user's minimum supplemental oxygen flow rate over a time period.
FIELD_OXYGEN_THERAPY_ADMINISTRATION_MODE (int—enum) (optional field)
How oxygen therapy is administered.
Can be absent or 1 if administered by nasal canula.
FIELD_OXYGEN_SATURATION_SYSTEM (int—enum) (optional field)
Where oxygen saturation is measured.
Can be absent or 1 if measured in peripheral capillaries.
FIELD_OXYGEN_SATURATION_MEASUREMENT_METHOD (int—enum) (optional field)
How oxygen saturation is measured.
Can be absent or 1 if measured by pulse oximetry.