Skip to main content

data_points

Creates, updates, deletes, gets or lists a data_points resource.

Overview

Namedata_points
TypeResource
Idgoogle.health.data_points

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. Data point name, only supported for the subset of identifiable data types. For the majority of the data types, individual data points do not need to be identified and this field would be empty. Format: users/{user}/dataTypes/{data_type}/dataPoints/{data_point} Example: users/abcd1234/dataTypes/sleep/dataPoints/a1b2c3d4-e5f6-7890-1234-567890abcdef The {user} ID is a system-generated identifier, as described in Identity.health_user_id. The {data_type} ID corresponds to the kebab-case version of the field names in the DataPoint data union field, e.g. heart-rate for the heart_rate field. The {data_point} ID can be client-provided or system-generated. If client-provided, it must be a string of 4-63 characters, containing only lowercase letters, numbers, and hyphens.
activeEnergyBurnedobjectOptional. Data for points in the active-energy-burned interval data type collection. (id: ActiveEnergyBurned)
activeMinutesobjectOptional. Data for points in the active-minutes interval data type collection. (id: ActiveMinutes)
activeZoneMinutesobjectOptional. Data for points in the active-zone-minutes interval data type collection, measured in minutes. (id: ActiveZoneMinutes)
activityLevelobjectOptional. Data for points in the activity-level daily data type collection. (id: ActivityLevel)
altitudeobjectOptional. Data for points in the altitude interval data type collection. (id: Altitude)
basalEnergyBurnedobjectOptional. Data for points in the basal-energy-burned interval data type collection. (id: BasalEnergyBurned)
bloodGlucoseobjectOptional. Data for points in the blood-glucose sample data type collection. (id: BloodGlucose)
bodyFatobjectOptional. Data for points in the body-fat sample data type collection. (id: BodyFat)
coreBodyTemperatureobjectOptional. Data for points in the core-body-temperature sample data type collection. (id: CoreBodyTemperature)
dailyHeartRateVariabilityobjectOptional. Data for points in the daily-heart-rate-variability daily data type collection. (id: DailyHeartRateVariability)
dailyHeartRateZonesobjectOptional. Data for points in the daily-heart-rate-zones daily data type collection. (id: DailyHeartRateZones)
dailyOxygenSaturationobjectOptional. Data for points in the daily-oxygen-saturation daily data type collection. (id: DailyOxygenSaturation)
dailyRespiratoryRateobjectOptional. Data for points in the daily-respiratory-rate daily data type collection. (id: DailyRespiratoryRate)
dailyRestingHeartRateobjectOptional. Data for points in the daily-resting-heart-rate daily data type collection. (id: DailyRestingHeartRate)
dailySleepTemperatureDerivationsobjectOptional. Data for points in the daily-sleep-temperature-derivations daily data type collection. (id: DailySleepTemperatureDerivations)
dailyVo2MaxobjectOptional. Data for points in the daily-vo2-max daily data type collection. (id: DailyVO2Max)
dataSourceobjectOptional. Data source information for the metric (id: DataSource)
distanceobjectOptional. Data for points in the distance interval data type collection. (id: Distance)
electrocardiogramobjectOptional. Data for points in the electrocardiogram session data type collection. (id: Electrocardiogram)
exerciseobjectOptional. Data for points in the exercise session data type collection. (id: Exercise)
floorsobjectOptional. Data for points in the floors interval data type collection. (id: Floors)
foodobjectOptional. The food details. (id: Food)
foodMeasurementUnitobjectOptional. The food measurement unit details. (id: FoodMeasurementUnit)
heartRateobjectOptional. Data for points in the heart-rate sample data type collection. (id: HeartRate)
heartRateVariabilityobjectOptional. Data for points in the heart-rate-variability sample data type collection. (id: HeartRateVariability)
heightobjectOptional. Data for points in the height sample data type collection. (id: Height)
hydrationLogobjectOptional. Data for points in the hydration-log session data type collection. (id: HydrationLog)
irregularRhythmNotificationobjectOptional. Data for points in the irregular-rhythm-notification session data type collection. (id: IrregularRhythmNotification)
nutritionLogobjectOptional. Data for points in the nutrition-log session data type collection. (id: NutritionLog)
oxygenSaturationobjectOptional. Data for points in the oxygen-saturation sample data type collection. (id: OxygenSaturation)
respiratoryRateSleepSummaryobjectOptional. Data for points in the respiratory-rate-sleep-summary sample data type collection. (id: RespiratoryRateSleepSummary)
runVo2MaxobjectOptional. Data for points in the run-vo2-max sample data type collection. (id: RunVO2Max)
sedentaryPeriodobjectOptional. Data for points in the sedentary-period interval data type collection. (id: SedentaryPeriod)
sleepobjectOptional. Data for points in the sleep session data type collection. (id: Sleep)
stepsobjectOptional. Data for points in the steps interval data type collection. (id: Steps)
swimLengthsDataobjectOptional. Data for points in the swim-lengths-data interval data type collection. (id: SwimLengthsData)
timeInHeartRateZoneobjectOptional. Data for points in the time-in-heart-rate-zone interval data type collection. (id: TimeInHeartRateZone)
vo2MaxobjectOptional. Data for points in the vo2-max sample data type collection. (id: VO2Max)
weightobjectOptional. Data for points in the weight sample data type collection. (id: Weight)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectusersId, dataTypesId, dataPointsIdGet a single identifyable data point.
listselectusersId, dataTypesIdpageSize, pageToken, filterQuery user health and fitness data points.
createinsertusersId, dataTypesIdCreates a single identifiable data point.
patchupdateusersId, dataTypesId, dataPointsIdUpdates a single identifiable data point. If a data point with the specified name is not found, the request will fail.
batch_deletedeleteusersId, dataTypesIdDelete a batch of identifyable data points.
reconcileexecusersId, dataTypesIdpageSize, pageToken, filter, dataSourceFamilyReconcile data points from multiple data sources into a single data stream.
export_exercise_tcxexecusersId, dataTypesId, dataPointsIdpartialDataExports exercise data in TCX format. IMPORTANT: HTTP clients must append ?alt=media to the request URL to download the raw TCX file. Example: https://health.googleapis.com/v4/users/me/dataTypes/exercise/dataPoints/EXERCISE_ID:exportExerciseTcx?alt=media Without alt=media, the server returns a JSON response (ExportExerciseTcxResponse) which is intended primarily for gRPC clients. Note: While the Authorization section below states that any one of the listed scopes is accepted, this specific method requires the user to provide both one of the activity_and_fitness scopes (normal or readonly) AND one of the location scopes (normal or readonly) in their access token to succeed.
roll_upexecusersId, dataTypesIdRoll up data points over physical time intervals for supported data types.
daily_roll_upexecusersId, dataTypesIdRoll up data points over civil time intervals for supported data types.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
dataPointsIdstring
dataTypesIdstring
usersIdstring
dataSourceFamilystring
filterstring
pageSizeinteger (int32)
pageTokenstring
partialDataboolean

SELECT examples

Get a single identifyable data point.

SELECT
name,
activeEnergyBurned,
activeMinutes,
activeZoneMinutes,
activityLevel,
altitude,
basalEnergyBurned,
bloodGlucose,
bodyFat,
coreBodyTemperature,
dailyHeartRateVariability,
dailyHeartRateZones,
dailyOxygenSaturation,
dailyRespiratoryRate,
dailyRestingHeartRate,
dailySleepTemperatureDerivations,
dailyVo2Max,
dataSource,
distance,
electrocardiogram,
exercise,
floors,
food,
foodMeasurementUnit,
heartRate,
heartRateVariability,
height,
hydrationLog,
irregularRhythmNotification,
nutritionLog,
oxygenSaturation,
respiratoryRateSleepSummary,
runVo2Max,
sedentaryPeriod,
sleep,
steps,
swimLengthsData,
timeInHeartRateZone,
vo2Max,
weight
FROM google.health.data_points
WHERE usersId = '{{ usersId }}' -- required
AND dataTypesId = '{{ dataTypesId }}' -- required
AND dataPointsId = '{{ dataPointsId }}' -- required
;

INSERT examples

Creates a single identifiable data point.

INSERT INTO google.health.data_points (
data__activeEnergyBurned,
data__heartRate,
data__dailyVo2Max,
data__steps,
data__runVo2Max,
data__vo2Max,
data__dailyRestingHeartRate,
data__bloodGlucose,
data__activeMinutes,
data__dailyHeartRateVariability,
data__oxygenSaturation,
data__hydrationLog,
data__nutritionLog,
data__heartRateVariability,
data__weight,
data__sleep,
data__dailyOxygenSaturation,
data__food,
data__altitude,
data__swimLengthsData,
data__basalEnergyBurned,
data__dailyRespiratoryRate,
data__irregularRhythmNotification,
data__distance,
data__exercise,
data__floors,
data__respiratoryRateSleepSummary,
data__foodMeasurementUnit,
data__activityLevel,
data__timeInHeartRateZone,
data__dailySleepTemperatureDerivations,
data__height,
data__name,
data__electrocardiogram,
data__activeZoneMinutes,
data__coreBodyTemperature,
data__sedentaryPeriod,
data__dailyHeartRateZones,
data__dataSource,
data__bodyFat,
usersId,
dataTypesId
)
SELECT
'{{ activeEnergyBurned }}',
'{{ heartRate }}',
'{{ dailyVo2Max }}',
'{{ steps }}',
'{{ runVo2Max }}',
'{{ vo2Max }}',
'{{ dailyRestingHeartRate }}',
'{{ bloodGlucose }}',
'{{ activeMinutes }}',
'{{ dailyHeartRateVariability }}',
'{{ oxygenSaturation }}',
'{{ hydrationLog }}',
'{{ nutritionLog }}',
'{{ heartRateVariability }}',
'{{ weight }}',
'{{ sleep }}',
'{{ dailyOxygenSaturation }}',
'{{ food }}',
'{{ altitude }}',
'{{ swimLengthsData }}',
'{{ basalEnergyBurned }}',
'{{ dailyRespiratoryRate }}',
'{{ irregularRhythmNotification }}',
'{{ distance }}',
'{{ exercise }}',
'{{ floors }}',
'{{ respiratoryRateSleepSummary }}',
'{{ foodMeasurementUnit }}',
'{{ activityLevel }}',
'{{ timeInHeartRateZone }}',
'{{ dailySleepTemperatureDerivations }}',
'{{ height }}',
'{{ name }}',
'{{ electrocardiogram }}',
'{{ activeZoneMinutes }}',
'{{ coreBodyTemperature }}',
'{{ sedentaryPeriod }}',
'{{ dailyHeartRateZones }}',
'{{ dataSource }}',
'{{ bodyFat }}',
'{{ usersId }}',
'{{ dataTypesId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a single identifiable data point. If a data point with the specified name is not found, the request will fail.

UPDATE google.health.data_points
SET
data__activeEnergyBurned = '{{ activeEnergyBurned }}',
data__heartRate = '{{ heartRate }}',
data__dailyVo2Max = '{{ dailyVo2Max }}',
data__steps = '{{ steps }}',
data__runVo2Max = '{{ runVo2Max }}',
data__vo2Max = '{{ vo2Max }}',
data__dailyRestingHeartRate = '{{ dailyRestingHeartRate }}',
data__bloodGlucose = '{{ bloodGlucose }}',
data__activeMinutes = '{{ activeMinutes }}',
data__dailyHeartRateVariability = '{{ dailyHeartRateVariability }}',
data__oxygenSaturation = '{{ oxygenSaturation }}',
data__hydrationLog = '{{ hydrationLog }}',
data__nutritionLog = '{{ nutritionLog }}',
data__heartRateVariability = '{{ heartRateVariability }}',
data__weight = '{{ weight }}',
data__sleep = '{{ sleep }}',
data__dailyOxygenSaturation = '{{ dailyOxygenSaturation }}',
data__food = '{{ food }}',
data__altitude = '{{ altitude }}',
data__swimLengthsData = '{{ swimLengthsData }}',
data__basalEnergyBurned = '{{ basalEnergyBurned }}',
data__dailyRespiratoryRate = '{{ dailyRespiratoryRate }}',
data__irregularRhythmNotification = '{{ irregularRhythmNotification }}',
data__distance = '{{ distance }}',
data__exercise = '{{ exercise }}',
data__floors = '{{ floors }}',
data__respiratoryRateSleepSummary = '{{ respiratoryRateSleepSummary }}',
data__foodMeasurementUnit = '{{ foodMeasurementUnit }}',
data__activityLevel = '{{ activityLevel }}',
data__timeInHeartRateZone = '{{ timeInHeartRateZone }}',
data__dailySleepTemperatureDerivations = '{{ dailySleepTemperatureDerivations }}',
data__height = '{{ height }}',
data__name = '{{ name }}',
data__electrocardiogram = '{{ electrocardiogram }}',
data__activeZoneMinutes = '{{ activeZoneMinutes }}',
data__coreBodyTemperature = '{{ coreBodyTemperature }}',
data__sedentaryPeriod = '{{ sedentaryPeriod }}',
data__dailyHeartRateZones = '{{ dailyHeartRateZones }}',
data__dataSource = '{{ dataSource }}',
data__bodyFat = '{{ bodyFat }}'
WHERE
usersId = '{{ usersId }}' --required
AND dataTypesId = '{{ dataTypesId }}' --required
AND dataPointsId = '{{ dataPointsId }}' --required
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Delete a batch of identifyable data points.

DELETE FROM google.health.data_points
WHERE usersId = '{{ usersId }}' --required
AND dataTypesId = '{{ dataTypesId }}' --required
;

Lifecycle Methods

Reconcile data points from multiple data sources into a single data stream.

EXEC google.health.data_points.reconcile
@usersId='{{ usersId }}' --required,
@dataTypesId='{{ dataTypesId }}' --required,
@pageSize='{{ pageSize }}',
@pageToken='{{ pageToken }}',
@filter='{{ filter }}',
@dataSourceFamily='{{ dataSourceFamily }}'
;