Distance: the Google Health API distance data type
Read from Google’s documentation on 2026-10-17 · discovery document revision 20261014 · Google’s data-types page last updated 2026-10-06
Distance (distance) is an Interval data type in the Google Health API. Google's data-types table lists list, reconcile, rollup and dailyRollup for it under the .activity_and_fitness.readonly and .activity_and_fitness.writeonly scopes, with a storage resolution of 1 minute. The table marks it with webhook support and true-zeros support. Google's Fitbit migration table maps the Fitbit Web API's Distance data to it.
Distance at a glance
From the Distance row of Google’s data-types table, joined to the discovery document’s DataPoint schema.
- Display name
- Distance
- dataType (in endpoint URLs)
distance- filter parameter
distanceGoogle: “The identifier separated by underscores (for example,active_minutes) used as the value for thedataTypefilter parameter in daily rollup and rollup requests.”- Record type
- Interval — Google: “Represents measurements recorded over a duration.”
- Storage resolution
- 1 minute
- Webhook support
- Yes · automatic-subscription token WEBHOOK_DATA_TYPE_DISTANCE
- True zeros support
- Yes
- Channel
- v4
- DataPoint field
DataPoint.distance→DistanceIts description: “Optional. Data for points in thedistanceinterval data type collection.”- Compatible devices
- 28 in Google’s table
Operations and request paths
The operations Google’s table lists for distance, each matched to its users.dataTypes.dataPoints method in the discovery document. The path is the documented path template (the method’s flatPath on https://health.googleapis.com/) with {dataTypesId} filled in as distance. Google on {user}: “The {user} can be either the alias me or the authenticated user's numeric Health User ID (retrieved via GetIdentity).”
| Table lists | Method | Documented path template |
|---|---|---|
list | list | GET https://health.googleapis.com/v4/users/{usersId}/dataTypes/distance/dataPoints |
reconcile | reconcile | GET https://health.googleapis.com/v4/users/{usersId}/dataTypes/distance/dataPoints:reconcile |
rollup | rollUpsame name, different case | POST https://health.googleapis.com/v4/users/{usersId}/dataTypes/distance/dataPoints:rollUp |
dailyRollup | dailyRollUpsame name, different case | POST https://health.googleapis.com/v4/users/{usersId}/dataTypes/distance/dataPoints:dailyRollUp |
Every method, and how many of the data types list it: the methods overview.
Scopes
The scopes Google’s table lists for distance, as full URLs, with the consent text Google’s Scopes page gives each. Every Google Health API scope.
| Scope | Access | Google’s permission text |
|---|---|---|
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly | read | See your Google Health activity and fitness data. |
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.writeonly | write | Add activity and fitness data to Google Health, and edit or delete the data it adds. |
Fields of Distance
The schema the discovery document gives DataPoint.distance, required fields first. Types are as the discovery document states them; the label is the word Google’s description opens with. The schemas its fields refer to follow, one level deep.
Distance — Google: “Distance traveled over an interval of time.”
| Field | Type | Google’s description |
|---|---|---|
intervalRequired | ObservationTimeInterval | Required. Observed interval. |
millimetersRequired | string/int64 | Required. Distance in millimeters over the observed interval. Must be in the range [0, 1000000000]. |
ObservationTimeInterval
Google: “Represents a time interval of an observed data point.”
| Field | Type | Google’s description |
|---|---|---|
endTimeRequired | string/google-datetime | Required. Observed interval end time. |
endUtcOffsetRequired | string/google-duration | Required. The offset of the user's local time at the end of the observation relative to the Coordinated Universal Time (UTC). |
startTimeRequired | string/google-datetime | Required. Observed interval start time. |
startUtcOffsetRequired | string/google-duration | Required. The offset of the user's local time at the start of the observation relative to the Coordinated Universal Time (UTC). |
civilEndTimeOutput only | CivilDateTime | Output only. Observed interval end time in civil time in the timezone the subject is in at the end of the observed interval |
civilStartTimeOutput only | CivilDateTime | Output only. Observed interval start time in civil time in the timezone the subject is in at the start of the observed interval |
Rollup fields
rollUp returns RollupDataPoint.distance
The discovery document: “Returned by default when rolling up data points from the distance data type, or when requested explicitly using the distance rollup type identifier.”
DistanceRollupValue — Google: “Result of the rollup of the user's distance.”
| Field | Type | Google’s description |
|---|---|---|
millimetersSum | string/int64 | Sum of the distance in millimeters. |
dailyRollUp returns DailyRollupDataPoint.distance
The discovery document: “Returned by default when rolling up data points from the distance data type, or when requested explicitly using the distance rollup type identifier.”
The same DistanceRollupValue as the rollUp result above.
Fitbit Web API predecessor
Google’s Fitbit Web API → Google Health API data-type table maps Distance to distance.
Fitbit Web API scopes Google maps to distance’s scopes: activity, cardio_fitness.
Google’s full Fitbit Web API mapping tables · the migration playbook
Where Google’s guides name distance
- “Rollup window size: When calling the
rollUpendpoint, thewindowSizeduration must be at least 1 second ("1s"). Sub-second durations are rejected withINVALID_ARGUMENT. In addition, choose awindowSizeequal to or larger than the data type's underlying storage resolution (such as"60s"for 1-minute interval data types likestepsanddistance) to avoid uneven distribution across sub-intervals. For details, see Rollup window and storage resolution.”Google's data-types page, “Query constraints”
Compatible devices
The 28 devices Google’s table lists as able to record and sync distance.
- Fitbit Air
- Fitbit Alta
- Fitbit Alta HR
- Fitbit Blaze
- Fitbit Charge 2
- Fitbit Charge 3
- Fitbit Charge 4
- Fitbit Charge 5
- Fitbit Charge 6
- Fitbit Flex 2
- Fitbit Inspire
- Fitbit Inspire 2
- Fitbit Inspire 3
- Fitbit Inspire HR
- Fitbit Ionic
- Fitbit Luxe
- Fitbit MobileTrack
- Pixel Watch
- Pixel Watch 2
- Pixel Watch 3
- Pixel Watch 4
- Fitbit Sense
- Fitbit Sense 2
- Fitbit Versa
- Fitbit Versa 2
- Fitbit Versa 3
- Fitbit Versa 4
- Fitbit Versa Lite
Google’s documentation
Related on this site
- Distance Tracking API: Walking, Running and Activity Distance by Platform — the metric on every platform this site covers, each type quoted in its platform's own words
- Google Health API webhooks
- Verification and rate limits
- The Fitbit Web API turn-off
Questions
Which OAuth scopes does the Google Health API distance data type need?
Google's data-types table (read 2026-10-17) lists https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonly and https://www.googleapis.com/auth/googlehealth.activity_and_fitness.writeonly for distance. The Scopes page's consent text: .activity_and_fitness.readonly, "See your Google Health activity and fitness data."; .activity_and_fitness.writeonly, "Add activity and fitness data to Google Health, and edit or delete the data it adds."
Can apps write distance data to the Google Health API?
Not according to Google's data-types table, read 2026-10-17: it lists only list, reconcile, rollup and dailyRollup for distance, and no create, update or batchDelete operation.
How do you aggregate distance data with the Google Health API?
With the rollup methods Google's table lists for it. rollUp (POST https://health.googleapis.com/v4/users/{usersId}/dataTypes/distance/dataPoints:rollUp) returns RollupDataPoint.distance, a DistanceRollupValue with millimetersSum; dailyRollUp (POST https://health.googleapis.com/v4/users/{usersId}/dataTypes/distance/dataPoints:dailyRollUp) returns DailyRollupDataPoint.distance, a DistanceRollupValue with millimetersSum. Each field is described on this page as the discovery document describes it.
What did the Google Health API distance data type replace in the Fitbit Web API?
Google's Fitbit Web API migration table maps the Fitbit Web API's "Distance" to distance. The Fitbit Web API scopes Google maps to its scopes: activity and cardio_fitness.
Other activity and fitness data types
Sources checked
- Google Health API data types — last updated 2026-10-06 · read 2026-10-17
- Google Health API discovery document (v4) — revision 20261014 · read 2026-10-17
- Scopes — last updated 2026-10-09 · read 2026-10-17
- API specifications — last updated 2026-09-22 · read 2026-10-17
Google’s text is quoted for identification; each guide page’s footer reads: “Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License.”. Generated from Google’s pages by scripts/fetch-google-health-api.mjs, not typed by hand; Google’s documentation remains the authority.