Product-Nutrition Schema
Schema definition for the Product-Nutrition object in product data
Product-Nutrition Schema
This is a data schema, not an API endpoint. The Product-Nutrition object describes the shape of
data returned inside product records by the Product Opener API.
{
"type": "object",
"title": "product_nutrition",
"description": "Nutrition fields of a product\n\nMost of these properties are read-only.\n\nSee [how to add nutrition data](https://openfoodfacts.github.io/openfoodfacts-server/api/ref-cheatsheet/#add-nutrition-facts-values-units-and-base)\n",
"properties": {
"no_nutrition_data": {
"type": "string",
"description": "When a product does not have nutrition data displayed on the\npackaging, the user can check the field \"Nutrition facts are\nnot specified on the product\".\nBy doing so, the no_nutrition_data field takes the value \"on\".\nThis case is frequent (thousands of products).\n",
"example": "on"
},
"nutrition_data_per": {
"type": "string",
"enum": [
"serving",
"100g"
],
"description": "The nutrition data on the package can be per serving or per 100g.\n\nThis is essential to understand if `<nutrient>_value` and `<nutrient>`\nvalues in `nutriments` applies for a serving or for 100g.\n\n**IMPORTANT:**\nWhen writing products,\nthis setting applies to all existing nutrients values for the product,\nnot only the nutrient values sent in the write request.\nSo it should not be changed unless all nutrients values are provided\nwith values that match the nutrition_data_per field.\n"
},
"nutrition_data_prepared_per": {
"type": "string",
"enum": [
"serving",
"100g"
],
"description": "The nutrition data for prepared product on the package (if any) can be per serving or per 100g.\n\nThis is essential to understand if `<nutrient>_prepared_value` and `<nutrient>_prepared`\nvalues in `nutriments` applies for a serving or for 100g.\n\nSee also important note on `nutrition_data_per`.\n"
},
"nutriments": {
"type": "object",
"description": "All known nutrients for the product.\n\nNote that each nutrients are declined with a variety of suffixes like `_100g`, `_serving`,\nsee patternProperties below.\n\nA specific `_unit` is the unit of the value that was entered by the contributor (a user or the manufacturer).\nIt is not necessarily the unit that is printed on the product, as some apps may force specific units when writing nutrient values.\n\nBeware that some properties are to be interpreted based upon `nutrition_data_per` value.\n\nFor most use cases, you should use the `<nutrient>_100g` or `<nutrient>_serving` fields, as they are always in the same standard unit, for a specific quantity (100g or 1 serving).\n\nFor products that have a nutrition table for prepared product\n(eg. the nutrition facts for a bowl of milk with cocoa powder),\na `_prepared` suffix is added (before other suffixes).\n\nYou can get all possible nutrients from the\n[nutrients taxonomy](https://static.openfoodfacts.org/data/taxonomies/nutrients.json)\n\n**FIXME** add more nutrients with description.\n",
"properties": {
"alcohol": {
"description": "Quantity of alcohol\n\n(per 100g or per serving) in a standard unit (g or ml)\n",
"type": "number"
},
"carbohydrates": {
"description": "This is the available carbohydrates (excluding fiber), also known as net carbohydrates",
"type": "number"
},
"carbohydrates-total": {
"description": "This follows the US / Canada definition of carbohydrates which includes fiber, also known as gross carbohydrates",
"type": "number"
},
"energy": {
"type": "number",
"description": "It is the same as `energy-kj` if we have it, or computed from `energy-kcal` otherwise\n\n(per 100g or per serving) in kj\n"
},
"energy_value": {
"type": "number",
"description": "energy_value will be equal to energy-kj_value if we have it or to energy-kcal_value otherwise\n"
},
"energy_unit": {
"type": "string",
"enum": [
"kcal",
"kJ"
],
"description": "Equal to energy-kj_unit if we have it or to energy-kcal_unit otherwise\n"
},
"energy-kcal": {
"type": "number",
"description": "energy in kcal, if it is specified\n\n(per 100g or per serving) in a standard unit (g or ml)\n"
},
"energy-kj": {
"type": "number",
"description": "energy in kj, if it is specified\n\n(per 100g or per serving) in a standard unit (g or ml)\n"
},
"fat": {
"type": "number"
},
"fruits-vegetables-legumes-estimate-from-ingredients": {
"type": "number",
"description": "An estimate, from the ingredients list of the percentage of fruits, vegetable and legumes.\nThis is an important information for Nutri-Score (2023 version) computation.\n"
},
"fruits-vegetables-nuts-estimate-from-ingredients": {
"type": "number",
"description": "An estimate, from the ingredients list of the percentage of fruits, vegetable and nuts.\nThis is an important information for Nutri-Score (2021 version) computation.\n"
},
"nova-group": {
"type": "integer"
},
"nutrition-score-fr": {
"description": "Experimental nutrition score derived from\nthe UK FSA score and adapted for the French market\n(formula defined by the team of Professor Hercberg).\n"
},
"proteins": {
"type": "number"
},
"salt": {
"type": "number"
},
"saturated-fat": {
"type": "number"
},
"sodium": {
"type": "number"
},
"sugars": {
"type": "number"
},
"carbon-footprint-from-known-ingredients_product": {
"type": "integer"
},
"carbon-footprint-from-known-ingredients_serving": {
"type": "number"
},
"erythritol": {
"type": "number",
"description": "erythritol is a polyol which is not providing any energy.\nAs such, it needs not be taken into account when computing\nthe energy of a product. Eryhtritol is now displayed on\nnutrition facts sheet of some products, mainly in the USA.\nThis value is entered either by contributors, either by\nimports.\n",
"example": 12.5
}
},
"patternProperties": {
"(?<nutrient>[\\w-]+)_unit": {
"description": "The unit of the value entered by the contributor (a user or the manufacturer), for the product as sold (not prepared).\nIn most cases, this unit is the unit displayed on the product for the nutrient, but it is not guaranteed, as some apps may force specific units when writing nutrient values. \n\nThe possible values depends on the nutrient.\n\n* `g` for grams\n* `mg` for milligrams\n* `μg` for micrograms\n* `cl` for centiliters\n* `ml` for mililiters\n* `dv` for recommended daily intakes (aka [Dietary Reference Intake](https://en.wikipedia.org/wiki/Dietary_Reference_Intake))\n* `% vol` for alcohol vol per 100 ml\n\n🤓 code: see the [Units module][units-module],\nand [Food:default_unit_for_nid function][default-unit]\n\n[units-module]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Units.html\n[default-unit]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Food.html#default_unit_for_nid_(_%24nid)\n\n**Note**: For most use cases, you should not use this unit, as it can change depending on how the value was entered.\nInstead use the `<nutrient>_100g` or `<nutrient>_serving` fields, and convert them to the unit you need.\n",
"type": "string",
"enum": [
"公斤",
"公升",
"kg",
"кг",
"l",
"л",
"毫克",
"mg",
"мг",
"mcg",
"µg",
"oz",
"fl oz",
"dl",
"дл",
"cl",
"кл",
"斤",
"g",
"",
" ",
"kJ",
"克",
"公克",
"г",
"мл",
"ml",
"mmol/l",
"毫升",
"% vol",
"ph",
"%",
"% dv",
"% vol (alcohol)",
"iu",
"mol/l",
"mval/l",
"ppm",
"�rh",
"�fh",
"�e",
"�dh",
"gpg"
]
},
"(?<nutrient>[\\w-]+)_100g": {
"description": "The normalized value of the nutrient for 100g (or 100ml for liquids), in a standard unit, for the product as sold (not prepared):\n* g for all nutrients that are measured by weight (e.g. fat, proteins, carbohydrates, sodium, vitamins, minerals etc.)\n* % vol for nutrients that are percentages by volume (e.g. alcohol)\n* kJ for energy and energy-kj\n* kcal for energy-kcal\n* no unit for pH\n\nThis is computed from the `nutrient` property,\nthe serving size (if `nutrient` is per serving), and the `nutrient`_unit field.\n\n**Note**:\nFor most use cases, this is the only value you should use, as it is always in the same unit, and always per 100g or 100ml.\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_serving": {
"description": "The normalized value of the nutrient for one serving, in a standard unit:\n- g for most nutrients\n- % for nutrients that are percentages (e.g. alcohol)\n- kJ for energy and energy-kj\n- kcal for energy-kcal\n\nThis is computed from the `nutrient` property,\nthe serving size (if `nutrient` is per 100g), and the `nutrient`_unit field.\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_value": {
"description": "The value entered by the contributor (a user or the manufacturer).\nIn most cases, the unit of the value is the unit displayed on the product for the nutrient, but it is not guaranteed, as some apps may force specific units when writing nutrient values. \n\n* per 100g or serving, depending on `nutrition_data_per` field.\n* in the unit of the corresponding <nutrient>_unit field.\n\n**Note**: For most use cases, you should not use this value, as it can be in different units, and can be per 100g or per serving.\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_prepared": {
"description": "Same as '(?<nutrient>[\\w-]+)', for the prepared product (not as sold).\n",
"type": "number"
},
"(?<nutrient>[\\w-]+)_prepared_unit": {
"description": "Same as '(?<nutrient>[\\w-]+)_unit', for the prepared product (not as sold).\n",
"type": "string"
},
"(?<nutrient>[\\w-]+)_prepared_100g": {
"description": "Same as '(?<nutrient>[\\w-]+)_100g', for the prepared product (not as sold).\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_prepared_serving": {
"description": "Same as '(?<nutrient>[\\w-]+)_serving', for the prepared product (not as sold).\n",
"type": "number",
"readOnly": true
},
"(?<nutrient>[\\w-]+)_prepared_value": {
"description": "Same as '(?<nutrient>[\\w-]+)_value', for the prepared product (not as sold).\n",
"type": "number",
"readOnly": true
}
}
},
"nutriscore_data": {
"description": "Detail of data the Nutri-Score was computed upon.\n\n**Note**: this might not be stable, don't rely too much on this, or, at least, tell us !\n\n**TODO** document each property\n",
"type": "object",
"properties": {
"saturated_fat_ratio": {
"type": "number"
},
"saturated_fat_ratio_points": {
"type": "integer"
},
"saturated_fat_ratio_value": {
"type": "number"
}
}
},
"nutrition_grade_fr": {
"type": "string",
"description": "Nutrition grade (‘a’ to ‘e’),\nhttps://world.openfoodfacts.org/nutriscore.\n"
},
"nutrition_grades": {
"description": "Nutrition grades as a comma separated list.\n\nSome products with multiple components might have multiple Nutri-Score\n",
"type": "string"
},
"nutrition_grades_tags": {
"type": "array",
"items": {
"type": "string"
}
},
"nutrition_score_beverage": {
"type": "integer"
},
"nutrition_score_warning_fruits_vegetables_nuts_estimate_from_ingredients": {
"type": "integer"
},
"nutrition_score_warning_fruits_vegetables_nuts_estimate_from_ingredients_value": {
"type": "integer"
},
"nutrition_score_warning_no_fiber": {
"type": "integer"
},
"other_nutritional_substances_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"unknown_nutrients_tags": {
"type": "array",
"items": {
"type": "object"
}
},
"vitamins_tags": {
"type": "array",
"items": {
"type": "object"
}
}
}
}