Every HealthKit metadata key
67 keys · 15 topic groups · last fetched from Apple’s documentation on 2026-10-04
HealthKit defines 67 HKMetadataKey constants, which Apple files under 15 topic groups; the largest is Workout Keys (22). Apple’s pages state what value a key takes for 49 of them (17 HKQuantity, 14 NSNumber, 9 NSString, 8 Boolean and 1 NSDate). 13 keys ship with no abstract. The newest need iOS 17.0.
Metadata rides on a sample, so the sample’s type comes first: every HealthKit type identifier lists those. The HKQuantity values several keys take need a unit from HealthKit units, and matching samples on a metadata value is a query predicate, covered in HealthKit queries. The end-to-end setup is in integrating HealthKit.
General Keys (5)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyExternalUUID | A unique identifier for an HKObject that is set by its source.This key takes a string value. This value is independent of the UUID assigned to the object by the HealthKit store. You can assign your own UUID to any HealthKit objects you create. Use these IDs to uniquely identify objects in your application. You typically use the UUID from the corresponding data entry on your server. This lets you create multiple copies of that data across multiple devices. Each copy shares the same external UUID. | NSString | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyTimeZone | The user’s time zone when the HealthKit object was created.This key takes a string value compatible with the NSTimeZone class’s timeZoneWithName: method. For best results when analyzing sleep samples, it’s recommended that you store time zone metadata with your sleep sample data. | NSString | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyWasUserEntered | A key that indicates whether the sample was entered by the user.Set this key’s value to true if the sample was entered by the user; otherwise, set it to false. | Boolean | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyQuantityClampedToLowerBound | No abstract from Apple. | Not stated | iOS 16.0 · iPadOS 16.0 · Mac Catalyst 16.0 · macOS 13.0 · visionOS 1.0 · watchOS 9.0 |
| HKMetadataKeyQuantityClampedToUpperBound | No abstract from Apple. | Not stated | iOS 16.0 · iPadOS 16.0 · Mac Catalyst 16.0 · macOS 13.0 · visionOS 1.0 · watchOS 9.0 |
Estimate Keys (2)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyDateOfEarliestDataUsedForEstimate | The earliest date of data used to calculate the sample’s estimated value.This key takes a Date value, indicating the earliest date from the data used by HealthKit to calculate the sample’s value. | NSDate | iOS 15.0 · iPadOS 15.0 · Mac Catalyst 15.0 · macOS 13.0 · visionOS 1.0 · watchOS 8.0 |
| HKMetadataKeySessionEstimate | No abstract from Apple. | Not stated | iOS 16.0 · iPadOS 16.0 · Mac Catalyst 16.0 · macOS 13.0 · visionOS 1.0 · watchOS 9.0 |
Device Information Keys (8)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyDeviceSerialNumber | The key for the serial number of the device that generated the data.This key takes a string value. | NSString | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyUDIDeviceIdentifier | The device identifier portion of a device’s UDI (unique device identifier).The device identifier can be used to reference the GUDID (Globally Unique Device Identification Database). This key takes a string value. Note: In iOS 9.0 and later, the use of this key is discouraged. Use the HKDevice class instead. | NSString | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyUDIProductionIdentifier | The production identifier portion of a device’s UDI (unique device identifier).Although the production identifier is part of a device’s UDI, it is not saved in the FDA’s GUDID (Globally Unique Device Identifier Database), and its use in HealthKit is now discouraged to protect user privacy. Apps that need this information should store it outside the HealthKit store. | Not stated | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyDigitalSignature | A digital signature that can be used to validate the origin of the HealthKit object.The digital signature is intended to provide data integrity for sample data produced by trusted (tamper resistant) measuring devices. Use the Cryptographic Message Syntax (CMS) to sign data returned by your device (such as timestamps, values, and so forth) using ASN.1 encoding with Distinguished Encoding Rules (DER). The entire signature should be further encoded using base64. Recommended digest is SHA256, and recommended cipher is FIPS PUB 186-4 Digital Signature Standard Elliptic Curve P-256. CMS is specified in IETF RFC 5652. For more information, see Adding Digital Signatures in HealthKit. | Not stated | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyDeviceName | The name of the device that took this reading.This key takes a string value. Note: In iOS 9.0 and later, the use of this key is discouraged. Use the HKDevice class instead. | NSString | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyDeviceManufacturerName | The name of the manufacturer of the device that took this reading.This key takes a string value. Note: In iOS 9.0 and later, the use of this key is discouraged. Use the HKDevice class instead. | NSString | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyDevicePlacementSide | The key for metadata indicating the placement of the device that measured a sample.This key takes an NSNumber that contains a value from HKDevicePlacementSide. For mobility samples, like walkingSpeed or walkingDoubleSupportPercentage, this metadata key records the placement of the device as determined by the system. | NSNumber | iOS 14.0 · iPadOS 14.0 · Mac Catalyst 14.0 · macOS 13.0 · visionOS 1.0 · watchOS 7.0 |
| HKMetadataKeyAppleDeviceCalibrated | The key for metadata indicating whether the system had data from a sufficient amount of calibrated sensors when recording the sample.This key takes a Boolean value. If it’s true, the system has enough high-quality data to make an accurate estimate. If it’s false, the system provides an estimate based on data that may be less accurate. The key is read-only. | Boolean | iOS 14.0 · iPadOS 14.0 · Mac Catalyst 14.0 · macOS 13.0 · visionOS 1.0 · watchOS 7.0 |
Sync Keys (2)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeySyncIdentifier | A unique string that identifies a piece of data so it can be updated and synced.This key takes a string value. If you add this key to an object’s metadata, you must also add the HKMetadataKeySyncVersion key. When you save an HKObject with a sync identifier, the system looks for any existing objects with the same sync identifier. If it finds a match, the system compares the objects’ HKMetadataKeySyncVersion values. If the new object has a greater sync version, the system replaces the old object with the new one. If the old object is associated with a workout or part of a correlation, the system also replaces the old object in the workout or correlation. | NSString | iOS 11.0 · iPadOS 11.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.0 |
| HKMetadataKeySyncVersion | The version number for a piece of data, used when updating or syncing.This key takes an NSNumber as its value. When you save an object to the HealthKit store, the new object replaces any matching objects (existing objects with a matching HKMetadataKeySyncIdentifier value) with a lower sync version. For more information, see HKMetadataKeySyncIdentifier. | NSNumber | iOS 11.0 · iPadOS 11.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.0 |
Lab Keys (3)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyWasTakenInLab | A key that indicates whether the sample was taken in a lab.Set this key’s value to true if the sample was taken by a lab; otherwise, set it to false. | Boolean | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyReferenceRangeLowerLimit | A key that indicates the lower limit of the reference range for a lab result.This key takes an NSNumber value. | NSNumber | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyReferenceRangeUpperLimit | A key that indicates the upper limit of the reference range for a lab result.This key takes an NSNumber value. | NSNumber | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
Weather Keys (4)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyBarometricPressure | The metadata key for the barometric pressure associated with a sample.This key takes an HKQuantity value that measures the barometric pressure in units of pressure, such as atmosphere(), pascal(), or millimeterOfMercury(). | HKQuantity | iOS 14.0 · iPadOS 14.0 · Mac Catalyst 14.0 · macOS 13.0 · visionOS 1.0 · watchOS 7.0 |
| HKMetadataKeyWeatherCondition | A key that represents the weather condition during the sample.This key takes an an NSNumber value that contains an HKWeatherCondition value. Set this key on an HKWorkout object to represent the overall weather condition during the workout. | NSNumber | iOS 10.0 · iPadOS 10.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 3.0 |
| HKMetadataKeyWeatherHumidity | A key that represents the weather humidity during the sample.This key takes an HKQuantity value expressed as a percentage. Set this key on an HKWorkout object to represent the overall humidity during the workout. | HKQuantity | iOS 10.0 · iPadOS 10.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 3.0 |
| HKMetadataKeyWeatherTemperature | A key that represents the weather temperature during the sample.This key takes an HKQuantity value expressed in a unit of temperature. Set this key on an HKWorkout object to represent the overall temperature during the workout. | HKQuantity | iOS 10.0 · iPadOS 10.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 3.0 |
Workout Keys (22)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| Workout Type | |||
| HKMetadataKeyActivityType | No abstract from Apple. | Not stated | iOS 17.0 · iPadOS 17.0 · Mac Catalyst 17.0 · macOS 14.0 · visionOS 1.0 · watchOS 10.0 |
| HKMetadataKeyAppleFitnessPlusSession | No abstract from Apple. | Not stated | iOS 17.0 · iPadOS 17.0 · Mac Catalyst 17.0 · macOS 14.0 · visionOS 1.0 · watchOS 10.0 |
| HKMetadataKeyCoachedWorkout | A key that indicates whether the workout was performed with a coach or personal trainer.Set this key’s value to true if the workout was performed with a coach or personal trainer; otherwise, set it to false. | Boolean | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyGroupFitness | A key that indicates whether the workout was performed as part of a group fitness class.Set this key’s value to true if the workout was part of a group fitness class; otherwise, set it tofalse. | Boolean | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyIndoorWorkout | A key that indicates whether the workout was performed indoors.Set this key’s value to true if the workout was performed indoors; otherwise, set it to false. | Boolean | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyWorkoutBrandName | The brand name of a particular workout.This key takes a string value. | NSString | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| Cycling | |||
| HKMetadataKeyCyclingFunctionalThresholdPowerTestType | No abstract from Apple. | Not stated | iOS 17.0 · iPadOS 17.0 · Mac Catalyst 17.0 · macOS 14.0 · visionOS 1.0 · watchOS 10.0 |
| GymKit Fitness Equipment | |||
| HKMetadataKeyFitnessMachineDuration | The workout duration displayed by a connected GymKit fitness machine.Set this key on a workout sample representing exercise on a GymKit fitness machine. Set its value to an HKQuantity object with a time unit. | HKQuantity | iOS 12.0 · iPadOS 12.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 5.0 |
| HKMetadataKeyCrossTrainerDistance | The workout distance displayed by a connected GymKit cross-trainer machine.Set this key on a workout sample representing exercise on a GymKit cross-trainer machine (such as an elliptical cross-trainer). Set its value to an HKQuantity object with a length unit. | HKQuantity | iOS 12.0 · iPadOS 12.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 5.0 |
| HKMetadataKeyIndoorBikeDistance | The workout distance displayed by a connected GymKit exercise bike.Set this key on a workout sample representing exercise on a GymKit exercise bike. Set its value to an HKQuantity object with a length unit. | HKQuantity | iOS 12.0 · iPadOS 12.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 5.0 |
| Intensity | |||
| HKMetadataKeyAverageMETs | A key that indicates the average Metabolic Equivalent of Task (METs) during a workout.Set this key on a workout. Set its value to an HKQuantity object with a METs unit (for example, kcal/(kg*hr)). For more information on creating complex units, see HKUnit. The value represents the average intensity over the entire workout’s duration. | HKQuantity | iOS 13.0 · iPadOS 13.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 6.0 |
| HKMetadataKeyPhysicalEffortEstimationType | No abstract from Apple. | Not stated | iOS 17.0 · iPadOS 17.0 · Mac Catalyst 17.0 · macOS 14.0 · visionOS 1.0 · watchOS 10.0 |
| Skiing and Snowboarding | |||
| HKMetadataKeyAlpineSlopeGrade | A key that indicates the percent slope of a ski run.Set this key on quantity samples that represent distance, or on workout segments. Set its value to an HKQuantity object with a percent unit, where 100% indicates a 45 degree slope. HealthKit assigns this metadata key to the segments it automatically creates for HKWorkoutActivityType.downhillSkiing and HKWorkoutActivityType.snowboarding workout sessions (Apple Watch Series 3 only). | HKQuantity | iOS 11.2 · iPadOS 11.2 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.2 |
| HKMetadataKeyElevationAscended | A key that indicates the cumulative elevation ascended during a workout.Set this key on a workout, workout segment, or a quantity sample that represents distance. Set its value to an HKQuantity object with a length unit. HealthKit assigns this metadata key to the segments it automatically creates for HKWorkoutActivityType.downhillSkiing and HKWorkoutActivityType.snowboarding workout sessions (Apple Watch Series 3 only). | HKQuantity | iOS 11.2 · iPadOS 11.2 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.2 |
| HKMetadataKeyElevationDescended | A key that indicates the cumulative elevation descended during a workout.Set this key on a workout, workout segment, or a quantity sample that represents distance. Set its value to an HKQuantity object with a length unit. HealthKit assigns this metadata key to the segments it automatically creates for HKWorkoutActivityType.downhillSkiing and HKWorkoutActivityType.snowboarding workout sessions (Apple Watch Series 3 only). | HKQuantity | iOS 11.2 · iPadOS 11.2 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.2 |
| Speed | |||
| HKMetadataKeyAverageSpeed | A key that indicates the average speed during a workout.Set this key on a workout, workout segment, or a quantity sample that represents distance. Set its value to an HKQuantity object with a length/time unit (for example, m/s). For more information on creating complex units, see Performing unit math. HealthKit assigns this metadata key to the segments it automatically creates for HKWorkoutActivityType.downhillSkiing and HKWorkoutActivityType.snowboarding workout sessions (Apple Watch Series 3 only). Note: This value represents the average speed while moving. It may not be the same as the value you get when dividing a distance sample’s distance by its duration. | HKQuantity | iOS 11.2 · iPadOS 11.2 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.2 |
| HKMetadataKeyMaximumSpeed | A key that indicates the maximum speed during a workout.Set this key on a workout, workout segment, or a quantity sample that represents distance. Set its value to an HKQuantity object with a length/time unit (for example, m/s). For more information on creating complex units, see Performing unit math. HealthKit assigns this metadata key to the segments it automatically creates for HKWorkoutActivityType.downhillSkiing and HKWorkoutActivityType.snowboarding workout sessions (Apple Watch Series 3 only). | HKQuantity | iOS 11.2 · iPadOS 11.2 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.2 |
| Swimming | |||
| HKMetadataKeySwimmingLocationType | A key that indicates the location for a swimming workout.Set this key on a workout object that represents swimming. Set its value to an NSNumber object that contains a valid value from the HKWorkoutSwimmingLocationType enumeration. | NSNumber | iOS 10.0 · iPadOS 10.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 3.0 |
| HKMetadataKeySwimmingStrokeStyle | A key that indicates the predominant stroke style for a lap of swimming.Set this key on workout lap events. Set its value to an NSNumber object that contains a valid value from the HKSwimmingStrokeStyle enumeration. | NSNumber | iOS 10.0 · iPadOS 10.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 3.0 |
| HKMetadataKeyLapLength | A key that indicates the length of a lap during a workout.Set this key on a workout, workout segment, or a quantity sample that represents distance. Set its value to an HKQuantity object that uses length units (described in HKUnit). | HKQuantity | iOS 10.0 · iPadOS 10.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 3.0 |
| HKMetadataKeySWOLFScore | No abstract from Apple. | Not stated | iOS 16.0 · iPadOS 16.0 · Mac Catalyst 16.0 · macOS 13.0 · visionOS 1.0 · watchOS 9.0 |
| HKMetadataKeyWaterSalinity | No abstract from Apple. | Not stated | iOS 17.0 · iPadOS 17.0 · Mac Catalyst 17.0 · macOS 14.0 · visionOS 1.0 · watchOS 10.0 |
Cardio Fitness Keys (2)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyVO2MaxValue | The maximum oxygen consumption rate during exercise of increasing intensity.The system sets this key on lowCardioFitnessEvent samples. It contains the value of the VO2 max measurement that triggered the event. The value of this key is an HKQuantity object with a unit of ml/kg/min. For more information on working with complex units, see unitMultiplied(by:), unitDivided(by:), and init(from:). | HKQuantity | iOS 14.3 · iPadOS 14.3 · Mac Catalyst 14.3 · macOS 13.0 · visionOS 1.0 · watchOS 7.2 |
| HKMetadataKeyLowCardioFitnessEventThreshold | The VO2 max threshold used to categorize low-level cardio fitness events.The system sets this key on lowCardioFitnessEvent samples. It contains the threshold value for the user’s VO2 max measurements. The threshold value varies depending on certain parameters and physical characteristics, such as the user’s age. A low-cardio fitness event indicates a period of time when the user’s VO2 max measurements consistently fall below the defined value. The system triggers this event approximately once every four months. The value of this key is an HKQuantity object with a unit of ml/kg/min. For more information on working with complex units, see unitMultiplied(by:), unitDivided(by:), and init(from:). | HKQuantity | iOS 14.3 · iPadOS 14.3 · Mac Catalyst 14.3 · macOS 13.0 · visionOS 1.0 · watchOS 7.2 |
Motion Keys (1)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyUserMotionContext | The person’s motion during the sample’s time period. | Not stated | iOS 16.0 · iPadOS 16.0 · Mac Catalyst 16.0 · macOS 13.0 · visionOS 1.0 · watchOS 9.0 |
Nutrition Keys (1)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyFoodType | The type of food that the HealthKit object represents.This key takes a string value. Food objects are usually food samples containing any number of Nutrition Identifiers samples. | NSString | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
Vitals Sensors Keys (8)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyBodyTemperatureSensorLocation | The location where a specific body temperature reading was taken.This key takes an NSNumber object whose value is HKBodyTemperatureSensorLocation. | NSNumber | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyHeartRateSensorLocation | The location where a specific heart rate reading was taken.This key takes an NSNumber containing an HKHeartRateSensorLocation as its value. | NSNumber | iOS 8.0 · iPadOS 8.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeyHeartRateMotionContext | The user’s activity level when the heart rate sample was measured.This key takes an NSNumber containing an HKHeartRateMotionContext as its value. | NSNumber | iOS 11.0 · iPadOS 11.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.0 |
| HKMetadataKeyHeartRateRecoveryActivityDuration | No abstract from Apple. | Not stated | iOS 16.0 · iPadOS 16.0 · Mac Catalyst 16.0 · macOS 13.0 · visionOS 1.0 · watchOS 9.0 |
| HKMetadataKeyHeartRateRecoveryActivityType | No abstract from Apple. | Not stated | iOS 16.0 · iPadOS 16.0 · Mac Catalyst 16.0 · macOS 13.0 · visionOS 1.0 · watchOS 9.0 |
| HKMetadataKeyHeartRateRecoveryMaxObservedRecoveryHeartRate | No abstract from Apple. | Not stated | iOS 16.0 · iPadOS 16.0 · Mac Catalyst 16.0 · macOS 13.0 · visionOS 1.0 · watchOS 9.0 |
| HKMetadataKeyHeartRateRecoveryTestType | The type of test that the source used to calculate a person’s heart-rate recovery.Use this metadata key to identify the type of test that the HKSource used to calculate the value for a heartRateRecoveryOneMinute sample. | Not stated | iOS 16.0 · iPadOS 16.0 · Mac Catalyst 16.0 · macOS 13.0 · visionOS 1.0 · watchOS 9.0 |
| HKMetadataKeyVO2MaxTestType | The method used to calculate the user’s VO2 max rate.This key takes an NSNumber object containing a HKVO2MaxTestType value. | NSNumber | iOS 11.0 · iPadOS 11.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.0 |
Audio Event Keys (3)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyAudioExposureLevel | The audio level associated with an audio event.Use this key on audio exposure events. It takes an HKQuantity containing the audio level measured in decibelAWeightedSoundPressureLevel() units. | HKQuantity | iOS 13.0 · iPadOS 13.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 6.0 |
| HKMetadataKeyAudioExposureDuration | The audio exposure event’s duration.Use this key on headphone audio exposure events. It takes an HKQuantity containing the audio level measured in units of time. | HKQuantity | iOS 14.2 · iPadOS 14.2 · Mac Catalyst 14.2 · macOS 13.0 · visionOS 1.0 · watchOS 7.1 |
| HKMetadataKeyHeadphoneGain | No abstract from Apple. | Not stated | iOS 16.4 · iPadOS 16.4 · Mac Catalyst 16.4 · macOS 13.3 · visionOS 1.0 · watchOS 9.4 |
Blood Glucose Keys (2)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyBloodGlucoseMealTime | A key that indicates the relative timing of a blood glucose reading to a meal.Set this key on a bloodGlucose sample. Set it’s value to an NSNumber object containing a HKBloodGlucoseMealTime value.Medical professionals can use the relative meal time to help determine the acceptable range for a blood glucose reading. If your app requires more precise timing or additional information about the meal’s composition, create samples to record those details (for example, a dietaryCarbohydrates sample with the exact meal time). | NSNumber | iOS 11.0 · iPadOS 11.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.0 |
| HKMetadataKeyInsulinDeliveryReason | The medical reason for administering insulin.This key is required for insulinDelivery samples. It takes an NSNumber object containing a HKInsulinDeliveryReason value. | NSNumber | iOS 11.0 · iPadOS 11.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 4.0 |
Reproductive Health Keys (2)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyMenstrualCycleStart | A key that indicates whether the sample represents the start of a menstrual cycle. This metadata key is required for menstrualFlow category samples.Set this key’s value to true if the sample represents the start of a menstrual cycle; otherwise, set it to false. | Boolean | iOS 9.0 · iPadOS 9.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
| HKMetadataKeySexualActivityProtectionUsed | A key that indicates whether protection was used during sexual activity. This metadata key can be used with sexualActivity category samples.Set this key’s value to true if protection was used during sexual activity; otherwise, set it to false. | Boolean | iOS 9.0 · iPadOS 9.0 · Mac Catalyst 13.0 · macOS 13.0 · visionOS 1.0 · watchOS 2.0 |
Algorithm Keys (2)
| Key | Apple’s description | Value | Introduced |
|---|---|---|---|
| HKMetadataKeyAlgorithmVersion | A key that indicates the version number of the algorithm used to calculate the sample’s value.This key takes an NSNumber containing an NSInteger. Note: In watchOS 8, the system uses this key for heartRateVariabilitySDNN and HKHeartbeatSeriesSample samples generated by Apple Watch. | NSNumber | iOS 15.0 · iPadOS 15.0 · Mac Catalyst 15.0 · macOS 13.0 · visionOS 1.0 · watchOS 8.0 |
| HKMetadataKeyAppleECGAlgorithmVersion | A key for metadata indicating the version number of the algorithm Apple Watch uses to generate an ECG reading.Apple Watch sets this key on the HKElectrocardiogram samples it creates. The key is read-only. | Not stated | iOS 14.0 · iPadOS 14.0 · Mac Catalyst 14.0 · macOS 13.0 · visionOS 1.0 · watchOS 7.0 |
Where the value type comes from
The key itself is always a string constant. What you store under it is stated only in Apple’s prose, so the Value column is filled only where a sentence on the key’s page names it — 49 of 67 keys. A key whose page tells you to set the value to true or false is shown as Boolean. The sentence each type comes from is in that row’s description, and the generated data file stores it beside the type.
Keys Apple ships without an abstract (13)
These constants have a declaration and OS availability on Apple’s pages but no one-line description and no discussion. What they mean has to come from the name, the group Apple files them under, or Apple’s other documentation — not from the reference entry.
- HKMetadataKeyQuantityClampedToLowerBound — General Keys, iOS 16.0
- HKMetadataKeyQuantityClampedToUpperBound — General Keys, iOS 16.0
- HKMetadataKeySessionEstimate — Estimate Keys, iOS 16.0
- HKMetadataKeyActivityType — Workout Keys › Workout Type, iOS 17.0
- HKMetadataKeyAppleFitnessPlusSession — Workout Keys › Workout Type, iOS 17.0
- HKMetadataKeyCyclingFunctionalThresholdPowerTestType — Workout Keys › Cycling, iOS 17.0
- HKMetadataKeyPhysicalEffortEstimationType — Workout Keys › Intensity, iOS 17.0
- HKMetadataKeySWOLFScore — Workout Keys › Swimming, iOS 16.0
- HKMetadataKeyWaterSalinity — Workout Keys › Swimming, iOS 17.0
- HKMetadataKeyHeartRateRecoveryActivityDuration — Vitals Sensors Keys, iOS 16.0
- HKMetadataKeyHeartRateRecoveryActivityType — Vitals Sensors Keys, iOS 16.0
- HKMetadataKeyHeartRateRecoveryMaxObservedRecoveryHeartRate — Vitals Sensors Keys, iOS 16.0
- HKMetadataKeyHeadphoneGain — Audio Event Keys, iOS 16.4
Questions
How many metadata keys does HealthKit define?
67 HKMetadataKey constants, as read from Apple's Metadata Keys collection on 2026-10-04. Apple files them under 15 topic groups; the largest is Workout Keys with 22. The same pages also list 5 symbols that are not metadata keys (HKDevicePlacementSide, HKPredicateKeyPathAverageHeartRate, HKAppleECGAlgorithmVersion, HKPredicateKeyPathECGClassification and HKPredicateKeyPathECGSymptomsStatus), which this count leaves out.
What kind of value does each HealthKit metadata key expect?
Apple's own wording states the value for 49 of the 67 keys: 17 HKQuantity, 14 NSNumber, 9 NSString, 8 Boolean and 1 NSDate. For example, Apple's page for HKMetadataKeyDevicePlacementSide says: “This key takes an NSNumber that contains a value from HKDevicePlacementSide.” For the other 18, Apple's page does not say, and this reference leaves the type blank rather than guessing.
Which HealthKit metadata keys have no description from Apple?
13 keys had no abstract on Apple's pages in the 2026-10-04 read, and no discussion either: HKMetadataKeyQuantityClampedToLowerBound, HKMetadataKeyQuantityClampedToUpperBound, HKMetadataKeySessionEstimate, HKMetadataKeyActivityType, HKMetadataKeyAppleFitnessPlusSession, HKMetadataKeyCyclingFunctionalThresholdPowerTestType, HKMetadataKeyPhysicalEffortEstimationType, HKMetadataKeySWOLFScore, HKMetadataKeyWaterSalinity, HKMetadataKeyHeartRateRecoveryActivityDuration, HKMetadataKeyHeartRateRecoveryActivityType, HKMetadataKeyHeartRateRecoveryMaxObservedRecoveryHeartRate and HKMetadataKeyHeadphoneGain. Apple's declaration and OS availability are still published for each, so they are real constants; only the prose is missing.
Do HealthKit metadata keys use the same name in Swift and Objective-C?
Yes. For all 67 keys Apple's Swift and Objective-C pages give the same constant name, so HKMetadataKeyExternalUUID is spelled the same in both. Every key is declared as a String constant in Swift (“let … : String”) and an NSString constant in Objective-C (“extern NSString * const …”).
Which HealthKit metadata keys need the newest iOS version?
HKMetadataKeyActivityType, HKMetadataKeyAppleFitnessPlusSession, HKMetadataKeyCyclingFunctionalThresholdPowerTestType, HKMetadataKeyPhysicalEffortEstimationType and HKMetadataKeyWaterSalinity were introduced in iOS 17.0, the newest version any key requires in the 2026-10-04 read. 19 keys date back to iOS 8.0, the earliest version any key lists. None carries a deprecation version.
Read on 2026-10-04 from Apple’s Metadata Keys collection, its Workout Metadata Keys sub-collection and each key’s own page by scripts/fetch-healthkit-metadata-keys.mjs. Apple also files HKDevicePlacementSide, HKPredicateKeyPathAverageHeartRate, HKAppleECGAlgorithmVersion, HKPredicateKeyPathECGClassification and HKPredicateKeyPathECGSymptomsStatus on those pages; they are not metadata keys and are not rows here. Compiled by AIFitnessAPI; Apple’s documentation remains the authority.