> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spikeapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Nutrition AI Overview

> Overview of the Spike Nutrition AI service and how to use it

## About

Upload food images and receive detailed nutritional analysis powered by AI. The Nutrition API uses advanced computer vision and machine learning to identify ingredients, calculate nutritional values, and provide comprehensive food composition data.

## Getting Started

1. Get an access token using the authentication flow (see [Authentication](/api-docs/authentication))
2. Upload base64-encoded food images using the POST endpoint
3. Retrieve results either synchronously or via webhook notifications

## Key Features

### AI-Powered Analysis

* Advanced computer vision for food identification
* LANGUAL standard terminology for precise ingredient classification
* Machine learning models for accurate nutritional calculations

### Flexible Processing

* **Asynchronous processing** (recommended) — returns immediately with background processing
* **Synchronous processing** — waits for complete analysis before returning results
* **Webhook notifications** — for real-time status updates

### Comprehensive Data

* **29 nutritional fields** from basic macros to detailed micronutrients
* **Ingredient breakdown** with per-item nutritional analysis
* **Nutri-Score rating** (A-E European scale)
* **Localized results** with country and language support

## Technical Requirements

### Image Specifications

* **Minimum size** — 512×512 pixels
* **Maximum size** — 10MB when base64-encoded
* **Supported formats** — JPEG, PNG, WebP
* **Input format** — base64-encoded string

### Processing Workflow

1. **Image Upload & Validation** — system validates format compatibility
2. **AI Model Processing** — multiple AI models are used for analysis
3. **Ingredient Identification** — foods identified using LANGUAL terminology
4. **Nutritional Analysis** — detailed breakdown calculated per 100 g/ml
5. **Translation** (optional) — results translated to specified language
6. **Storage** — results stored with a configurable retention policy

## Analysis Report Data

### Main Data

* Dish name with optional translation
* Dish description with optional translation
* Nutri-Score level (A-E)
* Serving size with unit (g/ml)

### Basic Nutritional Fields

* Energy (kcal)
* Protein (g)
* Total Fat (g)
* Carbohydrates (g)

### Extended Nutritional Data

* **Fats** — saturated, polyunsaturated, monounsaturated, trans fats
* **Micronutrients** — fiber, sugars, cholesterol
* **Minerals** — sodium, potassium, calcium, iron, magnesium, phosphorus, zinc
* **Vitamins** — A, C, D, E, K, B-complex vitamins

See the [Reference](/technical-references/nutritional_fields) for a complete list of nutritional fields.

## Image Guidelines

For optimal analysis results, guide your users to:

1. **Center the food** — capture the contents of the plate as the main subject
2. **Fill the frame** — ensure the meal occupies the majority of the image
3. **Remove distractions** — take off packaging or utensils before photographing
4. **Clean background** — keep background clutter-free, include only the plate
5. **Use proper lighting** — natural or bright lighting to capture food details clearly
6. **Optimal angle** — slight angle to minimize items obscuring each other
7. **Avoid filters** — don't use filters that might alter the food's appearance

## Implementation

For detailed implementation examples, request/response schemas, and code samples, see:

* **[Implementation Guide](/nutrition-ai/implementation)** — complete code examples and integration patterns
* **[Asynchronous Processing](/nutrition-ai/async)** — real-time notifications and webhook implementation
* **[API Reference](/api-reference/nutrition-ai-analyze-nutrition-image)** — detailed endpoint specifications and data types

### Language and Country Options

The API supports translation of results into multiple languages and region-specific analysis through country codes.
By default, responses are in English (en) with the United States (US) as the default country.
Providing a country code parameter improves analysis precision by considering regional ingredients, portion sizes, and food compositions specific to that location.
Supported languages follow ISO 639-1 codes, while country codes adhere to ISO 3166-1 alpha-2 format.

## Response Times

Response times typically range from 4 to 30 seconds depending on image complexity and the completeness of nutrition fields requested. Processing times may vary due to internal factors in AI analysis and nutritional information compilation.
You may use the option for the preference of analysis speed over precision.
