nutrition
Totals for any mix of foods, products, recipes and supplements in any amounts (up to 200 items, at most 50 of them text; a text item costs what resolve charges for one phrase), and each item's own values: every line in items has nutrients for the same fields, in the total's unit, so a meal or food log shows and edits each entry without subtracting. Missing values are never counted as zero: an item with no value for a nutrient leaves it out of its nutrients, and every total has coverage (share of items with a known value) and lists which items lacked it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| fields | No | Only return these nutrient keys (e.g. ["energy","protein"]). Saves tokens. A group name returns every key under it, each as its own value in its own unit, never added or converted: "vitamin_a" gives vitamin_a.rae (µg) and vitamin_a.iu (IU); "carbohydrate" gives carbohydrate.total (includes fibre), carbohydrate.available (excludes it) and carbohydrate.available_mse. A key that is itself a registry key (e.g. "fat") is just that key. A name that matches nothing comes back missing with the closest keys. | |
| locale | No | BCP 47 locale, e.g. en-US, en-GB, ja-JP. Decides household measure sizes (a US cup is 236.6 ml, a metric cup 250 ml). |