> ## 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.

# Analyze Nutrition Facts Label

> ##### Upload an image of a nutritional facts label to analyze it.

The system uses OCR (Optical Character Recognition) powered by AI to extract nutrition details from nutritional facts label image.
The results with nutritional fields like total fat, protein, etc. are structurized and presented as one ingredient in the JSON response.

### Processing Flow

The processing of nutrition facts label analysis is synchronous. No webhooks will be sent.

### 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

### Nutritional fields

A predefined list of nutritional fields is extracted. See **[Nutritional Fields](/technical-references/nutritional_fields)** for supported macronutrients and micronutrients.

### Localization

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




## OpenAPI

````yaml post /nutrition_records/ingredients/label
openapi: 3.1.0
info:
  title: Application user API
  version: 3.0.2
servers:
  - url: https://app-api.spikeapi.com/v3
security: []
paths:
  /nutrition_records/ingredients/label:
    post:
      tags:
        - Nutrition AI
      summary: Analyze Nutrition Facts Label
      description: >
        ##### Upload an image of a nutritional facts label to analyze it.


        The system uses OCR (Optical Character Recognition) powered by AI to
        extract nutrition details from nutritional facts label image.

        The results with nutritional fields like total fat, protein, etc. are
        structurized and presented as one ingredient in the JSON response.


        ### Processing Flow


        The processing of nutrition facts label analysis is synchronous. No
        webhooks will be sent.


        ### 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


        ### Nutritional fields


        A predefined list of nutritional fields is extracted. See **[Nutritional
        Fields](/technical-references/nutritional_fields)** for supported
        macronutrients and micronutrients.


        ### Localization


        For more documentation, including implementation examples, processing
        workflows, and integration guides, see **[Implementation
        Guide](/nutrition-ai/implementation)**.
      operationId: postNutritionRecordsIngredientsLabel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NutritionIngredientLabelInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NutritionIngredient'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unauthorized
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Not Found
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      security:
        - bearer: []
components:
  schemas:
    NutritionIngredientLabelInput:
      additionalProperties: false
      properties:
        analysis_mode:
          default: precise
          description: A preferred mode for the analysis
          enum:
            - fast
            - precise
          type: string
        body:
          description: Base64-encoded binary data, this or 'body_url' is required
          type: string
        body_url:
          description: URL to the image, this or 'body' is required
          type: string
      type: object
    NutritionIngredient:
      additionalProperties: false
      properties:
        failure_reason:
          description: Reason for processing failure
          examples:
            - Unable to identify label
          readOnly: true
          type: string
        name:
          description: Detected ingredient name
          examples:
            - beef and broccoli stir-fry
          type: string
        nutritional_fields:
          additionalProperties: false
          description: Nutritional values in the given serving size
          properties:
            calcium_mg:
              description: Calcium in milligrams
              examples:
                - 1000
              type: number
            carbohydrate_g:
              description: Carbohydrates in grams
              examples:
                - 250
              type: number
            cholesterol_mg:
              description: Cholesterol in milligrams
              examples:
                - 300
              type: number
            energy_kcal:
              description: Energy in kilocalories
              examples:
                - 800
              type: number
            fat_monounsaturated_g:
              description: Monounsaturated Fat in grams
              examples:
                - 20
              type: number
            fat_polyunsaturated_g:
              description: Polyunsaturated Fat in grams
              examples:
                - 15
              type: number
            fat_saturated_g:
              description: Saturated Fat in grams
              examples:
                - 20
              type: number
            fat_total_g:
              description: Total Fat in grams
              examples:
                - 65
              type: number
            fat_trans_g:
              description: Trans Fat in grams
              examples:
                - 0.5
              type: number
            fiber_total_dietary_g:
              description: Dietary Fiber in grams
              examples:
                - 25
              type: number
            folate_mcg:
              description: Folate in micrograms
              examples:
                - 400
              type: number
            iron_mg:
              description: Iron in milligrams
              examples:
                - 18
              type: number
            magnesium_mg:
              description: Magnesium in milligrams
              examples:
                - 400
              type: number
            niacin_mg:
              description: Niacin in milligrams
              examples:
                - 16
              type: number
            phosphorus_mg:
              description: Phosphorus in milligrams
              examples:
                - 700
              type: number
            potassium_mg:
              description: Potassium in milligrams
              examples:
                - 3500
              type: number
            protein_g:
              description: Protein in grams
              examples:
                - 50
              type: number
            riboflavin_mg:
              description: Riboflavin in milligrams
              examples:
                - 1.3
              type: number
            salt_g:
              description: Salt in grams
              examples:
                - 12
              type: number
            salt_mg:
              description: Salt in milligrams
              examples:
                - 25
              type: number
            sodium_g:
              description: Sodium in grams
              examples:
                - 56
              type: number
            sodium_mg:
              description: Sodium in milligrams
              examples:
                - 2300
              type: number
            sugars_total_g:
              description: Total Sugars in grams
              examples:
                - 50
              type: number
            thiamin_mg:
              description: Thiamin in milligrams
              examples:
                - 1.2
              type: number
            vitamin_a_rae_mcg:
              description: Vitamin A in micrograms
              examples:
                - 900
              type: number
            vitamin_b12_mcg:
              description: Vitamin B12 in micrograms
              examples:
                - 2.4
              type: number
            vitamin_b6_mg:
              description: Vitamin B6 in milligrams
              examples:
                - 1.7
              type: number
            vitamin_c_mg:
              description: Vitamin C in milligrams
              examples:
                - 90
              type: number
            vitamin_d_mcg:
              description: Vitamin D in micrograms
              examples:
                - 20
              type: number
            vitamin_e_mg:
              description: Vitamin E in milligrams
              examples:
                - 15
              type: number
            vitamin_k_mcg:
              description: Vitamin K in micrograms
              examples:
                - 120
              type: number
            zinc_mg:
              description: Zinc in milligrams
              examples:
                - 11
              type: number
          type: object
        serving_size:
          description: Serving size in metric units
          examples:
            - 120
          format: double
          minimum: 0.01
          type: number
        status:
          description: Processing status
          enum:
            - completed
            - failed
          examples:
            - completed
          readOnly: true
          type: string
        unit:
          description: Metric unit (g for solids, ml for liquids)
          enum:
            - g
            - mg
            - mcg
            - ml
            - kcal
          examples:
            - g
          type: string
      required:
        - name
        - serving_size
        - unit
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````