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

# Analyze Nutrients

> Analyze the nutritional content of a list of ingredients.



## OpenAPI

````yaml https://www.mrcook.app/api/business/openapi.json post /v1/nutrients/analyze
openapi: 3.1.0
info:
  title: Mr. Cook API
  version: 1.0.0
  description: API for integrating recipe generation into your products
  contact:
    email: feedback@mrcook.app
  termsOfService: https://www.mrcook.app/legal/api-terms
servers:
  - url: https://api.mrcook.app
    description: Production API
security: []
paths:
  /v1/nutrients/analyze:
    post:
      summary: Analyze Nutrients
      description: Analyze the nutritional content of a list of ingredients.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ingredients:
                  type: array
                  items:
                    type: string
                  minItems: 1
                  description: An array of strings, where each string is one ingredient.
                  example:
                    - 500 grams ground beef
                    - 4 slices bacon
                    - 4 slices cheddar cheese
                    - 4 hamburger buns
                servings:
                  type: string
                  description: >-
                    The number of servings the ingredients are for (e.g., '4
                    servings'). Defaults to 1 if not specified.
                  example: 4 servings
              required:
                - ingredients
      responses:
        '200':
          description: Successfully analyzed nutrients.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      calories:
                        type:
                          - number
                          - 'null'
                        description: Calories per portion (kcal)
                        example: 550
                      carbohydrates:
                        type:
                          - number
                          - 'null'
                        description: Carbohydrates per portion (g)
                        example: 30.5
                      protein:
                        type:
                          - number
                          - 'null'
                        description: Protein per portion (g)
                        example: 45.2
                      fat:
                        type:
                          - number
                          - 'null'
                        description: Fat per portion (g)
                        example: 28.8
                      sugar:
                        type:
                          - number
                          - 'null'
                        description: Sugar per portion (g)
                        example: 5.1
                      confidence:
                        type:
                          - number
                          - 'null'
                        description: Overall confidence score (0-100)
                        example: 92
                    required:
                      - calories
                      - carbohydrates
                      - protein
                      - fat
                      - sugar
                      - confidence
                required:
                  - success
                  - data
        '401':
          description: >-
            Invalid or missing API key. Learn more:
            https://docs.mrcook.app/business-api/api-key
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: UNAUTHORIZED
                  message:
                    type: string
                    example: >-
                      Invalid or missing API key. Learn more:
                      https://docs.mrcook.app/business-api/api-key
                required:
                  - code
                  - message
        '402':
          description: >-
            Insufficient credits. Please purchase more credits:
            https://docs.mrcook.app/business-api/pricing
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INSUFFICIENT_CREDITS
                  message:
                    type: string
                    example: >-
                      Insufficient credits. Please purchase more credits:
                      https://docs.mrcook.app/business-api/pricing
                required:
                  - code
                  - message
        '403':
          description: You don't have permission to access this resource.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: FORBIDDEN
                  message:
                    type: string
                    example: You don't have permission to access this resource.
                required:
                  - code
                  - message
        '429':
          description: >-
            Rate limit exceeded. Please contact support if you need a higher
            limit.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: TOO_MANY_REQUESTS
                  message:
                    type: string
                    example: >-
                      Rate limit exceeded. Please contact support if you need a
                      higher limit.
                required:
                  - code
                  - message
        '500':
          description: Nutrient analysis failed. Please try again later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ANALYSIS_FAILED
                  message:
                    type: string
                    example: Nutrient analysis failed. Please try again later.
                required:
                  - code
                  - message
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'How to get your API key: https://docs.mrcook.app/business-api/api-key'

````