Recipe Platforms & AI Meal Coaches

Nutrition API for AI Meal Planning & Automated Coaching

Calculate composite multi-ingredient recipes with cooking moisture retention, automated allergen detection, and dynamic portion scaling.

The Recipe Calculation Challenge

Why Recipe Nutrition Calculation is Hard

Most calorie APIs treat recipes as simple text string searches, ignoring cooking water losses, oil absorption, and composite sub-recipes.

Raw vs. Cooked Yield Shifts

500g of raw chicken yields only 375g of cooked breast after moisture evaporation. Calculating calories on raw mass skews cooked portion macros by up to 25%.

Hidden Dietary Violations

A recipe claiming to be "Keto" often contains hidden honey in marinades or cornstarch in thickening sauces. FoodVivo catches sneaky carb spikes automatically.

Allergen Liability

Missing cross-contaminants or allergen derivatives (like whey protein in seasoning blends) exposes users to dangerous allergic reactions.

Verified Recipe Payload

Line-Item Ingredient Deconstruction & Yield Ratios

Every recipe is broken down into constituent raw mass, cooked yield, macro energy percentages, and automated allergen flags.

Calculates per-serving and whole-dish aggregate macros
Computes Net Carbohydrates for Ketogenic and Diabetic plans
Enforces USDA Table of Cooking Yields factors
Recipe Analysis • JSON200 OK
{
  "success": true,
  "data": {
    "meal_title": "Keto Mediterranean Salmon & Cauliflower Rice Skillet",
    "thought_process": "Decomposed recipe into 500g wild salmon (raw weight, estimated 375g cooked yield), 400g steamed riced cauliflower, 80g crumbled feta cheese, and 30g extra virgin olive oil. Calculated total and per-serving macros for 4 equal portions.",
    "foods": [
      {
        "name": "Wild Atlantic Salmon (Cooked)",
        "quantity": 4,
        "serving_size": 1,
        "serving_unit": "fillet portion (94g cooked)",
        "weight_g": 375,
        "calories": 710,
        "protein_g": 99,
        "carbs_g": 0,
        "fat_g": 31.5,
        "allergens": [
          "fish"
        ],
        "dietary": [
          "keto_friendly",
          "gluten_free",
          "dairy_free"
        ],
        "confidence": 0.99
      },
      {
        "name": "Riced Cauliflower (Steamed)",
        "quantity": 4,
        "serving_size": 1,
        "serving_unit": "cup (100g)",
        "weight_g": 400,
        "calories": 100,
        "protein_g": 7.6,
        "carbs_g": 20,
        "fat_g": 1.2,
        "fiber_g": 8,
        "allergens": [],
        "dietary": [
          "vegan",
          "keto_friendly",
          "gluten_free"
        ],
        "confidence": 0.98
      },
      {
        "name": "Extra Virgin Olive Oil",
        "quantity": 2,
        "serving_size": 1,
        "serving_unit": "tbsp (15ml)",
        "weight_g": 30,
        "calories": 265,
        "protein_g": 0,
        "carbs_g": 0,
        "fat_g": 30,
        "allergens": [],
        "dietary": [
          "vegan",
          "keto_friendly",
          "gluten_free"
        ],
        "confidence": 0.99
      },
      {
        "name": "Feta Cheese (Crumbled)",
        "quantity": 4,
        "serving_size": 1,
        "serving_unit": "serving (20g)",
        "weight_g": 80,
        "calories": 211,
        "protein_g": 11.4,
        "carbs_g": 3.3,
        "fat_g": 17.1,
        "allergens": [
          "dairy"
        ],
        "dietary": [
          "vegetarian",
          "gluten_free"
        ],
        "confidence": 0.97
      }
    ],
    "totals": {
      "calories": 1286,
      "protein_g": 118,
      "carbs_g": 23.3,
      "fat_g": 79.8,
      "fiber_g": 8,
      "sodium_mg": 1120
    },
    "macro_split": {
      "protein_pct": 37,
      "carbs_pct": 7,
      "fat_pct": 56
    },
    "sources": [
      {
        "title": "USDA FoodData Central - Atlantic Salmon (FDC 173686)",
        "domain": "fdc.nal.usda.gov",
        "url": "https://fdc.nal.usda.gov/fdc-app.html#/food-details/173686/nutrients"
      }
    ],
    "assumptions": [
      "Yield loss calculated at 25% moisture evaporation during pan searing.",
      "Recipe yields 4 standard servings (approx 321 kcal, 29.5g P, 3.8g net carbs, 20.0g F per serving)."
    ]
  },
  "meta": {
    "model": "foodvivo-neural-engine",
    "latency_ms": 18,
    "cached": true
  }
}

Recipe Ingestion Example

Parse composite recipes and check allergen thresholds.

curl -X POST https://foodvivo-api.flappybird-assets.workers.dev/v1/food/analyze \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Mediterranean Recipe (4 servings): 500g raw salmon, 400g cauliflower rice, 80g feta cheese, 30g olive oil",
    "context": "Strict Ketogenic Meal Plan (Yield: 4 servings)"
  }'

Recipe & Coaching FAQs

Common questions regarding composite recipes, yield losses, and allergen tagging.

How does FoodVivo account for cooking yield and moisture loss in recipes?

Cooking meats and vegetables causes significant water evaporation (typically 20-30% weight loss for chicken and salmon). FoodVivo applies USDA Table of Cooking Yields factors so that macronutrient density is calculated on cooked yield weight rather than raw starting weight.

How are composite dressings, marinades, and sauces parsed?

When a recipe includes '2 tbsp lemon vinaigrette' or '1/4 cup teriyaki marinade', FoodVivo breaks down the sub-ingredients (e.g. olive oil, lemon juice, Dijon mustard) to accurately compute total fat and added sugars without guessing.

Can the API automatically scale a recipe to fit specific user macro targets?

Yes. By providing a target macro ratio (e.g. 40% Protein, 30% Carbs, 30% Fat at 600 kcal), FoodVivo can suggest proportional ingredient scaling adjustments for portion optimization.

Which allergens are monitored during recipe deconstruction?

FoodVivo cross-references ingredients against FDA major food allergen lists: Gluten/Wheat, Crustacean Shellfish, Eggs, Fish, Peanuts, Soybeans, Milk/Dairy, Tree Nuts, and Sesame.