Apple HealthKitV2 Workouts Export Format
- Updated
Workouts in HealthKit have a unique data structure for capturing information specific to the participant’s workout.
Table of Contents
Data Structure
Workouts
Field | Description |
---|---|
HealthKitWorkoutKey |
A unique, auto-generated key for this workout. |
ParticipantIdentifier |
The identifier of the participant this task was for. Can be used to cross reference with Participants. |
ParticipantID |
The stable, automatically generated, internal system identifier for this participant. Universally unique identifier (UUID). |
ActivityType |
The type of activity undertaken during the workout. |
StartDate |
The start date of the workout, in ISO 8601 format. Includes timezone offset information. May be empty if no start date was recorded. |
Date |
The end date of the workout, in ISO 8601 format. Includes timezone offset information. |
Duration |
The duration of the workout, in seconds (if recorded). |
TotalDistance |
The distance traveled during the workout, in meters (if recorded). |
TotalEnergyBurned |
The energy burned during the workout, in kcal (if recorded). |
TotalFlightsClimbed |
The flights of stairs climbed during the workout (if recorded). |
TotalSwimmingStrokeCount |
The number of swimming strokes during the workout (if recorded). |
SourceIdentifier |
Uniquely identifies the iOS App which generated the reading. “com.apple.health.* ” indicates a reading from an Apple Device like the iPhone or Apple Watch. |
SourceName |
The name of the source app which generated the reading. In the case of a “com.apple.health.* ” SourceIdentifier , this is the name of the Apple Device used to generate the reading (e.g. “Chris’ iPhone”). |
SourceVersion |
The version of the source app which generated the reading. In the case of a “com.apple.health.* ” SourceIdentifier , this is the version of iOS or WatchOS on the device used to generate the reading. |
SourceOperatingSystemVersion |
An arbitrary string representing the version of the software running on the device, if applicable. |
SourceProductType |
An arbitrary string representing the hardware version of the device, if applicable. |
DeviceName |
The user-facing name for the device, if applicable. |
DeviceModel |
Model of the device used the generate the reading, if applicable. |
DeviceManufacturer |
Manufacturer of the device used the generate the reading, if applicable. |
DeviceHardwareVersion |
An arbitrary string representing the hardware version of the device, if applicable. |
DeviceSoftwareVersion |
An arbitrary string representing the version of the software running on the device, if applicable. |
DeviceFirmwareVersion |
An arbitrary string representing the current version of the firmware running on the device, if applicable. |
DeviceLocalIdentifier |
An identifier that uniquely identifies the device object on the hardware running this code, if applicable. |
DeviceFDAIdentifier |
The device identifier portion of the US Food and Drug Administration’s Unique Device Identifier (UDI), if applicable. |
Metadata |
Additional XML metadata inserted by the source application. |
InsertedDate |
The creation date of the entry, in ISO 8601 format. Is always in UTC. |
Workout Events
An object representing an important event during a workout (e.g. pausing/resuming).
Field | Description |
---|---|
HealthKitWorkoutEventKey |
A unique, auto-generated key for this workout event. |
HealthKitWorkoutKey |
A unique, auto-generated key for this workout. |
ParticipantIdentifier |
The identifier of the participant this task was for. Can be used to cross reference with Participants. |
Type |
Constants that represent events occurring during a workout. |
Date |
The start date of the workout, in ISO 8601 format. Includes timezone offset information. May be empty if no start date was recorded. |
EndDate |
The end date of the workout, in ISO 8601 format. Includes timezone offset information. |
Metadata |
Additional XML metadata inserted by the source application. |
InsertedDate |
The creation date of the entry, in ISO 8601 format. Is always in UTC. |
If a participant re-syncs their device, you may observe duplicate samples. HealthKit samples are immutable, so when doing data analysis, your team will need to remove any samples that have the same HealthKitWorkoutKey / HealthKitWorkoutEventKey and ParticipantIdentifier as another sample.
Sample CSV Exports
Workouts
HealthKitWorkoutKey,ParticipantIdentifier,ActivityType,StartDate,Date,Duration,TotalDistance,TotalEnergyBurned,TotalFlightsClimbed,TotalSwimmingStrokeCount,SourceIdentifier,SourceName,SourceVersion,SourceOperatingSystemVersion,SourceProductType,DeviceName,DeviceModel,DeviceManufacturer,DeviceHardwareVersion,DeviceSoftwareVersion,DeviceFirmwareVersion,DeviceLocalIdentifier,DeviceFDAIdentifier,Metadata,InsertedDate
0e6346ed-6a00-5cab-82ba-a93f18428147,e794c47e-438e-4d7b-9b24-99ce68c75300,Walking,2021-10-25T09:12:05-04:00,2021-10-25T09:53:08-04:00,2462.937413,3170.812541,193.2549765,,,com.apple.health.FA902D86-1FDE-492D-B25A-3EB99A9BC6A6,Sample’s Apple Watch S4,8.0.1,8.0.1,"Watch4,4",Apple Watch,Watch,Apple Inc.,"Watch4,4",8.0.1,,,,"{""HKIndoorWorkout"":""0"",""HKTimeZone"":""America/New_York""}",2021-11-05T14:20:48Z
60ff1df3-6968-598c-81ba-6f77f8ccfabd,e794c47e-438e-4d7b-9b24-99ce68c75300,HighIntensityIntervalTraining,2021-10-25T17:30:14-04:00,2021-10-25T17:37:46-04:00,452.1375571,,42.49847174,,,com.fourthframe.Intervals,Intervals Pro,9470,8.0.1,"Watch4,4",Apple Watch,Watch,Apple Inc.,"Watch4,4",8.0.1,,,,"{""HKIndoorWorkout"":""1""}",2021-11-05T14:20:48Z
c8467515-14e0-54cd-b10b-1f0d1768935a,e794c47e-438e-4d7b-9b24-99ce68c75300,Running,2021-10-26T07:55:07-04:00,2021-10-26T08:24:09-04:00,1741.385687,5415.424597,358.4787643,,,com.apple.health.FA902D86-1FDE-492D-B25A-3EB99A9BC6A6,Sample’s Apple Watch S4,8.0.1,8.0.1,"Watch4,4",Apple Watch,Watch,Apple Inc.,"Watch4,4",8.0.1,,,,"{""HKIndoorWorkout"":""0"",""HKTimeZone"":""America/New_York""}",2021-11-05T14:20:48Z
9958af65-552d-5bca-a88a-d65756afc4af,e794c47e-438e-4d7b-9b24-99ce68c75300,Cycling,2021-11-04T08:56:58-04:00,2021-11-04T09:18:47-04:00,1308.860969,8813.692163,256.1599981,,,com.apple.health.FA902D86-1FDE-492D-B25A-3EB99A9BC6A6,Sample’s Apple Watch S4,8.1,8.1.0,"Watch4,4",Apple Watch,Watch,Apple Inc.,"Watch4,4",8.1,,,,"{""HKIndoorWorkout"":""0"",""HKTimeZone"":""America/New_York""}",2021-11-05T14:20:48Z
Workout Events
HealthKitWorkoutEventKey,HealthKitWorkoutKey,ParticipantIdentifier,Type,Date,EndDate,Metadata,InsertedDate
6ed971ac-e25b-5482-941b-710f973d8fc3,c8467515-14e0-54cd-b10b-1f0d1768935a,e794c47e-438e-4d7b-9b24-99ce68c75300,Pause,2021-10-26T07:55:07-04:00,2021-10-26T08:03:43-04:00,"{""_HKPrivateMetadataIsPartialSplit"":""0"",""_HKPrivateWorkoutSegmentEventSubtype"":""1"",""_HKPrivateMetadataSplitMeasuringSystem"":""2""}",2021-11-05T14:20:48Z
42a11352-abbe-559e-b329-38372c4c59c9,c8467515-14e0-54cd-b10b-1f0d1768935a,e794c47e-438e-4d7b-9b24-99ce68c75300,MotionResumed,2021-10-26T07:55:08-04:00,2021-10-26T07:55:08-04:00,{},2021-11-05T14:20:48Z
c76ff126-238f-5226-9547-49d676ad9e38,c8467515-14e0-54cd-b10b-1f0d1768935a,e794c47e-438e-4d7b-9b24-99ce68c75300,Pause,2021-10-26T08:00:28-04:00,2021-10-26T08:05:43-04:00,"{""_HKPrivateMetadataIsPartialSplit"":""0"",""_HKPrivateWorkoutSegmentEventSubtype"":""1"",""_HKPrivateMetadataSplitMeasuringSystem"":""1""}",2021-11-05T14:20:48Z
Sample JSON Export
Workout & Workout Events
{
"HealthKitWorkoutKey":"0e6346ed-6a00-5cab-82ba-a93f18428147",
"ParticipantIdentifier":"e794c47e-438e-4d7b-9b24-99ce68c75300",
"StartDate":"2021-10-25T09:12:05-04:00",
"Date":"2021-10-25T09:53:08-04:00","Events":
[
{
"Date":"2021-10-25T09:12:05-04:00",
"Type":"Pause",
"Metadata":
{
"_HKPrivateMetadataIsPartialSplit":"0",
"_HKPrivateWorkoutSegmentEventSubtype":"1",
"_HKPrivateMetadataSplitMeasuringSystem":"1"
},
"EndDate":"2021-10-25T09:26:17-04:00"
},
{
"Date":"2021-10-25T09:12:05-04:00",
"Type":"Pause",
"Metadata":
{
"_HKPrivateMetadataIsPartialSplit":"0",
"_HKPrivateWorkoutSegmentEventSubtype":"1",
"_HKPrivateMetadataSplitMeasuringSystem":"2"
},
"EndDate":"2021-10-25T09:33:11-04:00"
}
],
"Summary":
{
"ActivityType":"Walking",
"Duration":2462.9374130964279,
"TotalEnergyBurned":193.25497647284982,
"TotalDistance":3170.8125408515334,
"TotalSwimmingStrokeCount":null,
"TotalFlightsClimbed":null
},
"Source":
{
"Name":"Sample’s Apple Watch S4",
"Identifier":"com.apple.health.FA902D86-1FDE-492D-B25A-3EB99A9BC6A6",
"Version":"8.0.1","OperatingSystemVersion":"8.0.1",
"ProductType":"Watch4,4"
},
"Device":
{
"FDAIdentifier":"",
"FirmwareVersion":"",
"HardwareVersion":"Watch4,4",
"LocalIdentifier":"",
"Manufacturer":"Apple Inc.",
"Model":"Watch",
"Name":"Apple Watch",
"SoftwareVersion":"8.0.1"
},
"Metadata":
{
"HKIndoorWorkout":"0",
"HKTimeZone":"America/New_York"
},
"InsertedDate":"2021-11-05T14:20:48Z"
}
Was this article helpful?