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

# HKElectrocardiogramType

A type that identifies samples containing electrocardiogram data.

```
class HKElectrocardiogramType
```

## Overview

The [`HKElectrocardiogramType`](/documentation/HealthKit/HKElectrocardiogramType) class is a concrete subclass of the [`HKObjectType`](/documentation/HealthKit/HKObjectType) class. To create an electrocardiogram type instance, use the object type’s [`electrocardiogramType()`](/documentation/HealthKit/HKObjectType/electrocardiogramType()) convenience method.

Use the electrocardiogram type to:

- Request permission to read electrocardiogram samples
- Query for electrocardiogram samples

Electrocardiogram samples are read-only. You can request permission to read the samples using this identifier, but you can’t request authorization to share them. This means you can’t save new electrocardiogram samples to the HealthKit store. To add test data in iOS Simulator, open the Health app and select Browse > Heart > Electrocardiograms (ECG) > Add Data.

---

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)