Data presence and true zeros

To ensure data accuracy and consistent aggregations, the Google Health API modernizes how user activity is reported. By introducing true zeros and on-wrist filtering, the API lets you accurately distinguish between periods where a user was stationary versus when they were not wearing their device.

True Zeros

A true zero is an explicit data point that indicates a user was wearing their device and actively tracking, but recorded a value of zero for a specific metric. For example, a user might record 0 steps or 0 distance during a 1-minute interval while wearing their device.

Historically, missing data was ambiguous. It could signify either that the user was sedentary or that the device was off-wrist. The API resolves this by explicitly storing and returning a 0 value when the device is worn but inactive. This ensures you can clearly distinguish between stationary on-wrist periods and missing data.

On-wrist filtering

On-wrist filtering is the process of identifying whether a user is physically wearing their device. This allows the API to filter out extraneous data, such as "phantom" steps recorded due to vehicle vibrations while a device is in a bag.

Supported data types

The following data types support true zero behavior and on-wrist filtering:

  • Altitude
  • Distance
  • Floors
  • Steps
  • Total Calories

Impact on your application

The implementation of true zeros improves the accuracy of data gap interpretation and metric calculations, such as daily averages.

List and rollup behavior

By default, the Google Health API returns on-wrist data only for the following data types:

  • List operations: Returns data points only for periods when the device was worn. Gaps in the list indicate the device was off-wrist or was not syncing.
  • Rollup operations: A zero in the response signifies a true zero (the user was wearing the device but not moving). If a tracking device was not worn during a specific interval, the API returns no data for that rollup window.

Comparison with the Fitbit Web API

The Fitbit Web API often returned data, including zeros, even when a tracking device was not worn. The Google Health API provides a more accurate representation of movement.

Feature Fitbit Web API Google Health API
Inactivity Ambiguity Missing data could mean inactivity or off-wrist. True zeros explicitly indicate inactivity while worn.
Data Gaps Data gaps could default to UTC offsets. Explicit storage resolves timezone and civil time issues.
Filtering Limited on-wrist filtering. Strict on-wrist filtering ensures physiological accuracy.