HeartRateRecord: Health Connect heart rate data
Read from Google’s documentation on 2026-10-03 · Google’s reference page last updated 2026-06-24
HeartRateRecord is Health Connect's heart rate record — a Series record in Google's Vitals category. Its read permission is android.permission.health.READ_HEART_RATE; its write permission is android.permission.health.WRITE_HEART_RATE. It supports 4 aggregate metrics (BPM_AVG, BPM_MAX, BPM_MIN and MEASUREMENTS_COUNT). Mandatory fields per Google's table: samples, endTime, metadata and startTime.
What Google says HeartRateRecord is
Captures the user's heart rate. Each record represents a series of measurements.
Quoted from Google’s HeartRateRecord Jetpack reference, last updated 2026-06-24, read 2026-10-03.
- Class
androidx.health.connect.client.records.HeartRateRecord- Google's category
- Vitals
- Record type
- Series
- Unit class
- none named in Google's table
- Mandatory fields
samplesendTimemetadatastartTime- Added in (Jetpack)
1.1.0
Permissions
The exact strings Google’s data-types table declares for HeartRateRecord. Google’s page: “Before requesting any permissions, your app must declare them in the manifest.”
| Access | Permission string | Framework reference |
|---|---|---|
| Read | android.permission.health.READ_HEART_RATE | API 34 · U Ext 7 |
| Write | android.permission.health.WRITE_HEART_RATE | API 34 · U Ext 7 |
<uses-permission android:name="android.permission.health.READ_HEART_RATE" />
<uses-permission android:name="android.permission.health.WRITE_HEART_RATE" />import androidx.health.connect.client.permission.HealthPermission
import androidx.health.connect.client.records.HeartRateRecord
val permissions = setOf(
HealthPermission.getReadPermission(HeartRateRecord::class),
HealthPermission.getWritePermission(HeartRateRecord::class),
)The 6 fields of HeartRateRecord
Types and descriptions as Google’s reference prints them. The range column quotes Google’s own range annotation or sentence; a dash means Google states none, which is not the same as no validation.
| Field | Type | Allowed range | Google’s description |
|---|---|---|---|
endTimemandatory | Instant | — | End time of the record. |
endZoneOffset | ZoneOffset? | — | User experienced zone offset at endTime, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent. |
metadatamandatory | Metadata | — | Set of common metadata associated with the written record. |
samplesmandatory | List<HeartRateRecord.Sample> | — | Google gives no description. |
startTimemandatory | Instant | — | Start time of the record. |
startZoneOffset | ZoneOffset? | — | User experienced zone offset at startTime, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent. |
Nested types
HeartRateRecord.Sample— Represents a single measurement of the heart rate.
Aggregate metrics
The AggregateMetric constants Google defines on HeartRateRecord. The value type is the T in Google’s AggregateMetric<T> signature. Every aggregate metric across all records.
| Metric | Value type | Google’s description |
|---|---|---|
| HeartRateRecord.BPM_AVG | Long | Metric identifier to retrieve the average heart rate from AggregationResult. |
| HeartRateRecord.BPM_MAX | Long | Metric identifier to retrieve the maximum heart rate from AggregationResult. |
| HeartRateRecord.BPM_MIN | Long | Metric identifier to retrieve the minimum heart rate from AggregationResult. |
| HeartRateRecord.MEASUREMENTS_COUNT | Long | Metric identifier to retrieve the number of heart rate measurements from AggregationResult. |
Google’s read-data guide: “For cumulative types like StepsRecord, use aggregate() instead of readRecords() to avoid double counting from multiple sources and improve accuracy.” and “The aggregation API also contains logic to handle duplicate records, and lessens the chances of rate limiting.”
Read HeartRateRecord in Kotlin
The shape of Google’s own read example, with HeartRateRecord and its names filled in. Get the client with HealthConnectClient.getOrCreate(context) after checking getSdkStatus.
import androidx.health.connect.client.HealthConnectClient
import androidx.health.connect.client.records.HeartRateRecord
import androidx.health.connect.client.request.ReadRecordsRequest
import androidx.health.connect.client.time.TimeRangeFilter
import java.time.Instant
suspend fun readHeartRate(
client: HealthConnectClient,
startTime: Instant,
endTime: Instant,
): List<HeartRateRecord> {
val response = client.readRecords(
ReadRecordsRequest(
HeartRateRecord::class,
timeRangeFilter = TimeRangeFilter.between(startTime, endTime),
)
)
// One page of up to pageSize records (default 1000); follow
// response.pageToken for the rest.
return response.records
}import androidx.health.connect.client.HealthConnectClient
import androidx.health.connect.client.records.HeartRateRecord
import androidx.health.connect.client.request.AggregateRequest
import androidx.health.connect.client.time.TimeRangeFilter
import java.time.Instant
suspend fun aggregateHeartRate(
client: HealthConnectClient,
startTime: Instant,
endTime: Instant,
): Long? {
val response = client.aggregate(
AggregateRequest(
metrics = setOf(HeartRateRecord.BPM_AVG),
timeRangeFilter = TimeRangeFilter.between(startTime, endTime),
)
)
// get() is declared as returning a nullable value.
return response[HeartRateRecord.BPM_AVG]
}Setting up the client, the permission flow and Play Console declaration: integrating Health Connect step by step.
HealthKit counterpart
HeartRateRecord sits in the verified cross-platform matrix’s Heart rate row, which groups HKQuantityTypeIdentifier.heartRate, .restingHeartRate on Apple with HeartRateRecord, RestingHeartRateRecord on Android. The row groups the metric; it does not pair each Android record with one Apple type.
The Apple types in that row on the HealthKit reference: heartRate, restingHeartRate.
Watch out: Both expose samples plus a separate resting value — don't derive resting yourself.
The metric on other platforms
This guide lists HeartRateRecord beside the types on the other platforms this site covers whose own descriptions name the same metric, each quoted, with how each one is read.
Questions
- What permission does HeartRateRecord need?
- Google's Health Connect data-types table (read 2026-10-03) declares android.permission.health.READ_HEART_RATE for reading HeartRateRecord and android.permission.health.WRITE_HEART_RATE for writing it, and says apps must declare permissions in the manifest before requesting them.
- Which aggregate metrics does HeartRateRecord support?
- Google's Jetpack reference defines 4 on HeartRateRecord: BPM_AVG (AggregateMetric<Long>), BPM_MAX (AggregateMetric<Long>), BPM_MIN (AggregateMetric<Long>) and MEASUREMENTS_COUNT (AggregateMetric<Long>). Pass them in the metrics set of an AggregateRequest and read each back from the AggregationResult.
- Is HeartRateRecord an interval, instantaneous or series record?
- Google's data-types table lists HeartRateRecord as Series, and defines that column as indicating "whether the data is recorded at an instant in time or over an interval". Its mandatory fields are samples, endTime, metadata and startTime.
Other Vitals records
Sources checked
- Google — HeartRateRecord (Jetpack reference) — last updated 2026-06-24 · read 2026-10-03
- Google — Health Connect data types · read 2026-10-03
- Google — HealthPermissions (framework reference) · read 2026-10-03
- Google — Read raw data (Health Connect guide) · read 2026-10-03
Google’s descriptions are quoted for identification; the page layout, the capsule and the cross-platform pairing are AIFitnessAPI’s. Generated from Google’s pages by a script, not typed by hand — the same data is behind every page in the Health Connect reference.