Nutrients
Every nutrition result reports the same 53 nutrients, keyed by stable public keys.
The dictionary below is generated from the published contract (opis.public-nutrients/v1) and is also
served at GET /v1/nutrients.
How values work
Portion totals. A nutrient value on an item is the amount in that item's portion — at its
grams — not per 100 g. If you need per-100 g values (for example to rescale on the device), request
them with ?include=per_100g and they appear beside the totals.
"nutrients": {
"energy_kcal": { "value": 297.7, "unit": "kcal", "derivation": "analysed" },
"vitamin_d": null
}Null means "not measured", never zero. When the source database has no value for a nutrient, the
value is null. Do not render it as 0 — show "not available" or leave it out. Most foods have
complete macronutrients; vitamins and trace minerals are sparser, especially for fallback sources.
Meal totals skip nulls and tell you so. nutrition.totals.nutrients sums only the item values
that exist, and nutrition.totals.completeness tells you, per nutrient, the share of resolved items
that contributed (from 0 to 1). A vitamin D total with completeness 0.5 means half the items had no
vitamin D value — the true total is probably higher. A nutrient that no item has is null in totals.
"totals": {
"nutrients": { "energy_kcal": { "value": 341.2, "unit": "kcal" }, "vitamin_d": { "value": 0.4, "unit": "ug" } },
"completeness": { "energy_kcal": 1.0, "vitamin_d": 0.5 },
"items_unresolved": 0
}Units are UCUM codes: g, mg, ug (micrograms, µg), kcal, kJ. A key's unit never changes
within v1.
Provenance. Each value carries derivation — how the source database obtained it:
derivation | Meaning |
|---|---|
analysed | Measured by laboratory analysis |
calculated | Calculated from a recipe or from other components |
imputed | Estimated from a similar food |
borrowed | Copied from another food or database |
null | The source does not record it |
and each item's match says which database and food the values come from:
match.source | Database |
|---|---|
cofid | UK Composition of Foods Integrated Dataset (McCance and Widdowson's) — the primary source |
usda_fndds, usda_foundation, usda_branded | USDA FoodData Central, used when CoFID has no good match |
open_food_facts | Open Food Facts, for packaged products |
none | Unresolved: the item could not be matched (all nutrients null, flag item_unresolved) |
match.approximate: true marks a generic stand-in for a more specific food (for example a branded
ready meal matched to its generic recipe).
Stability. Keys are append-only within v1: a key is never renamed or removed, and new nutrients may be added. Ignore keys you do not know.
Dictionary
The Sources column lists the databases that can supply each nutrient today. USDA fallbacks cover
a subset of the dictionary; values a source cannot supply are null.
Energy (2)
| Key | Unit | INFOODS tag | Sources |
|---|---|---|---|
energy_kcal | kcal | ENERC | CoFID, Open Food Facts |
energy_kj | kJ | ENERC | CoFID, Open Food Facts |
Macronutrients (8)
| Key | Unit | INFOODS tag | Sources |
|---|---|---|---|
protein | g | PROCNT | CoFID, Open Food Facts |
total_fat | g | FAT | CoFID, Open Food Facts |
total_carbohydrate | g | CHOAVL | CoFID, Open Food Facts |
dietary_fiber | g | NSP | CoFID, Open Food Facts |
fibre_aoac | g | FIBTG | CoFID |
starch | g | STARCH | CoFID |
nitrogen | g | NT | CoFID |
alcohol | g | ALC | CoFID |
Sugars (8)
| Key | Unit | INFOODS tag | Sources |
|---|---|---|---|
total_sugars | g | SUGAR | CoFID, Open Food Facts |
added_sugars | g | — | Not yet available |
glucose | g | GLUS | CoFID |
fructose | g | FRUS | CoFID |
sucrose | g | SUCS | CoFID |
lactose | g | LACS | CoFID |
maltose | g | MALS | CoFID |
galactose | g | GALS | CoFID |
Fat quality (5)
| Key | Unit | INFOODS tag | Sources |
|---|---|---|---|
saturated_fat | g | FASAT | CoFID, Open Food Facts |
monounsaturated_fat | g | FAMS | CoFID |
polyunsaturated_fat | g | FAPU | CoFID |
trans_fat | g | FATRN | CoFID, Open Food Facts |
cholesterol | mg | CHOLE | CoFID, Open Food Facts |
Vitamins (18)
| Key | Unit | INFOODS tag | Sources |
|---|---|---|---|
vitamin_a | ug (µg) | VITA | CoFID, Open Food Facts |
retinol | ug (µg) | RETOL | CoFID |
retinol_equivalent | ug (µg) | VITA | CoFID |
carotene_total | ug (µg) | CARTBEQ | CoFID |
alpha_carotene | ug (µg) | CARTA | CoFID |
beta_carotene | ug (µg) | CARTB | CoFID |
vitamin_c | mg | VITC | CoFID, Open Food Facts |
vitamin_d | ug (µg) | VITD | CoFID, Open Food Facts |
vitamin_e | mg | VITE | CoFID, Open Food Facts |
vitamin_k | ug (µg) | VITK1 | CoFID, Open Food Facts |
thiamin | mg | THIA | CoFID, Open Food Facts |
riboflavin | mg | RIBF | CoFID, Open Food Facts |
niacin | mg | NIA | CoFID, Open Food Facts |
vitamin_b6 | mg | VITB6A | CoFID, Open Food Facts |
folate | ug (µg) | FOL | CoFID, Open Food Facts |
vitamin_b12 | ug (µg) | VITB12 | CoFID, Open Food Facts |
pantothenate | mg | PANTAC | CoFID |
biotin | ug (µg) | BIOT | CoFID |
Minerals (12)
| Key | Unit | INFOODS tag | Sources |
|---|---|---|---|
sodium | mg | NA | CoFID, Open Food Facts |
potassium | mg | K | CoFID, Open Food Facts |
calcium | mg | CA | CoFID, Open Food Facts |
magnesium | mg | MG | CoFID, Open Food Facts |
phosphorus | mg | P | CoFID, Open Food Facts |
iron | mg | FE | CoFID, Open Food Facts |
copper | mg | CU | CoFID |
zinc | mg | ZN | CoFID, Open Food Facts |
chloride | mg | CL | CoFID |
manganese | mg | MN | CoFID |
selenium | ug (µg) | SE | CoFID |
iodine | ug (µg) | ID | CoFID |