Distance Tracking API: Walking, Running and Activity Distance by Platform
Last verified October 18, 2026 · 5 min read
Covered here:Health ConnectHealthKit
Distance is the metric where Apple and Google disagree on shape before they disagree on units. On Android, in the cloud and on the watch, a distance is a distance: one type, whatever the activity. On iOS the activity is part of the type, so a run and a ride write to different identifiers, and a daily total is a decision about which identifiers to add.
One type or nine#
HealthKit's nine distance identifiers, each a cumulative quantity in length units, with the iOS version Apple's documentation gives:
| Identifier | Apple's description | iOS |
|---|---|---|
distanceWalkingRunning | the distance the user has moved by walking or running | 8.0 |
distanceCycling | the distance the user has moved by cycling | 8.0 |
distanceSwimming | the distance the user has moved while swimming | 10.0 |
distanceWheelchair | the distance the user has moved using a wheelchair | 10.0 |
distanceDownhillSnowSports | the distance the user has traveled while skiing or snowboarding | 11.2 |
distanceCrossCountrySkiing | the distance the user has moved by cross country skiing | 18.0 |
distancePaddleSports | the distance the user has moved by paddling sports | 18.0 |
distanceRowing | the distance the user has moved by rowing | 18.0 |
distanceSkatingSports | the distance the user has moved by skating | 18.0 |
Read from Apple's documentation on 2026-10-02. Everywhere else it is one type: Health Connect's DistanceRecord "Captures distance travelled by the user since the last reading"; the Google Health API's distance is "Distance traveled over an interval of time"; and Wear OS Health Services' DataType.DISTANCE is "A distance delta between each reading expressed in meters."
Wear OS adds a split of its own, by terrain rather than activity: FLAT_GROUND_DISTANCE, INCLINE_DISTANCE and DECLINE_DISTANCE, each a distance in meters between readings. Google does not state that the three add up to DISTANCE, so do not add them to it, or check one against the other, without testing on a device.
Units and limits per value#
| Platform | Field | Unit and type | Documented range | Total with |
|---|---|---|---|---|
| Google Health API | millimeters | integer millimeters, typed string/int64 in the discovery document | [0, 1000000000] per data point | rollUp, which returns millimetersSum |
| Health Connect | distance | a Length object | 0 to 1,000,000 meters per record | the DISTANCE_TOTAL aggregate |
| Wear OS | the data point value | a Double in meters, an IntervalDataPoint | not stated | DISTANCE_TOTAL during an exercise |
| HealthKit | the quantity | length units you choose | not stated in the identifier data | a cumulative-sum statistics query |
Two consequences. Google's integer millimeters need converting before anything is displayed. And Health Connect's per-record cap is why Google's own reference says, "If break downs are preferred in scenario of a long workout, consider writing multiple distance records."
How each one is read#
- Google Health API: an Interval record with a 1-minute storage resolution, listed for
list,reconcile,rollupanddailyRollup, with webhook support and true-zeros support, which Google's table key defines as recording "explicit zero values to differentiate between an active zero value (such as zero active minutes) versus missing or unrecorded data." Google's table lists 28 compatible devices, and its migration table maps the Fitbit Web API's distance data to this type. - Health Connect: an Interval record whose description gives the arithmetic: "The total distance over an interval can be calculated by adding together all the values during the interval." It also gives the writing rule, "The start time of each record should be equal to or greater than the end time of the previous record," which keeps consecutive records from overlapping. Reads need
android.permission.health.READ_DISTANCE. - Wear OS: a delta per update during an exercise, under the
ACTIVITY_RECOGNITIONpermission in Google's permissions table. A daily form,DISTANCE_DAILY, also exists and is a row on the data-type table without a page here. - HealthKit: cumulative, so
.cumulativeSumin a statistics query, per identifier.
Where the number came from#
Google's description of the Health Services DataType class says it plainly: the data type "defines only the representation and format of the data, and not how it's being collected," and "As an example, DISTANCE may come from GPS location if available, or steps if not available." Treat any distance as an estimate of unknown method unless the source tells you more.
HealthKit lets a writer attach context as metadata. HKMetadataKeyLapLength goes "on a workout, workout segment, or a quantity sample that represents distance," and HKMetadataKeyIndoorBikeDistance holds "The workout distance displayed by a connected GymKit exercise bike." For the route itself rather than the total, see the GPS activity API guide.
Bluetooth sensors report distance inside larger characteristics rather than as a type of its own: the RSC Measurement characteristic's optional Total Distance is in units of a tenth of a meter, and a treadmill's Treadmill Data reports total distance in meters since the session began.
Traps#
- Choosing which Apple distances make a day. A cross-platform "distance today" has to decide whether cycling, swimming, wheelchair and the iOS 18.0 sports count. Write that rule down; Health Connect and Google will not make it for you, because they never split them.
- A test result is not a distance travelled. HealthKit's
sixMinuteWalkTestDistance"stores the distance a user can walk during a six-minute walk test" and is discrete, not cumulative. Leave it out of totals. - More than one writer. Where a phone and a watch both write distance, the double-counting trap the step counting API guide describes for steps applies; read each platform's aggregate rather than summing raw records from every source.
- Unit conversion at the edges. Millimeters from Google, meters from Wear OS and Health Connect's
Length, a unit you picked on iOS: convert once, at ingestion, and store the unit.
Before you ship#
Re-check the identifier pages and the record and type references before each release; they regenerate from Apple's and Google's documentation. Decide your daily-total rule for Apple's nine types. Split long Health Connect writes into several records, keep them non-overlapping, and treat Wear OS's terrain split as its own measure, not a check on the total.
Distance, by platform
Each type links its reference page on this site. The quote is the platform's own description of the type, copied from the generated reference data, and it is the reason the type is listed: nothing here is paired by name. A platform with nothing listed has no type with a page here whose description names this metric.
Google Health API · read 2026-10-17
- distance — Interval record · 1 minute storage resolution · operations: list, reconcile, rollup, dailyRollup · webhook support
“Distance traveled over an interval of time.” — Google
Apple HealthKit · read 2026-10-02
- distanceWalkingRunning — cumulative values · length units · iOS 8.0+
“A quantity sample type that measures the distance the user has moved by walking or running.” — Apple
- distanceCycling — cumulative values · length units · iOS 8.0+
“A quantity sample type that measures the distance the user has moved by cycling.” — Apple
- distanceSwimming — cumulative values · length units · iOS 10.0+
“A quantity sample type that measures the distance the user has moved while swimming.” — Apple
- distanceWheelchair — cumulative values · length units · iOS 10.0+
“A quantity sample type that measures the distance the user has moved using a wheelchair.” — Apple
- distanceDownhillSnowSports — cumulative values · length units · iOS 11.2+
“A quantity sample type that measures the distance the user has traveled while skiing or snowboarding.” — Apple
- distanceCrossCountrySkiing — cumulative values · length units · iOS 18.0+
“A quantity sample type that measures the distance the user has moved by cross country skiing.” — Apple
- distancePaddleSports — cumulative values · length units · iOS 18.0+
“A quantity sample type that measures the distance the user has moved by paddling sports.” — Apple
- distanceRowing — cumulative values · length units · iOS 18.0+
“A quantity sample type that measures the distance the user has moved by rowing.” — Apple
- distanceSkatingSports — cumulative values · length units · iOS 18.0+
“A quantity sample type that measures the distance the user has moved by skating.” — Apple
Android Health Connect · read 2026-10-03
- DistanceRecord — Interval record · Activity category · Length unit · aggregates: DISTANCE_TOTAL
“Captures distance travelled by the user since the last reading.” — Google
Wear OS Health Services · read 2026-10-04
- DataType.DISTANCE — DeltaDataType · IntervalDataPoint<Double> · permission ACTIVITY_RECOGNITION
“A distance delta between each reading expressed in meters.” — Google
- DataType.FLAT_GROUND_DISTANCE — DeltaDataType · IntervalDataPoint<Double> · permission ACTIVITY_RECOGNITION
“The distance traveled over flat since the last update expressed in meters.” — Google
- DataType.INCLINE_DISTANCE — DeltaDataType · IntervalDataPoint<Double> · permission ACTIVITY_RECOGNITION
“The distance traveled over inclining ground since the last update expressed in meters.” — Google
- DataType.DECLINE_DISTANCE — DeltaDataType · IntervalDataPoint<Double> · permission ACTIVITY_RECOGNITION
“Distance traveled over declining ground between each reading expressed in meters.” — Google
Bluetooth GATT · read 2026-10-17
Nothing listed.
Frequently asked questions
- Why does HealthKit have nine distance types?
- Because Apple makes the activity part of the type. HealthKit has distanceWalkingRunning and distanceCycling from iOS 8.0, distanceSwimming and distanceWheelchair from iOS 10.0, distanceDownhillSnowSports from iOS 11.2, and distanceCrossCountrySkiing, distancePaddleSports, distanceRowing and distanceSkatingSports from iOS 18.0. Each is cumulative in length units. Health Connect, the Google Health API and Wear OS each have a single distance type for every activity.
- What unit does the Google Health API use for distance?
- Millimeters, as an integer. Google's distance type has a required millimeters field, typed string/int64 in the discovery document and limited to 0 to 1,000,000,000 per data point, over a 1-minute storage resolution. The rollUp and dailyRollUp methods return millimetersSum. Convert once on ingestion, keep the integer for storage, and divide only for display.
- Is there a maximum distance per Health Connect DistanceRecord?
- Yes. Google documents the distance field's valid range as 0 to 1,000,000 meters, and suggests writing several distance records for a long workout if break-downs are preferred, each starting at or after the previous record's end time so records do not overlap. Read a total with the DISTANCE_TOTAL aggregate rather than by adding raw records yourself.
- Where does Wear OS Health Services get its distance from?
- Google does not fix it. Its description of the DataType class says a data type defines only the representation and format of the data, not how it is collected or which sensor is used, and gives DISTANCE as the example: it may come from GPS location if available, or steps if not. DISTANCE is a delta in meters between readings, and Wear OS also offers flat-ground, incline and decline distances.
Keep reading
Elsewhere on the site
Pages that share this one’s concepts and sources, from other sections.
Next steps
Was this page useful?
Independent comparison, last reviewed October 18, 2026. Pricing, rate limits, and feature availability change often — confirm current details in each provider’s official documentation before you commit. Product and company names are trademarks of their respective owners; AIFitnessAPI is not affiliated with, endorsed by, or sponsored by any product listed here.
← All health data · by AIFitnessAPI