REST API Reference

FoodVivo Documentation

Base URL: https://foodvivo-api.flappybird-assets.workers.dev

Authentication

All API requests must include your API key in either the Authorization header as a Bearer token or in the X-API-Key header.

Authorization: Bearer sk_live_your_api_key
POST/v1/food/analyze

Decompose natural language food descriptions or plate images into individual ingredients and aggregate nutrition facts.

Request Body (JSON)

{
  "text": "2 poached eggs with avocado toast",
  "context": "Breakfast",
  "image_url": "https://example.com/food.jpg" // optional
}

Response Example

{
  "success": true,
  "data": {
    "foods": [
      {
        "name": "Poached Eggs",
        "quantity": 2,
        "calories": 143,
        "protein_g": 12.6,
        "carbs_g": 0.7,
        "fat_g": 9.5,
        "allergens": ["egg"]
      }
    ],
    "totals": {
      "calories": 424,
      "protein_g": 22.1,
      "carbs_g": 35.2,
      "fat_g": 22.6
    }
  }
}
POST/v1/barcode/lookup

Lookup exact packaged product nutrition facts by UPC / EAN barcode from 3M+ items in OpenFoodFacts and Gemini web grounding.

{
  "barcode": "3017620422003",
  "product_name_hint": "Nutella" // optional
}
POST/v1/meal/portion/estimate

Recalculate nutrition and macro breakdown for adjusted portion or weight multipliers in 0ms without AI overhead.

{
  "food": { ...FoodItem },
  "target_weight_g": 250
}