Skip to main content

Apple Health

HealthKit is the on-device store for health and fitness data on iPhone. D4L Collect reads selected HealthKit data on the participant's iPhone, after the participant has given permission. This is how D4L Collect gets data from the Apple Watch and from the iPhone itself.

The data never leaves the phone before D4L Collect reads it. There is no cloud connection to Apple.

At a glance​

TopicDetails
Source typeOn-device store (Apple HealthKit), read by the study app on the iPhone
DevicesApple Watch Series 9, Series 10, and Ultra 2, paired with an iPhone. Some data also comes from the iPhone itself.
In Research StudioUnder Background recordings, select Apple HealthKit
What participants doAllow the study app to read each requested data type in Apple Health. Participants can allow some types and deny others. A denied type gives no data.
Data rangeFrom the moment participants give their study consent. Data recorded before that is never collected.
CollectionThe study app reads new data from HealthKit about every 2 hours.
ExportCSV, one file per signal and day. See Exported files.

Available signals​

SignalUnitSampling typeWhen it's measured
StepsstepsInterval incrementAll day, at irregular intervals of about 1 to 10 minutes while moving
DistancemInterval incrementAll day, at irregular intervals while moving
Active calorieskcalInterval incrementAll day, at irregular intervals
Heart ratebpmSampleAll day. About every 4 to 10 minutes at rest and about every 5 seconds during workouts.
Resting heart ratebpmDaily summaryOnce per day
Heart rate variabilityms (SDNN)SampleMostly during sleep, about 1 every 2 hours, plus occasional spot readings
Respiratory ratebreaths/minSampleDuring sleep, about 6 per hour
Blood oxygen (SpO2)fractionSampleMostly during sleep, 1 to 2 per hour
Skin temperature°CSampleDuring sleep, 1 per night
Sleepstage + sInterval one row per sleep stageSleep sessions
Workoutstype + s + effortInterval one row per workoutWorkouts
Stand hourstrue/falseInterval one row per hourAll day
Activity summarykcal, min, hoursDaily summaryOnce per day
Menstrual flowstateSample entered by the participantWhen logged
Contraceptive usetypeDaily summary entered by the participantWhen logged
PregnancytrueDaily summary entered by the participantWhen logged
LactationtrueDaily summary entered by the participantWhen logged

How often Apple records a signal depends on the watch and its settings. Apple doesn't fix a sampling rate. It also depends on how still the participant is. The rates in the table are typical values that we observed in our own tests. D4L Collect exports every value that HealthKit provides. Not every watch delivers every signal. Skin temperature, for example, needs an Apple Watch Series 8 or later.

Signal reference​

The tables show example rows from the CSV files.

Movement and energy​

Steps​

Steps per HealthKit sample. timestamp is the end of the sample. Each value is an increment, not a running total.

File: Apple HealthKit_steps_steps_dataSource.csv

timestampstepsdataSource
2026-10-12T07:35:00.129Z49apple-watch
2026-10-12T07:38:00.408Z52apple-watch

Distance​

Walking and running distance in meters per HealthKit sample. timestamp is the end of the sample. An increment, not a running total.

File: Apple HealthKit_distance_distance_dataSource.csv

timestampdistance_mdataSource
2026-10-12T08:01:00.251Z12.5iphone
2026-10-12T08:02:00.147Z30.1apple-watch

Active calories​

Active calories in kcal per HealthKit sample, without the energy burned at rest. Apple calls this active energy. timestamp is the end of the sample. An increment, not a running total.

File: Apple HealthKit_activeCalories_activeCalories_dataSource.csv

timestampactiveCalories_kcaldataSource
2026-10-12T07:37:00.695Z1.8apple-watch
2026-10-12T07:38:00.318Z3.9apple-watch

Heart and breathing​

Heart rate​

Heart rate in beats per minute, one value per sample. timestamp is the start of the sample.

File: Apple HealthKit_heartRate_heartRate_dataSource.csv

timestampheartRate_bpmdataSource
2026-10-12T08:22:00.442Z71apple-watch
2026-10-12T08:23:00.903Z72apple-watch

Resting heart rate​

Resting heart rate in beats per minute. There is one value per day, so the file of each day has only one row.

File: Apple HealthKit_restingHeartRate_restingHeartRate_dataSource.csv

timestamprestingHeartRate_bpmdataSource
2026-10-12T17:47:42.147Z58apple-watch

Heart rate variability​

Heart rate variability as the standard deviation of the time between heartbeats (SDNN), in milliseconds. This isn't RMSSD, which other devices deliver. See Comparing across devices.

File: Apple HealthKit_hrvSdnn_hrvSdnn_dataSource.csv

timestamphrvSdnn_msdataSource
2026-10-12T05:10:00.047Z44.2apple-watch
2026-10-12T05:20:00.664Z51.7apple-watch

Respiratory rate​

Breaths per minute, as samples during sleep.

File: Apple HealthKit_respiratoryRate_respiratoryRate_dataSource.csv

timestamprespiratoryRate_breaths/mindataSource
2026-10-12T02:15:00.129Z14.6apple-watch

Blood oxygen (SpO2)​

Blood oxygen saturation as a fraction, so 0.96 means 96 %. The column name ends with %, but the values are not multiplied by 100.

File: Apple HealthKit_spo2_spo2_dataSource.csv

timestampspo2_%dataSource
2026-10-12T03:05:00.408Z0.96apple-watch

Skin temperature​

Absolute skin temperature at the wrist in °C, measured during sleep. Apple calls this sleeping wrist temperature. It isn't body temperature, and it's not a difference to a baseline.

The watch needs about 5 nights of wear to calibrate before it records skin temperature. The first nights have no rows.

File: Apple HealthKit_skinTemperature_skinTemperature_dataSource.csv

timestampskinTemperature_˚CdataSource
2026-10-12T01:30:00.251Z33.4apple-watch

Sleep​

Sleep​

Sleep stages of each sleep session. There's one row per stage: timestamp is the start of the stage and duration_s is its length in seconds. Only samples from the Apple Watch are used. The sleepState column is exported as text, with these possible values:

  • awake
  • rem
  • core
  • deep

D4L Collect groups stage samples into one sleep session when there's less than 1 hour between them. A session is assigned to the day on which it ends.

File: Apple HealthKit_sleepAnalysis_sleepState_duration_dataSource.csv

timestampsleepStateduration_sdataSource
2026-10-12T23:48:00.000Zawake240apple-watch
2026-10-12T23:52:00.000Zcore900apple-watch
2026-10-13T00:07:00.000Zdeep2280apple-watch

Activity​

Workouts​

One row per workout. timestamp is the end of the workout. duration is in seconds. effort is the effort score from 1 to 10, or 0 if there's none. D4L Collect uses the participant's own rating if there is one, and Apple's estimate otherwise.

The activityType column is exported as text. The values are the names of Apple's workout activity types, for example running, walking, or cycling. A workout of an unlisted type is other.

File: Apple HealthKit_workout_workout_dataSource.csv

timestampworkout_activityTypeworkout_durationworkout_effortdataSource
2026-10-12T18:40:00.000Zrunning32406apple-watch

Stand hours​

One row per clock hour, stamped at the end of the hour. stoodDuringHour is true if the participant stood up during that hour, otherwise false.

File: Apple HealthKit_standHours_stoodDuringHour_dataSource.csv

timestampstoodDuringHourdataSource
2026-10-12T08:00:00.000Ztrueapple-watch
2026-10-12T09:00:00.000Zfalseapple-watch

Activity summary​

The values of the three Apple activity rings, one row per day, stamped at local midnight. Energy is in whole kcal, time in whole minutes, and stand in hours. moveMode shows what the Move ring tracks. It's activeEnergy for kcal or appleMoveTime for minutes. This file has no dataSource column.

File: Apple HealthKit_activitySummary.csv

timestampactivitySummary_activeEnergyactivitySummary_activeEnergyGoalactivitySummary_exerciseTimeactivitySummary_exerciseTimeGoalactivitySummary_standHoursactivitySummary_standHoursGoalactivitySummary_moveModeactivitySummary_moveTimeactivitySummary_moveTimeGoal
2026-10-11T22:00:00.000Z4125003830912activeEnergy00

In this example, the participant is in the CEST time zone, so local midnight is 22:00 UTC of the day before.

Women's health​

The participant enters these data points in Apple Health. The watch doesn't measure them, so values exist only for the days a participant logged them.

Sensitive data

These data points are sensitive. Make sure the consent text of your study covers them before you enable them.

Menstrual flow​

One row per logged observation. state is exported as text: unspecified, light, medium, heavy, or none. isCycleStart is 1 if the entry marks the start of a cycle, otherwise 0.

File: Apple HealthKit_menstrualCycle_menstrualCycle_dataSource.csv

timestampmenstrualCycle_statemenstrualCycle_isCycleStartdataSource
2026-10-12T08:00:00.000Zlight1iphone

Contraceptive use​

The type of contraceptive, exported as text: unspecified, implant, injection, intrauterineDevice, intravaginalRing, oral, or patch. If the participant logged more than one type, there's one row per type, all with the same timestamp. timestamp is local midnight of the day on which the study app read the entry, not the day on which the participant logged it.

File: Apple HealthKit_contraceptive_contraceptiveType_dataSource.csv

timestampcontraceptiveTypedataSource
2026-10-11T22:00:00.000Zimplantiphone
2026-10-11T22:00:00.000Zpatchiphone

Pregnancy​

pregnancyState is true for each day with an active pregnancy entry. timestamp is local midnight of the day on which the study app read the entry.

File: Apple HealthKit_pregnancy_pregnancyState_dataSource.csv

timestamppregnancyStatedataSource
2026-10-11T22:00:00.000Ztrueiphone

Lactation​

lactationState is true for each day with an active lactation entry. timestamp is local midnight of the day on which the study app read the entry.

File: Apple HealthKit_lactation_lactationState_dataSource.csv

timestamplactationStatedataSource
2026-10-11T22:00:00.000Ztrueiphone

Exported files​

You find Apple Health data in the CSV export of your study data. For details, see Downloading study data.

{Subject ID}/csv/Recordings_Signal_Data/{YYYY-MM-DD}/Apple HealthKit_{signal}_{columns}.csv
  • Each folder holds the data of one day. The folder name is the UTC date of the last value of that day, so it can differ by one day from the participant's local date.
  • Each signal has its own file. The file name starts with Apple HealthKit_, followed by the signal and its value columns.
  • All files start with a timestamp column (UTC, ISO 8601, in milliseconds) and, except for the activity summary, end with a dataSource column.

Know before you analyze​

One row per data source​

Apple Health can hold the same measurement from the Apple Watch and from the iPhone. D4L Collect keeps them apart. The dataSource column tells you where a row came from.

Count from the watch only

If you add up all rows of a day, you can count steps, distance, and energy twice. Filter by dataSource first, for example by keeping only apple-watch.

Values in the dataSource column:

ValueMeaning
apple-watchRecorded by the Apple Watch
iphoneRecorded by the iPhone
unknownApple Health didn't name the source

Sleep is the exception: D4L Collect exports sleep from the Apple Watch only.

Increments, not running totals​

Steps, distance, and active calories are increments. Each row covers one HealthKit sample, and timestamp is the end of that sample. The length of the sample isn't exported, and samples have different lengths. For a daily total, add up the rows of one source for that day.

Daily values are timestamped at local midnight​

The activity summary, contraceptive use, pregnancy, and lactation are stamped at midnight in the time zone of the participant's phone. In the timestamp column (UTC), this is the evening of the day before, for example 22:00 in Germany during summer time.