Cook Nutrition API

Confidence & provenance

aggregate_nutrition(...) returns a confidence_breakdown alongside totals, so a report can be honest about estimate quality.

{% set wk = aggregate_nutrition(plan.all_ingredients) %}
Overall: {{ wk.totals.confidence }} (weighted: {{ wk.totals.confidence_weighted }})
{% if wk.confidence_breakdown.estimated_share_of_micronutrients %}
Estimated entries affect
{{ (wk.confidence_breakdown.estimated_share_of_micronutrients * 100) | round(1) }}%
of total micronutrients.
{% endif %}

Each resolved item also carries a source (e.g. USDA confirmed vs estimated) and confidence, so a template can flag individual rows as well as the total.