<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKMetadataKeyAlgorithmVersion",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:@HKMetadataKeyAlgorithmVersion"
  },
  "title" : "HKMetadataKeyAlgorithmVersion"
}
-->

# HKMetadataKeyAlgorithmVersion

A key that indicates the version number of the algorithm used to calculate the sample’s value.

```
let HKMetadataKeyAlgorithmVersion: String
```

## Discussion

This key takes an <doc://com.apple.documentation/documentation/Foundation/NSNumber> containing an <doc://com.apple.documentation/documentation/ObjectiveC/NSInteger>.

> Note:
> In watchOS 8, the system uses this key for ``doc://com.apple.healthkit/documentation/HealthKit/HKQuantityTypeIdentifier/heartRateVariabilitySDNN`` and ``doc://com.apple.healthkit/documentation/HealthKit/HKHeartbeatSeriesSample`` samples generated by Apple Watch.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)