<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKHeartbeatSeriesSample",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKHeartbeatSeriesSample"
  },
  "title" : "HKHeartbeatSeriesSample"
}
-->

# HKHeartbeatSeriesSample

A sample that represents a series of heartbeats.

```
class HKHeartbeatSeriesSample
```

## Overview

Use a [`HKHeartbeatSeriesQuery`](/documentation/HealthKit/HKHeartbeatSeriesQuery) to access the underlying heartbeat data.

The [`HKHeartbeatSeriesSample`](/documentation/HealthKit/HKHeartbeatSeriesSample) class is a subclass of the [`HKSeriesSample`](/documentation/HealthKit/HKSeriesSample) class. These samples are immutable; you set the sample’s properties when you build them, and they can’t change.

### Extend Heartbeat Samples

Like many HealthKit classes, you shouldn’t subclass the [`HKHeartbeatSeriesSample`](/documentation/HealthKit/HKHeartbeatSeriesSample) class. You may extend this class by adding metadata with custom keys to save related data used by your app.

For more information, see [`addMetadata(_:completion:)`](/documentation/HealthKit/HKHeartbeatSeriesBuilder/addMetadata(_:completion:)).

## Topics

### Metadata

[`HKMetadataKeyAlgorithmVersion`](/documentation/HealthKit/HKMetadataKeyAlgorithmVersion)

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



---

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)