Contents

Nutrition Type Identifiers

Type identifiers used for tracking diet and nutrition.

Overview

Nutritional data can be broadly categorized into two main groups:

  • Macronutrients consumed in large quantities, such as fats, carbohydrates, and proteins.

  • Micronutrients consumed in smaller quantities, such as vitamins and minerals.

HealthKit also provides type identifiers for nutrition-related items that users may want to track, like water or caffeine.

You do not need to track all nutritional information; you can focus on the items of interest to your users. In general, the data from nutrition labels is a good place to start. Many countries and regions require a nutrition label on packaged food. While the contents of these labels vary from one country or region to another, they typically include the nutritional data represented by these properties:

Combine Nutritional Samples

Macronutrient identifiers can be thought of as a hierarchy. The dietaryEnergyConsumed identifier represents the total amount of energy from all fats, carbohydrates, and protein. You can provide a detailed breakdown using the dietaryFatTotal, dietaryCarbohydrates, and dietaryProtein identifiers. Fats can be further separated into dietaryFatMonounsaturated, dietaryFatPolyunsaturated, and dietaryFatSaturated. Carbohydrates can be identified as dietaryFiber and dietarySugar.

Unless your app is very focused (for example, tracking only sugar or saturated fat), always provide the total data (dietaryFatTotal or dietaryCarbohydrates), and then optionally provide the more detailed information using the subcategories. You do not need to provide data for all of the subcategories; however, the sum of the subcategory sample values should be equal or less than the total sample’s value.

Topics

Essentials

Macronutrients

Vitamins

Minerals

Hydration

Caffeination

Ultratrace Minerals