Method: users.dataTypes.dataPoints.dailyRollUp

Roll up data points over civil time intervals for supported data types.

HTTP request

POST https://health.googleapis.com/v4/{parent=users/*/dataTypes/*}/dataPoints:dailyRollUp

The URL uses gRPC Transcoding syntax. To know more about valid error responses that can be thrown by this HTTP request, please refer to the service error catalog

Path parameters

Parameters
parent

string

Required. Parent data type of the Data Point collection.

Format: users/{user}/dataTypes/{dataType}, e.g.:

  • users/me/dataTypes/steps
  • users/me/dataTypes/distance

For a list of the supported data types see the DailyRollupDataPoint value union field. It takes the form users/{user}/dataTypes/{datatype}.

Request body

The request body contains data with the following structure:

JSON representation
{
  "range": {
    object (CivilTimeInterval)
  },
  "windowSizeDays": integer,
  "pageSize": integer,
  "pageToken": string,
  "dataSourceFamily": string
}
Fields
range

object (CivilTimeInterval)

Required. Closed-open range of data points that will be rolled up. The start and end times must be aligned with the aggregation window. The maximum range for calories-in-heart-rate-zone, heart-rate, active-minutes and total-calories is 14 days. The maximum range for all other data types is 90 days.

windowSizeDays

integer

Optional. Aggregation window size, in number of days. Defaults to 1 if not specified.

pageSize

integer

Optional. The maximum number of data points to return. If unspecified, at most 1440 data points will be returned. The maximum page size is 10000; values above that will be truncated accordingly.

pageToken

string

Optional. The nextPageToken from a previous request, if any. All other request fields need to be the same as in the initial request when the page token is specified.

dataSourceFamily

string

Optional. The data source family name to roll up. If empty, data points from all available data sources will be rolled up.

Format: users/me/dataSourceFamilies/{dataSourceFamily}

The supported values are:

  • users/me/dataSourceFamilies/all-sources - default value
  • users/me/dataSourceFamilies/google-wearables - tracker devices
  • users/me/dataSourceFamilies/google-sources - Google first party sources

Response body

Response containing the list of rolled up data points.

If successful, the response body contains data with the following structure:

JSON representation
{
  "rollupDataPoints": [
    {
      object (DailyRollupDataPoint)
    }
  ]
}
Fields
rollupDataPoints[]

object (DailyRollupDataPoint)

Values for each aggregation time window.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/googlehealth.activity_and_fitness
  • https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly
  • https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements
  • https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonly
  • https://www.googleapis.com/auth/googlehealth.location
  • https://www.googleapis.com/auth/googlehealth.location.readonly
  • https://www.googleapis.com/auth/googlehealth.nutrition
  • https://www.googleapis.com/auth/googlehealth.nutrition.readonly
  • https://www.googleapis.com/auth/googlehealth.sleep
  • https://www.googleapis.com/auth/googlehealth.sleep.readonly

For more information, see the OAuth 2.0 Overview.

CivilTimeInterval

Counterpart of google.type.Interval, but using CivilDateTime.

JSON representation
{
  "start": {
    object (CivilDateTime)
  },
  "end": {
    object (CivilDateTime)
  }
}
Fields
start

object (CivilDateTime)

Required. The inclusive start of the range.

end

object (CivilDateTime)

Required. The exclusive end of the range.

DailyRollupDataPoint

Value of a daily rollup for a single civil time interval (aggregation window)

JSON representation
{
  "civilStartTime": {
    object (CivilDateTime)
  },
  "civilEndTime": {
    object (CivilDateTime)
  },

  // Union field value can be only one of the following:
  "steps": {
    object (StepsRollupValue)
  },
  "floors": {
    object (FloorsRollupValue)
  },
  "heartRate": {
    object (HeartRateRollupValue)
  },
  "restingHeartRatePersonalRange": {
    object (RestingHeartRatePersonalRangeRollupValue)
  },
  "heartRateVariabilityPersonalRange": {
    object (HeartRateVariabilityPersonalRangeRollupValue)
  },
  "weight": {
    object (WeightRollupValue)
  },
  "altitude": {
    object (AltitudeRollupValue)
  },
  "distance": {
    object (DistanceRollupValue)
  },
  "bodyFat": {
    object (BodyFatRollupValue)
  },
  "totalCalories": {
    object (TotalCaloriesRollupValue)
  },
  "activeZoneMinutes": {
    object (ActiveZoneMinutesRollupValue)
  },
  "sedentaryPeriod": {
    object (SedentaryPeriodRollupValue)
  },
  "runVo2Max": {
    object (RunVO2MaxRollupValue)
  },
  "caloriesInHeartRateZone": {
    object (CaloriesInHeartRateZoneRollupValue)
  },
  "activityLevel": {
    object (ActivityLevelRollupValue)
  },
  "hydrationLog": {
    object (HydrationLogRollupValue)
  },
  "timeInHeartRateZone": {
    object (TimeInHeartRateZoneRollupValue)
  },
  "activeMinutes": {
    object (ActiveMinutesRollupValue)
  }
  // End of list of possible types for union field value.
}
Fields
civilStartTime

object (CivilDateTime)

Start time of the window this value aggregates over

civilEndTime

object (CivilDateTime)

End time of the window this value aggregates over

Union field value. Outcome of a rollup of the requested roll-up type.

{RollUpType}RollupValue messages for each data type contain aggregated values for all supported fields.

The field names usually follow the format {original_field_name}_{aggregation_function}. For example: confidence_min, confidence_sum.

If there were no data points in this interval, the value will not be set. These messages represent the aggregated data payload for each data type and are embedded within the DailyRollupDataPoint. They are not standalone resources themselves. value can be only one of the following:

steps

object (StepsRollupValue)

Returned by default when rolling up data points from the steps data type, or when requested explicitly using the steps rollup type identifier.

floors

object (FloorsRollupValue)

Returned by default when rolling up data points from the floors data type, or when requested explicitly using the floors rollup type identifier.

heartRate

object (HeartRateRollupValue)

Returned by default when rolling up data points from the heart-rate data type, or when requested explicitly using the heart-rate rollup type identifier.

restingHeartRatePersonalRange

object (RestingHeartRatePersonalRangeRollupValue)

Returned by default when rolling up data points from the daily-resting-heart-rate data type, or when requested explicitly using the resting-heart-rate-personal-range rollup type identifier.

heartRateVariabilityPersonalRange

object (HeartRateVariabilityPersonalRangeRollupValue)

Returned by default when rolling up data points from the daily-heart-rate-variability data type, or when requested explicitly using the heart-rate-variability-personal-range rollup type identifier.

weight

object (WeightRollupValue)

Returned by default when rolling up data points from the weight data type, or when requested explicitly using the weight rollup type identifier.

altitude

object (AltitudeRollupValue)

Returned by default when rolling up data points from the altitude data type, or when requested explicitly using the altitude rollup type identifier.

distance

object (DistanceRollupValue)

Returned by default when rolling up data points from the distance data type, or when requested explicitly using the distance rollup type identifier.

bodyFat

object (BodyFatRollupValue)

Returned by default when rolling up data points from the body-fat data type, or when requested explicitly using the body-fat rollup type identifier.

totalCalories

object (TotalCaloriesRollupValue)

Returned by default when rolling up data points from the total-calories data type, or when requested explicitly using the total-calories rollup type identifier.

activeZoneMinutes

object (ActiveZoneMinutesRollupValue)

Returned by default when rolling up data points from the active-zone-minutes data type, or when requested explicitly using the active-zone-minutes rollup type identifier.

sedentaryPeriod

object (SedentaryPeriodRollupValue)

Returned by default when rolling up data points from the sedentary-period data type, or when requested explicitly using the sedentary-period rollup type identifier.

runVo2Max

object (RunVO2MaxRollupValue)

Returned by default when rolling up data points from the run-vo2-max data type, or when requested explicitly using the run-vo2-max rollup type identifier.

caloriesInHeartRateZone

object (CaloriesInHeartRateZoneRollupValue)

Returned by default when rolling up data points from the calories-in-heart-rate-zone data type, or when requested explicitly using the calories-in-heart-rate-zone rollup type identifier.

activityLevel

object (ActivityLevelRollupValue)

Returned by default when rolling up data points from the activity-level data type, or when requested explicitly using the activity-level rollup type identifier.

hydrationLog

object (HydrationLogRollupValue)

Returned by default when rolling up data points from the hydration-log data type, or when requested explicitly using the hydration-log rollup type identifier.

timeInHeartRateZone

object (TimeInHeartRateZoneRollupValue)

Returned by default when rolling up data points from the time-in-heart-rate-zone data type, or when requested explicitly using the time-in-heart-rate-zone rollup type identifier.

activeMinutes

object (ActiveMinutesRollupValue)

Returned by default when rolling up data points from the active-minutes data type, or when requested explicitly using the active-minutes rollup type identifier.

RestingHeartRatePersonalRangeRollupValue

Represents the rollup value for the daily resting heart rate data type.

JSON representation
{
  "beatsPerMinuteMin": number,
  "beatsPerMinuteMax": number
}
Fields
beatsPerMinuteMin

number

The lower bound of the user's daily resting heart rate personal range.

beatsPerMinuteMax

number

The upper bound of the user's daily resting heart rate personal range.

HeartRateVariabilityPersonalRangeRollupValue

Represents the result of the rollup of the user's daily heart rate variability personal range.

JSON representation
{
  "averageHeartRateVariabilityMillisecondsMin": number,
  "averageHeartRateVariabilityMillisecondsMax": number
}
Fields
averageHeartRateVariabilityMillisecondsMin

number

The lower bound of the user's average heart rate variability personal range.

averageHeartRateVariabilityMillisecondsMax

number

The upper bound of the user's average heart rate variability personal range.