---
title: "ECG API: Electrocardiogram and Irregular Rhythm Data"
canonical: "https://aifitnessapi.com/data/ecg-api"
cluster: "Health Data"
primary_query: "ecg api"
last_reviewed: "2026-10-18"
description: "ECG recordings and irregular rhythm alerts on each platform: Google Health API waveforms and alert windows, HealthKit's read-only types, and Android's gap."
publisher: "AIFitnessAPI — independent, not sponsored"
cite_as: "\"ECG API: Electrocardiogram and Irregular Rhythm Data\", AIFitnessAPI, https://aifitnessapi.com/data/ecg-api"
---

# ECG API: Electrocardiogram and Irregular Rhythm Data

> The Google Health API exposes ECG recordings as its electrocardiogram data type, with lead I voltage samples, a sampling frequency, a millivolt scaling factor and Google's result classification, and irregular rhythm notifications as a separate type carrying the analysis windows behind each alert; both are list-only, read with the .ecg.readonly and .irn.readonly scopes, and described by Google as based on a software-as-a-medical-device (SaMD) feature. Apple HealthKit exposes irregularHeartRhythmEvent and an atrialFibrillationBurden percentage, both read-only, and stores Apple Watch ECG recordings as HKElectrocardiogram samples that sit outside the identifier data this site generates. Android Health Connect, Wear OS Health Services and the Bluetooth profiles here define no ECG or rhythm type, so on Android the documented route is the Google Health API. Display these results as the platform labels them, and do not re-derive a classification of your own.

- Canonical: https://aifitnessapi.com/data/ecg-api
- Last reviewed: 2026-10-18
- Publisher: AIFitnessAPI (https://aifitnessapi.com) — independent, not sponsored
- Cite as: "ECG API: Electrocardiogram and Irregular Rhythm Data", AIFitnessAPI, https://aifitnessapi.com/data/ecg-api

---

This is the most clinical data a consumer health API returns, and every platform that has it treats it that way. Google flags both of its types as software-as-a-medical-device output and offers no write operation for either. Apple marks both of its identifiers read-only. Nobody lets a third-party app put an ECG or an arrhythmia alert into the store, which tells you what your app's role is: reading and displaying a result someone else's regulated feature produced.

## What each platform exposes

| Platform | ECG recording | Rhythm alert or AFib measure | Verified from |
|---|---|---|---|
| Google Health API | [`electrocardiogram`](/google-health-api/electrocardiogram): a Session record, `list` only | [`irregular-rhythm-notification`](/google-health-api/irregular-rhythm-notification): a Session record, `list` only | Google's data-types page and the v4 discovery document, read 2026-10-17 |
| Apple HealthKit | `HKElectrocardiogram` samples; not an identifier case, so this site has no page for them | [`irregularHeartRhythmEvent`](/healthkit-identifiers/irregular-heart-rhythm-event): category, read-only, iOS 12.2; [`atrialFibrillationBurden`](/healthkit-identifiers/atrial-fibrillation-burden): percentage, read-only, iOS 16.0 | Apple's identifier documentation, read 2026-10-02 |
| Android Health Connect | none among the 42 record classes | none | Google's data-types page, read 2026-10-03 |
| Wear OS Health Services | none among the 65 `DataType` constants | none | Google's `DataType` reference, read 2026-10-04 |
| Bluetooth GATT | none among the characteristics this site covers | none | The Bluetooth SIG's files, read 2026-10-17 |

The HealthKit ECG row rests on one sentence. Apple documents the metadata key [`HKMetadataKeyAppleECGAlgorithmVersion`](/healthkit-metadata-keys#key-hkmetadatakeyappleecgalgorithmversion) with "Apple Watch sets this key on the HKElectrocardiogram samples it creates. The key is read-only." Our [HealthKit query predicates page](/healthkit-queries/healthkit-query-predicates) also lists an `electrocardiogram(_:)` sample-predicate factory method. Nothing in this site's generated identifier data describes the sample's fields, so this page does not.

## Google's ECG record

Google describes `electrocardiogram` as "an Electrocardiogram (ECG) measurement session." The fields, all from the v4 discovery document:

- `waveformSamples`: "An array of voltage values representing lead I ECG values," where "The first value in array corresponds to the start of the reading."
- `samplingFrequencyHertz`: the sampling frequency of those samples.
- `millivoltsScalingFactor`: the divisor that turns a sample into a voltage, which Google writes as `millivolts = waveform_sample / millivolts_scaling_factor`.
- `leadNumber`: the number of leads used.
- `beatsPerMinuteAvg`: the average heart rate during the reading.
- `resultClassification`: one of `NORMAL_SINUS_RHYTHM`, `ATRIAL_FIBRILLATION`, `INCONCLUSIVE`, `INCONCLUSIVE_HIGH_HEART_RATE`, `INCONCLUSIVE_LOW_HEART_RATE`, `UNREADABLE`, `NOT_ANALYZED` or unspecified. Google's text for the two heart-rate results gives its cut-offs as `>120bpm` and `<50bpm`.
- `medicalDeviceInfo`: output-only metadata that, for ECG, typically populates the firmware version, feature version and device model. Google describes the schema as "Software as Medical Device (SaMD) metadata. Used to construct the Unique Device Identifier (UDI)."

Two notes on time are easy to miss. The interval's start and end are equal, "representing the reading time." And "Historical ECG data lacks timezone offsets," so the offsets "will be missing or default to zero" and the civil time fields "will default to UTC"; Google recommends the physical time fields instead. A reading taken in the evening in Los Angeles can therefore show the next day if you group by civil date.

Google's table lists eight compatible devices for the type, including Fitbit Charge 5 and 6, Fitbit Sense and Sense 2, and Pixel Watch through Pixel Watch 4. Its Fitbit migration table maps the Fitbit Web API's ECG data to it.

## Irregular rhythm notifications

Google describes `irregular-rhythm-notification` as "an Irregular Rhythm Notification alert, indicating a potential sign of atrial fibrillation (AFib)." Beyond its interval and device metadata it carries `alertWindows`, "The overlapping analysis windows that were used to evaluate rhythm for potential AFib." Each window has its own start and end with UTC offsets, the heartbeats it contained, and a `positive` flag, and Google's note on the window schema is worth quoting whole: "The current version of the algorithm will only produce alerts if all windows are positive. So anything returned from the API will always have the positive bit set to true." The flag's own description adds that `false` "does not guarantee the absence of AFib."

HealthKit's nearest types carry far less. `irregularHeartRhythmEvent` is "A category sample type for irregular heart rhythm events," whose values come from the generic `HKCategoryValue` rather than an enum of its own, so a sample tells you that an event happened and when, as our [HKCategoryValue reference](/healthkit-category-values#id-irregularheartrhythmevent) explains for every type that resolves that way. Apple adds: "The irregular rhythm samples are read-only." `atrialFibrillationBurden` is a different measurement altogether: "an estimate of the percentage of time a person’s heart shows signs of atrial fibrillation (AFib) while wearing Apple Watch," in percentage units, discrete, read-only, from iOS 16.0. It is a summary percentage, not an alert, so it does not map onto Google's notification type.

## Scopes and access

The Google Health API reads these types under their own scopes: `.ecg.readonly`, whose consent text is "See your Google Health ECG data.", and `.irn.readonly`, "See your Google Health Irregular Rhythm Notifications data." Google's Scopes page lists no write scope for either family, the data-types table lists only `list` for both, and it marks neither with webhook support, so you poll. The [scopes reference](/google-health-api/scopes) lists every family, and [access and limits](/google-health-api/access-and-limits) covers Google's OAuth app verification and the cap on unverified apps.

On iOS both identifiers are read-only by Apple's statement, so the authorization you request is read access only.

## Android has no on-device route

Health Connect's data-types table has no ECG or rhythm record, and Wear OS Health Services defines no such data type. Pixel Watch models appear in the Google Health API's compatible-device list for `electrocardiogram`, so on the evidence this site holds, an Android app reaches Pixel Watch ECG data through the Google Health API's cloud endpoints rather than on the device.

## Keep the claims where the data puts them

Google ties both types to a SaMD feature and says changes to them "may require additional review." Apple marks its types read-only. Our recommendation follows from that: show the classification, the alert and the burden percentage as the platform labels them, credit the platform, and do not compute a rhythm classification of your own from the waveform. Our [heart rate API](/data/heart-rate-api) guide makes the same point about ordinary heart rate samples, and the [FDA fitness app regulation](/compliance/fda-fitness-app-regulation) page sets out where interpretation turns an app into a medical device. Nothing here is medical advice.

## Before you ship

Re-read the two Google type pages and the two HealthKit identifier pages before each release, since they regenerate from Google's and Apple's documentation. Use physical time for ECG readings. Treat every returned alert window as positive by Google's own note, and never present a missing alert as a clean result.

## FAQ

### Can an app read raw ECG waveforms from the Google Health API?

Yes. The electrocardiogram data type carries waveformSamples, an array of lead I voltage values starting at the beginning of the reading, with samplingFrequencyHertz and a millivoltsScalingFactor that Google defines as millivolts = waveform_sample / millivolts_scaling_factor. Google's table lists only the list operation for it, under the .ecg.readonly scope, with no webhook support, so you read recordings rather than writing or subscribing to them.

[Permalink](https://aifitnessapi.com/data/ecg-api#faq-1)

### Does Health Connect have an ECG or irregular rhythm record?

No. None of the 42 record classes on Google's Health Connect data-types page, read on 2026-10-03, is an ECG or rhythm record, and none of the 65 Wear OS Health Services data types is either. Google's compatible-device list for the Google Health API electrocardiogram type includes Pixel Watch models, so on the evidence this site holds, that cloud API is the documented route to those recordings.

[Permalink](https://aifitnessapi.com/data/ecg-api#faq-2)

### What does HealthKit's atrial fibrillation burden measure?

Apple describes atrialFibrillationBurden as an estimate of the percentage of time a person's heart shows signs of atrial fibrillation while wearing Apple Watch. Its samples use percentage units and measure discrete values, it is available from iOS 16.0 and watchOS 9.0, and Apple states the samples are read-only. It is a summary percentage, distinct from the irregularHeartRhythmEvent category type that records individual events.

[Permalink](https://aifitnessapi.com/data/ecg-api#faq-3)

### Why are all Google Health API alert windows marked positive?

Because Google says so in the AlertWindow schema: the current version of the algorithm only produces an alert if all windows are positive, so anything the API returns has the positive bit set to true, although windows can be negative internally. Google adds that a false value would mean AFib was not detected in that window, which does not guarantee its absence, and that inconclusive windows are never saved.

[Permalink](https://aifitnessapi.com/data/ecg-api#faq-4)

### Which time zone is a Google Health API ECG reading in?

Possibly none. Google notes that historical ECG data lacks time zone offsets, so the start and end offsets will be missing or zero and the civil time fields default to UTC, and it recommends using the physical time fields instead. The interval's start and end times are equal and mark the moment of the reading, so group readings by physical time, converted with an offset you know.

[Permalink](https://aifitnessapi.com/data/ecg-api#faq-5)
