---
title: "Analyze Nutrition Image"
method: POST
path: "/nutrition_records/image"
tags: ["Nutrition AI"]
---

# Analyze Nutrition Image

`POST /nutrition_records/image`

##### Upload a food image and analyze the nutritional content.

The system uses advanced computer vision and machine learning models to identify ingredients, calculate nutritional values, and provide detailed food composition data.

### Processing Flow

The processing mode is controlled by the `wait_on_process` parameter. The API supports two processing modes, each suited for a different use case:

- **Asynchronous** (recommended) — returns immediately and processes the image in the background (see [Asynchronous Processing](/nutrition-ai/async)); use webhooks for real-time notifications
- **Synchronous** — waits for analysis to be completed before responding

If your application is configured to use asynchronous processing and ready to consume webhooks, our API will send a webhook notification in both processing modes, synchronous or asynchronous, once the nutritional analysis is completed.

### Analysis Modes

- **`precise`** (default) — uses advanced AI models for the highest accuracy and detail with good processing time
- **`fast`** — uses optimized AI models for good accuracy and detail with the fastest processing time

### Localization

Optionally provide `country_code` and/or `language_code` in lowercase (ISO 3166-1 alpha-2 code) for region-specific analysis.

### Including Optional Data

If `include_nutrition_fields` is omitted or empty, only four basic fields are included by default:
- `carbohydrate_g`
- `energy_kcal`
- `fat_total_g`
- `protein_g`

Example of how to include optional fields and custom nutritional fields:

```json
{
  "include_nutri_score": true,
  "include_dish_description": true,
  "include_ingredients": true,
  "include_nutrition_fields": [
    "energy_kcal",
    "protein_g",
    "fat_total_g",
    "carbohydrate_g",
    "fiber_total_dietary_g",
    "sodium_mg",
    "calcium_mg",
    "iron_mg"
  ]
}
```

For more documentation, including implementation examples, processing workflows, and integration guides, see **[Implementation Guide](/nutrition-ai/implementation)**.

## Request body

- NutritionRecordUploadInput
  - `analysis_mode` 'fast' | 'precise' — A preferred mode for the analysis
  - `body` string — Base64-encoded binary data, this or 'body_url' is required
  - `body_url` string — URL to the image, this or 'body' is required
  - `consumed` boolean — Whether to save the record (true) or only analyze (false)
  - `consumed_at` string, date-time — The UTC time when food was consumed. By default, it is set to the upload time
  - `country_code` 'af' | 'al' | 'dz' | 'ad' | 'ao' | 'ag' | 'ar' | 'am' | 'au' | 'at' | 'az' | 'bs' | 'bh' | 'bd' | 'bb' | 'by' | 'be' | 'bz' | 'bj' | 'bt' | 'bo' | 'ba' | 'bw' | 'br' | 'bn' | 'bg' | 'bf' | 'bi' | 'cv' | 'kh' | 'cm' | 'ca' | 'cf' | 'td' | 'cl' | 'cn' | 'co' | 'km' | 'cg' | 'cd' | 'cr' | 'ci' | 'hr' | 'cu' | 'cy' | 'cz' | 'dk' | 'dj' | 'dm' | 'do' | 'ec' | 'eg' | 'sv' | 'gq' | 'er' | 'ee' | 'sz' | 'et' | 'fj' | 'fi' | 'fr' | 'ga' | 'gm' | 'ge' | 'de' | 'gh' | 'gr' | 'gd' | 'gt' | 'gn' | 'gw' | 'gy' | 'ht' | 'hn' | 'hu' | 'is' | 'in' | 'id' | 'ir' | 'iq' | 'ie' | 'il' | 'it' | 'jm' | 'jp' | 'jo' | 'kz' | 'ke' | 'ki' | 'kp' | 'kr' | 'kw' | 'kg' | 'la' | 'lv' | 'lb' | 'ls' | 'lr' | 'ly' | 'li' | 'lt' | 'lu' | 'mg' | 'mw' | 'my' | 'mv' | 'ml' | 'mt' | 'mh' | 'mr' | 'mu' | 'mx' | 'fm' | 'md' | 'mc' | 'mn' | 'me' | 'ma' | 'mz' | 'mm' | 'na' | 'nr' | 'np' | 'nl' | 'nz' | 'ni' | 'ne' | 'ng' | 'mk' | 'no' | 'om' | 'pk' | 'pw' | 'pa' | 'pg' | 'py' | 'pe' | 'ph' | 'pl' | 'pt' | 'qa' | 'ro' | 'ru' | 'rw' | 'kn' | 'lc' | 'vc' | 'ws' | 'sm' | 'st' | 'sa' | 'sn' | 'rs' | 'sc' | 'sl' | 'sg' | 'sk' | 'si' | 'sb' | 'so' | 'za' | 'ss' | 'es' | 'lk' | 'sd' | 'sr' | 'se' | 'ch' | 'sy' | 'tj' | 'tz' | 'th' | 'tl' | 'tg' | 'to' | 'tt' | 'tn' | 'tr' | 'tm' | 'tv' | 'ug' | 'ua' | 'ae' | 'gb' | 'us' | 'uy' | 'uz' | 'vu' | 've' | 'vn' | 'ye' | 'zm' | 'zw' — Country ISO 3166-1 alpha-2 code in lowercase
  - `include_dish_description` boolean — Include dish description of the food
  - `include_ingredients` boolean — Include ingredients of the food
  - `include_nutri_score` boolean — Include nutri-score label of the food
  - `include_nutrition_fields` string[] — Include specific nutrition fields in the analysis report. By default, carbohydrate_g, energy_kcal, fat_total_g and protein_g will be included
  - `language_code` 'aa' | 'ab' | 'ae' | 'af' | 'ak' | 'am' | 'an' | 'ar' | 'as' | 'av' | 'ay' | 'az' | 'ba' | 'be' | 'bg' | 'bh' | 'bi' | 'bm' | 'bn' | 'bo' | 'br' | 'bs' | 'ca' | 'ce' | 'ch' | 'co' | 'cr' | 'cs' | 'cu' | 'cv' | 'cy' | 'da' | 'de' | 'dv' | 'dz' | 'ee' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'ff' | 'fi' | 'fj' | 'fo' | 'fr' | 'fy' | 'ga' | 'gd' | 'gl' | 'gn' | 'gu' | 'gv' | 'ha' | 'he' | 'hi' | 'ho' | 'hr' | 'ht' | 'hu' | 'hy' | 'hz' | 'ia' | 'id' | 'ie' | 'ig' | 'ii' | 'ik' | 'io' | 'is' | 'it' | 'iu' | 'ja' | 'jv' | 'ka' | 'kg' | 'ki' | 'kj' | 'kk' | 'kl' | 'km' | 'kn' | 'ko' | 'kr' | 'ks' | 'ku' | 'kv' | 'kw' | 'ky' | 'la' | 'lb' | 'lg' | 'li' | 'ln' | 'lo' | 'lt' | 'lu' | 'lv' | 'mg' | 'mh' | 'mi' | 'mk' | 'ml' | 'mn' | 'mr' | 'ms' | 'mt' | 'my' | 'na' | 'nb' | 'nd' | 'ne' | 'ng' | 'nl' | 'nn' | 'no' | 'nr' | 'nv' | 'ny' | 'oc' | 'oj' | 'om' | 'or' | 'os' | 'pa' | 'pi' | 'pl' | 'ps' | 'pt' | 'qu' | 'rm' | 'rn' | 'ro' | 'ru' | 'rw' | 'sa' | 'sc' | 'sd' | 'se' | 'sg' | 'si' | 'sk' | 'sl' | 'sm' | 'sn' | 'so' | 'sq' | 'sr' | 'ss' | 'st' | 'su' | 'sv' | 'sw' | 'ta' | 'te' | 'tg' | 'th' | 'ti' | 'tk' | 'tl' | 'tn' | 'to' | 'tr' | 'ts' | 'tt' | 'tw' | 'ty' | 'ug' | 'uk' | 'ur' | 'uz' | 've' | 'vi' | 'vo' | 'wa' | 'wo' | 'xh' | 'yi' | 'yo' | 'za' | 'zh' | 'zu' — Language ISO 639-1 code in lowercase
  - `user_time_offset_minutes` integer — User's local timezone offset in minutes
  - `wait_on_process` boolean — If true, waits for the process to complete. If false, returns immediate response and sends notification with analysis report to webhook URL when finished

## Response `200`

OK

- NutritionRecord
  - `consumed_at` string, date-time — The UTC time when food was consumed. By default, it is set to the record update time
  - `dish_description` string — Detected dish description
  - `dish_description_translated` string — Dish description translated to target language
  - `dish_name` string, required — Detected dish name
  - `dish_name_translated` string — Dish name translated to target language
  - `failure_reason` string — Reason for processing failure
  - `ingredients` NutritionRecordIngredient[], nullable — List of detected ingredients with nutritional information
    - `name` string, required — Ingredient name using LANGUAL standard terminology
    - `name_translated` string — Ingredient name translated to target language
    - `nutritional_fields` object — Nutritional values in the given serving size
      - `calcium_mg` number — Calcium in milligrams
      - `carbohydrate_g` number — Carbohydrates in grams
      - `cholesterol_mg` number — Cholesterol in milligrams
      - `energy_kcal` number — Energy in kilocalories
      - `fat_monounsaturated_g` number — Monounsaturated Fat in grams
      - `fat_polyunsaturated_g` number — Polyunsaturated Fat in grams
      - `fat_saturated_g` number — Saturated Fat in grams
      - `fat_total_g` number — Total Fat in grams
      - `fat_trans_g` number — Trans Fat in grams
      - `fiber_total_dietary_g` number — Dietary Fiber in grams
      - `folate_mcg` number — Folate in micrograms
      - `iron_mg` number — Iron in milligrams
      - `magnesium_mg` number — Magnesium in milligrams
      - `manganese_mcg` number — Manganese in micrograms
      - `niacin_mg` number — Niacin in milligrams
      - `phosphorus_mg` number — Phosphorus in milligrams
      - `potassium_mg` number — Potassium in milligrams
      - `protein_g` number — Protein in grams
      - `riboflavin_mg` number — Riboflavin in milligrams
      - `salt_g` number — Salt in grams
      - `salt_mg` number — Salt in milligrams
      - `sodium_g` number — Sodium in grams
      - `sodium_mg` number — Sodium in milligrams
      - `sugars_total_g` number — Total Sugars in grams
      - `thiamin_mg` number — Thiamin in milligrams
      - `vitamin_a_rae_mcg` number — Vitamin A in micrograms
      - `vitamin_b12_mcg` number — Vitamin B12 in micrograms
      - `vitamin_b6_mg` number — Vitamin B6 in milligrams
      - `vitamin_c_mg` number — Vitamin C in milligrams
      - `vitamin_d_mcg` number — Vitamin D in micrograms
      - `vitamin_e_mg` number — Vitamin E in milligrams
      - `vitamin_k_mcg` number — Vitamin K in micrograms
      - `zinc_mg` number — Zinc in milligrams
    - `serving_size` number, double, required — Serving size in metric units
    - `unit` 'g' | 'mg' | 'mcg' | 'ml' | 'kcal', required — Metric unit (g for solids, ml for liquids)
  - `input_type` 'image' | 'manual' | 'push' | 'text' — Nutrition record input type
  - `modified_at` string, date-time — Update timestamp in UTC
  - `nutri_score` string — Nutri-Score known as the 5-Colour Nutrition label (A-E)
  - `nutritional_fields` object — Nutritional values in the given serving size
    - `calcium_mg` number — Calcium in milligrams
    - `carbohydrate_g` number — Carbohydrates in grams
    - `cholesterol_mg` number — Cholesterol in milligrams
    - `energy_kcal` number — Energy in kilocalories
    - `fat_monounsaturated_g` number — Monounsaturated Fat in grams
    - `fat_polyunsaturated_g` number — Polyunsaturated Fat in grams
    - `fat_saturated_g` number — Saturated Fat in grams
    - `fat_total_g` number — Total Fat in grams
    - `fat_trans_g` number — Trans Fat in grams
    - `fiber_total_dietary_g` number — Dietary Fiber in grams
    - `folate_mcg` number — Folate in micrograms
    - `iron_mg` number — Iron in milligrams
    - `magnesium_mg` number — Magnesium in milligrams
    - `manganese_mcg` number — Manganese in micrograms
    - `niacin_mg` number — Niacin in milligrams
    - `phosphorus_mg` number — Phosphorus in milligrams
    - `potassium_mg` number — Potassium in milligrams
    - `protein_g` number — Protein in grams
    - `riboflavin_mg` number — Riboflavin in milligrams
    - `salt_g` number — Salt in grams
    - `salt_mg` number — Salt in milligrams
    - `sodium_g` number — Sodium in grams
    - `sodium_mg` number — Sodium in milligrams
    - `sugars_total_g` number — Total Sugars in grams
    - `thiamin_mg` number — Thiamin in milligrams
    - `vitamin_a_rae_mcg` number — Vitamin A in micrograms
    - `vitamin_b12_mcg` number — Vitamin B12 in micrograms
    - `vitamin_b6_mg` number — Vitamin B6 in milligrams
    - `vitamin_c_mg` number — Vitamin C in milligrams
    - `vitamin_d_mcg` number — Vitamin D in micrograms
    - `vitamin_e_mg` number — Vitamin E in milligrams
    - `vitamin_k_mcg` number — Vitamin K in micrograms
    - `zinc_mg` number — Zinc in milligrams
  - `record_id` string, uuid — Report record ID
  - `serving_size` number, double, required — Serving size in metric units
  - `status` 'pending' | 'processing' | 'completed' | 'failed' | 'updated' — Processing status
  - `unit` 'g' | 'mg' | 'mcg' | 'ml' | 'kcal', required — Metric unit (g for solids, ml for liquids)
  - `uploaded_at` string, date-time — Upload timestamp in UTC
  - `user_time_offset_minutes` integer — User's local timezone offset in minutes

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `422` — Unprocessable Entity
- `500` — Internal Server Error

---

[API](https://skmtc.dev/spikeapi/apis/application-user-api.md) · [All operations](https://skmtc.dev/spikeapi/apis/application-user-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/spikeapi/application-user-api/revisions/637338fb0c9d/schema)
