Recipe API

Nutrition APIs Need Reference Dataset Provenance

Open Food Facts' new IFCT integration is a useful reminder that recipe and meal-planning APIs should expose nutrition source, geography, version, conversion, and confidence instead of returning anonymous nutrient numbers.

nutritionapi-designdata-modelingfood-ai

The trend: nutrition data is becoming more plural, regional, and AI-assisted

Recipe products increasingly treat nutrition as a feature that can be computed on demand: paste ingredients, normalize foods, estimate nutrients, scale by serving, and return calories or macros. That works only if the API is honest about where the numbers came from.

A current example is the Open Food Facts server release published on June 25, 2026. Its v2.96.0 notes include a new feature: "IFCT (Indian Food composition tables) nutritional data" alongside fixes for taxonomy paths, pagination, and untaxonomized tags. The related pull request was updated on June 23 and explains that Indian Food Composition Tables data was converted into a Ciqual-like CSV format, with an explicit disclosure that Claude was used to create the file from the IFCT PDF and a Ciqual CSV example.

For recipe API builders, the important point is not that one more food composition table exists. It is that modern food-data systems are mixing sources with different geography, lab methods, vocabularies, update cadences, and conversion pipelines. A recipe nutrition endpoint that returns calories: 524 without provenance is now underspecified.

This matters for recipe apps, meal planners, grocery tools, health coaching products, and food AI workflows. A generated recipe can look precise while being built from a chain of assumptions: ingredient parsing, canonical food matching, raw-to-cooked yield, branded versus generic data, regional nutrient tables, and serving-size scaling. The API contract should make that chain visible enough for a product team to decide what to show, cache, compare, and warn about.

What changed this week

Open Food Facts v2.96.0 is a useful signal because it touched three surfaces recipe APIs also depend on:

Change surface Recent Open Food Facts signal Why recipe API teams should care
Reference nutrition data IFCT data added in v2.96.0 Nutrition estimates may need country-specific source selection, not one global default.
Taxonomies Fixes for taxonomy path and untaxonomized tags Ingredient and category normalization must tolerate missing or newly mapped vocabulary.
Pagination and retrieval Pagination fixes in the same release series Bulk syncs and search-backed nutrition matching need stable paging semantics.
AI-assisted data conversion IFCT PR disclosed Claude-assisted conversion from PDF to CSV Import pipelines should capture transformation method and review status, not only source name.

The IFCT change is especially relevant for Recipe API's niche because recipes are often regional before they are nutritional. "Dal," "paneer," "ragi," "poha," "ghee," and region-specific packaged products do not map cleanly to a U.S.-centric or France-centric food table. Even when nutrient names overlap, moisture, edible portion, preparation state, and fortification assumptions can differ.

A nutrition API can still return a simple result for end users. But internally, and for technical buyers, it should expose enough metadata to distinguish a measured branded product from a generic reference food from an AI-assisted imported table row.

The API design problem: nutrient values are not self-explanatory

A common recipe nutrition response looks like this:

{
  "calories": 524,
  "protein_g": 22.4,
  "carbohydrates_g": 71.2,
  "fat_g": 16.8
}

That shape is easy to consume, but it hides the questions that determine whether the value is usable:

  • Which food composition source was used for each ingredient?
  • Was the source generic, branded, laboratory-derived, crowd-sourced, or derived from a PDF/table conversion?
  • Which country or market does the source represent?
  • Was the matched ingredient raw, cooked, dried, drained, fortified, or prepared?
  • Were household units converted through density, edible portion, or a default multiplier?
  • Was the recipe scaled by declared servings, inferred servings, or gram yield?
  • Are micronutrients complete, missing, imputed, or zero?
  • Has the data changed since the user saved the recipe?

If the API cannot answer these questions, downstream products will invent their own interpretations. That causes inconsistent labels, hard-to-debug user complaints, and brittle comparisons between recipes.

A better response shape

Recipe APIs do not need to overwhelm every client with source metadata by default. They do need a way to request it. A practical pattern is to keep the top-level nutrient summary, then add per-nutrient and per-ingredient provenance when include=nutrition_provenance is requested.

{
  "recipe_id": "rec_8x2",
  "servings": 4,
  "nutrition": {
    "basis": "per_serving",
    "calories_kcal": 524,
    "protein_g": 22.4,
    "carbohydrates_g": 71.2,
    "fat_g": 16.8,
    "confidence": 0.82,
    "computed_at": "2026-06-25T20:00:00Z"
  },
  "nutrition_provenance": {
    "recipe_yield_basis": {
      "source": "declared_servings",
      "servings": 4,
      "total_weight_g": null
    },
    "reference_sources": [
      {
        "source_id": "ifct",
        "name": "Indian Food Composition Tables",
        "region": "IN",
        "version": "imported-2026-06",
        "license": "source-specific",
        "transformation": "pdf_to_csv_reviewed",
        "last_imported_at": "2026-06-25"
      }
    ],
    "ingredient_matches": [
      {
        "input": "1 cup cooked chickpeas",
        "canonical_ingredient_id": "ingredient:chickpea",
        "matched_food_id": "ifct:chickpea_cooked",
        "match_type": "reference_food",
        "preparation_state": "cooked",
        "quantity_g": 164,
        "confidence": 0.88,
        "warnings": []
      }
    ]
  }
}

The exact field names are less important than the principle: make nutrition numbers auditable. A product manager should be able to decide whether an estimate is good enough for a meal-planning screen, a grocery recommendation, or a medical-adjacent use case. A developer should be able to cache it, invalidate it, and explain it.

Design implications for recipe and meal-planning products

1. Source selection should be explicit

Many systems choose a reference food by lexical similarity. That is not enough when regional tables are available. If a user's locale is India, a recipe contains Indian ingredients, or the recipe's cuisine is Indian, a nutrition service may prefer IFCT over another generic source. But that preference should be visible.

Good APIs separate source_selection_policy from the resulting nutrient values. For example:

  • prefer_user_market
  • prefer_recipe_cuisine_region
  • prefer_branded_when_barcode_present
  • prefer_generic_reference_for_home_cooked_recipes
  • lock_existing_estimate_until_recomputed

Without that policy, two users can receive different nutrient values with no explanation.

2. Missing nutrients are not zero

Food composition tables differ in coverage. A missing sodium value, vitamin, amino acid, or fatty acid should not be serialized as zero unless the source says it is zero. For recipe APIs, this is a schema issue.

Prefer this:

{
  "sodium_mg": {
    "value": null,
    "status": "not_available",
    "source_id": "ifct"
  }
}

Over this:

{ "sodium_mg": 0 }

The first response lets a client hide a nutrient, show "not available," or fall back to another source. The second quietly creates false precision.

3. Ingredient normalization and nutrition matching are different steps

A normalized ingredient entity is not always a nutrition entity. "Tomato" may normalize to a canonical ingredient, but nutrition depends on raw versus canned, drained versus undrained, sun-dried versus fresh, and local cultivar. APIs should return separate identifiers:

  • canonical_ingredient_id for recipe search and grocery grouping.
  • food_reference_id for nutrient lookup.
  • product_id or barcode for branded packaged foods.
  • preparation_state for raw/cooked/dried/fried distinctions.

This separation makes it easier to improve nutrition without breaking saved grocery lists or search facets.

4. AI-assisted imports need review metadata

The IFCT pull request's LLM disclosure is useful because it names a real operational issue: important food data still arrives as PDFs, spreadsheets, and semi-structured tables. LLMs can help convert that material, but the API should not pretend the conversion is the same as a direct machine-readable feed.

If a system uses AI to transform reference data, capture fields such as:

  • transformation_method: manual, scripted, ocr, llm_assisted, vendor_feed.
  • review_status: unreviewed, sample_reviewed, fully_reviewed, source_verified.
  • source_artifact_url: link to the original document or release.
  • import_notes: known unit, column, or mapping caveats.
  • row_level_confidence: if some rows are less reliable than others.

This is not anti-AI. It is basic data lineage. Food AI products become more trustworthy when they disclose where structured data becomes inferred data.

A checklist for nutrition provenance in recipe APIs

Before shipping or buying a recipe nutrition endpoint, ask:

  • Does the response identify the food composition source used for each ingredient?
  • Does it distinguish generic reference foods, branded products, and user-entered estimates?
  • Does it include region, version, import date, and source license where available?
  • Can clients tell missing nutrients from measured zero values?
  • Are raw, cooked, dried, drained, and prepared states modeled explicitly?
  • Is serving size tied to declared servings, gram yield, or both?
  • Can saved nutrition be invalidated when reference sources change?
  • Does the API expose confidence or warnings for low-quality ingredient matches?
  • Are AI-assisted conversions marked with transformation and review metadata?
  • Can product teams request detailed provenance only when needed, instead of bloating every response?

If the answer to most of these is no, the endpoint may still be fine for casual calorie estimates. It is not yet robust enough for serious meal planning, grocery commerce, health personalization, or developer-facing infrastructure.

Where Recipe API fits

For builders, the lesson is straightforward: structured recipe data should not stop at ingredients and instructions. Nutrition is a computed layer that depends on ingredient parsing, unit conversion, food matching, serving logic, and source provenance. Treating it as a flat number makes demos easy but production behavior fragile.

Recipe API customers evaluating nutrition, meal planning, or food AI features should look for APIs that expose the boring metadata: source, version, confidence, preparation state, and warnings. Those fields are what let a product evolve from "we show calories" to "we can explain, recompute, compare, and improve nutrition estimates over time."

The recent Open Food Facts work is a reminder that the food-data ecosystem is still expanding and regionalizing. Recipe APIs that model provenance now will be better prepared for the next dataset, the next market, and the next AI-assisted import pipeline.

Sources

Start Building

One consistent schema on every response. Get a free key and ship in minutes.