Skip to content
AF
HealthKit reference

dietaryCarbohydrates: HealthKit quantity type

HKQuantityTypeIdentifierDietaryCarbohydrates · read from Apple’s documentation on 2026-10-02

HKQuantityTypeIdentifier.dietaryCarbohydrates (Objective-C HKQuantityTypeIdentifierDietaryCarbohydrates) is a HealthKit quantity type in Apple's "Nutrition" group. Apple's abstract: “A quantity sample type that measures the amount of carbohydrates consumed.” Apple's discussion says its samples use mass units and measure cumulative values, so in HKStatisticsQuery it takes .cumulativeSum. It is available from iOS 8.0 and watchOS 2.0.

What Apple says dietaryCarbohydrates is

A quantity sample type that measures the amount of carbohydrates consumed.

Apple’s abstract, quoted from its dietaryCarbohydrates reference page, read 2026-10-02. Apple’s discussion of the type runs 15 words.

Swift
HKQuantityTypeIdentifier.dietaryCarbohydrates
Objective-C
HKQuantityTypeIdentifierDietaryCarbohydrates
Family
HKQuantityTypeIdentifier
Apple's topic group
Nutrition
Group page
Nutrition

Availability

The versions Apple’s documentation data gives for dietaryCarbohydrates, platform by platform, as read on 2026-10-02.

PlatformIntroducedDeprecated
iOS8.0—
iPadOS8.0—
Mac Catalyst13.0—
macOS13.0—
visionOS1.0—
watchOS2.0—

The rest of that release: HealthKit Types Introduced in iOS 8.

Sum or average, and in which units

Apple states both of these in the prose of the type’s discussion, not as properties, so they are derived from Apple’s sentence and the sentence is shown with each.

Aggregation style

cumulative — in an HKStatisticsQuery, use .cumulativeSum. Apple’s sentence:

These samples use mass units (described in ) and measure cumulative values (described in ).

Unit family

mass — every type in this family is on the HKUnit reference.

Apple states it in the same sentence as the aggregation style, quoted above.

Empty parentheses and a dangling “described in” mark links in Apple’s sentence to other documentation pages: the generator keeps the sentence’s text, not its links, and the quote is left as stored rather than repaired.

Can apps write dietaryCarbohydrates?

Apple’s documentation for dietaryCarbohydrates does not state that its samples are read-only. Apple states read-only status only in prose, and its silence is not a statement either way, so this page makes no claim that apps can save it.

On Android Health Connect

No verified Health Connect counterpart. The cross-platform matrix pairs only metrics checked against both Apple’s and Google’s documentation, and dietaryCarbohydrates is not among them. A similarly named Health Connect record may exist, but a name match is not a verified mapping.

Metadata keys Apple ties to it

The HKMetadataKey constants whose own Apple text names dietaryCarbohydrates, with the sentence that does, from Apple’s metadata-key pages read 2026-10-04.

  • HKMetadataKeyBloodGlucoseMealTimevalue: NSNumber
    If your app requires more precise timing or additional information about the meal’s composition, create samples to record those details (for example, a dietaryCarbohydrates sample with the exact meal time).

Questions

Should I sum or average dietaryCarbohydrates in HealthKit?
Sum it. Apple's documentation for dietaryCarbohydrates describes it as measuring cumulative values, so an HKStatisticsQuery over it takes .cumulativeSum. Apple's sentence, as read on 2026-10-02: "These samples use mass units (described in ) and measure cumulative values (described in )."
Which unit family does Apple give dietaryCarbohydrates?
Mass. Apple's discussion of dietaryCarbohydrates says its samples use mass units: "These samples use mass units (described in ) and measure cumulative values (described in )."
Which HealthKit metadata keys mention dietaryCarbohydrates?
HKMetadataKeyBloodGlucoseMealTime. Apple's text for HKMetadataKeyBloodGlucoseMealTime: "If your app requires more precise timing or additional information about the meal’s composition, create samples to record those details (for example, a dietaryCarbohydrates sample with the exact meal time)."
Which iOS version added dietaryCarbohydrates?
iOS 8.0. Apple's availability data for dietaryCarbohydrates lists iOS 8.0, iPadOS 8.0, Mac Catalyst 13.0, macOS 13.0, visionOS 1.0 and watchOS 2.0.

Sources checked

Apple’s abstract and sentences are quoted for identification; the page layout, the capsule and the cross-platform pairing are AIFitnessAPI’s. Generated from Apple’s documentation by scripts/fetch-healthkit-identifiers.mjs, not typed by hand — the same data as the full identifier table.

← All HealthKit type identifiers · Nutrition