Consumer Mobile & Fitness Apps

Nutrition API for Fitness & Calorie Tracker Apps

Eliminate tedious manual food logging with instant camera photo deconstruction, sub-18ms Anycast edge caching, and mathematically verified Atwater macros.

< 18ms
Edge KV Repeat Latency
99.4%
USDA Ground Truth Match
4M+
Global Food & GTIN Items
0.4%
Atwater 4-4-9 Math Variance
The Food Logging Problem

Why 70% of Fitness App Users Stop Logging Meals Within 14 Days

Building a successful calorie tracking app requires overcoming three critical friction points in existing logging workflows.

1. Manual Search Fatigue

Searching a database for "chicken breast" returns 400 conflicting entries with unverified user-generated garbage. Typing out 5 ingredients per meal takes 3 minutes.

2. LLM Math Contradictions

Generic vision models hallucinate numbers. A prompt might return 500 kcal with 20g protein, 20g carbs, 10g fat (which mathematically equals only 250 kcal). Athletes spot this instantly and leave 1-star reviews.

3. Slow Logging Latency

Raw multimodal inference takes 3 to 6 seconds per call. If logging lunch feels like waiting for a web search, users postpone it and abandon the habit.

End-to-End Pipeline

How FoodVivo Solves Fitness Logging

A deterministic multi-stage verification pipeline built specifically for fitness and macro tracking applications.

01
Visual Decomposition

Plate photos are segmented into individual culinary elements with volumetric portion estimation in grams.

02
USDA FDC Grounding

Every ingredient is matched against USDA laboratory reference profiles, avoiding crowd-sourced inaccuracies.

03
4-4-9 Math Solver

Enforces Atwater thermodynamic consistency. Total calories must equal (4×P) + (4×C) + (9×F) with zero exceptions.

04
Anycast KV Cache

Verified meals are cached across 300+ global edge data centers for sub-18ms repeat retrieval.

API Response Structure

Clean, Standardized JSON with Zero Math Drift

FoodVivo returns structured, typed data ready to render directly into your mobile macro progress bars, pie charts, and daily meal journals.

Key Response Guarantees:
Includes exact USDA FoodData Central IDs (fdc_id)
Calculates Total Carbs, Net Carbs, and Dietary Fiber
Provides thermodynamic verification confidence metadata
200 OK • Content-Type: application/json14.2 ms
{
  "success": true,
  "data": {
    "meal_title": "Post-Workout Chipotle Style Protein Bowl",
    "thought_process": "Identified 180g grilled chicken breast, 150g cooked brown rice, 100g black beans, and 50g fresh Hass avocado. Verified against USDA FoodData Central chemical assays with 4-4-9 thermodynamic consistency.",
    "foods": [
      {
        "name": "Grilled Chicken Breast",
        "quantity": 1,
        "serving_size": 1,
        "serving_unit": "portion (180g)",
        "weight_g": 180,
        "calories": 297,
        "protein_g": 55.8,
        "carbs_g": 0,
        "fat_g": 6.4,
        "allergens": [],
        "dietary": [
          "gluten_free",
          "high_protein"
        ],
        "confidence": 0.98
      },
      {
        "name": "Brown Rice (Cooked)",
        "quantity": 1,
        "serving_size": 1,
        "serving_unit": "cup (150g)",
        "weight_g": 150,
        "calories": 168,
        "protein_g": 3.8,
        "carbs_g": 35.1,
        "fat_g": 1.4,
        "fiber_g": 2.8,
        "allergens": [],
        "dietary": [
          "vegan",
          "gluten_free"
        ],
        "confidence": 0.96
      },
      {
        "name": "Black Beans (Cooked)",
        "quantity": 1,
        "serving_size": 1,
        "serving_unit": "portion (100g)",
        "weight_g": 100,
        "calories": 132,
        "protein_g": 8.9,
        "carbs_g": 23.7,
        "fat_g": 0.5,
        "fiber_g": 8.7,
        "allergens": [],
        "dietary": [
          "vegan",
          "gluten_free"
        ],
        "confidence": 0.97
      },
      {
        "name": "Fresh Avocado",
        "quantity": 0.5,
        "serving_size": 0.5,
        "serving_unit": "medium avocado (50g)",
        "weight_g": 50,
        "calories": 80,
        "protein_g": 1,
        "carbs_g": 4.3,
        "fat_g": 7.3,
        "fiber_g": 3.4,
        "allergens": [],
        "dietary": [
          "vegan",
          "keto_friendly",
          "gluten_free"
        ],
        "confidence": 0.95
      }
    ],
    "totals": {
      "calories": 677,
      "protein_g": 69.5,
      "carbs_g": 63.1,
      "fat_g": 15.6,
      "fiber_g": 14.9,
      "sodium_mg": 640
    },
    "macro_split": {
      "protein_pct": 41,
      "carbs_pct": 38,
      "fat_pct": 21
    },
    "sources": [
      {
        "title": "USDA FoodData Central - Chicken Breast (FDC 171077)",
        "domain": "fdc.nal.usda.gov",
        "url": "https://fdc.nal.usda.gov/fdc-app.html#/food-details/171077/nutrients"
      }
    ],
    "assumptions": [
      "Assumed boneless, skinless chicken breast grilled with negligible cooking oil spray.",
      "Brown rice measured cooked."
    ]
  },
  "meta": {
    "model": "foodvivo-neural-engine",
    "latency_ms": 14,
    "cached": true
  }
}

Integrate in 10 Minutes

Production-ready API code examples for mobile developers.

cURL
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": "180g grilled chicken breast, 150g brown rice, 100g black beans, half avocado",
    "context": "Post-Workout Lunch"
  }'

Frequently Asked Developer Questions

Technical details on portion estimation, offline caching, and unit conversions.

How does FoodVivo estimate gram portion sizes from a single plate photo?

Our multi-modal vision pipeline segments individual ingredients into 3D volumetric bounding approximations. By cross-referencing standard plate dimensions, food density tables, and USDA FDC standard portion distributions, it assigns accurate gram weights (e.g. 180g cooked chicken breast, 150g brown rice) with an average portion deviation under 4.5%.

What happens when a fitness user logs a custom home-cooked recipe?

FoodVivo parses the recipe into its raw composite ingredients, computes total raw cooking weight losses (water evaporation), and scales macros based on the user's logged portion percentage. You receive the total meal calories plus a line-item breakdown of every ingredient.

How do we handle offline meal logging in remote gym locations?

Since repeat meals return in sub-18ms with cache headers (`X-FoodVivo-Cache: HIT`), mobile apps can cache the local top-50 frequent foods on device SQLite. If offline, the app queues camera captures and syncs against our edge API once connectivity resumes.

Are net carbs calculated automatically for keto and low-carb users?

Yes. Every response includes total carbohydrates, dietary fiber, net carbs (Total Carbs minus Fiber), and sugar content with verified Atwater energy weighting.

Can users adjust gram weights or swap ingredients after scanning?

Yes. FoodVivo returns individual items with USDA FoodData Central IDs (`fdc_id`). If a user changes chicken breast from 150g to 200g in your UI, your frontend can scale the macros linearly without needing another full AI vision call.

Ready to Upgrade Your Fitness App's Food Logging?

Create a developer account in 30 seconds. Get 200 free monthly requests with full access to camera photo analysis, text parsing, and dual barcodes.