compute_recipe
Exact nutrition for a recipe: the sum of its ingredient lines (text or ids). Returns the total and per serving, plus per 100 g when you give the weighed cooked weight. Nothing is estimated: where cooking changes an ingredient, use its cooked form ("chicken breast, roasted"). A value whose coverage is below 1 is a lower bound; missing_from lists the ingredients without it, and a line that matched nothing counts against coverage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | 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). | |
| servings | No | ||
| cooked_weight_g | No | Weighed cooked weight of the whole dish. Without it, per_100g is null. |