HealthKit ↔ Health Connect type reference
aifitnessapi.com| Metric | Apple HealthKit (iOS) | Health Connect (Android) |
|---|---|---|
| Heart rate | HKQuantityTypeIdentifier.heartRate, .restingHeartRate | HeartRateRecord, RestingHeartRateRecordWatch out: Both expose samples plus a separate resting value — don't derive resting yourself. |
| HRV | HKQuantityTypeIdentifier.heartRateVariabilitySDNN | HeartRateVariabilityRmssdRecordWatch out: The big one: the HRV Apple Watch records into HealthKit is SDNN, while Health Connect's record is RMSSD. They are different measures and are not interconvertible — do not normalize one into the other. iOS 27 added HKQuantityTypeIdentifier.heartRateVariabilityRMSSD, but as of October 2, 2026 Apple's documentation gives it no description, so it is not paired with Health Connect's record here: what it holds, how it is computed and whether Apple Watch writes it are not stated. |
| VO2 max | HKQuantityTypeIdentifier.vo2Max | Vo2MaxRecordWatch out: An estimate on both platforms, not a lab measurement. Health Connect tags a measurement method. |
| Blood oxygen | HKQuantityTypeIdentifier.oxygenSaturation | OxygenSaturationRecordWatch out: The type existing doesn't mean data exists — SpO2 is device-gated, and Apple Watch availability in the US has been subject to litigation. Verify current status. |
| Sleep | HKCategoryTypeIdentifier.sleepAnalysis (values: inBed, awake, asleepCore, asleepDeep, asleepREM, asleepUnspecified) | SleepSessionRecord (carries stages)Watch out: Stage vocabularies differ and stages are estimated, not measured. Apple deprecated .asleep in iOS 16.0 and points to .asleepCore, .asleepDeep, .asleepREM or .asleepUnspecified instead (.asleepUnspecified is the rename). |
| Steps | HKQuantityTypeIdentifier.stepCount (CMPedometer for live counts) | StepsRecord, StepsCadenceRecordWatch out: De-duplicate: phone and watch both write steps. On Android, from the June 2026 update on-device steps are attributed to a per-device Synthetic Package Name — read it via getCurrentDeviceDataSource(), never hardcode it. |
| Workouts | HKWorkout (HKWorkoutBuilder) | ExerciseSessionRecord, PlannedExerciseSessionRecordWatch out: Activity-type taxonomies differ between platforms — map them explicitly rather than by name. |
| GPS route | HKWorkoutRoute (array of CLLocation), HKWorkoutRouteQuery | ExerciseRoute with ExerciseRoute.LocationWatch out: Health Connect gates routes behind their own permission (READ_EXERCISE_ROUTES) and restricts background reads of other apps' routes. |
| Calories | HKQuantityTypeIdentifier.activeEnergyBurned, .basalEnergyBurned | ActiveCaloriesBurnedRecord, TotalCaloriesBurnedRecordWatch out: Modelled estimates, not measurements. Note the asymmetry: Apple splits active/basal, Android offers active and total — don't add active to total. |
| Body composition | HKQuantityTypeIdentifier.bodyMass, .bodyFatPercentage, .leanBodyMass, .bodyMassIndex | WeightRecord, BodyFatRecord, LeanBodyMassRecord, BoneMassRecord, BodyWaterMassRecord, BasalMetabolicRateRecordWatch out: The store holds it, but something has to write it — usually a smart scale or manual entry. Body fat is a bioimpedance estimate. |
Both stores are on-device — there is no server endpoint to call. Type identifiers change: confirm against Apple’s and Google’s live docs before you build.
Full reference, notes and sources on aifitnessapi.com/matrix ↗ — a free reference from AIFitnessAPI. This widget shows whatever the source page says today, so it changes when we update it.