# Calculate calories and macros per serving for a recipe

**Use case:** 

Paste a recipe from a video caption and get calories, protein, fat and carbs per serving, with each ingredient matched to a USDA FoodData Central food.

## Input

```json
{
  "items": [
    "Overnight protein oats (2 jars): 1 cup rolled oats, 1 cup milk, 1/2 cup Greek yogurt, 1 scoop vanilla protein powder (30g), 2 tbsp chia seeds, 1 tbsp honey, 1/2 cup blueberries. Mix everything except the blueberries, split into 2 jars, refrigerate overnight, top with blueberries."
  ],
  "youtubeUrls": [],
  "mediaFileUrls": [],
  "unitSystem": "metric",
  "outputLanguage": "en",
  "includeNutrition": true,
  "maxRecipes": 100,
  "maxMediaMinutes": 20
}
```

## Output

```json
{
  "title": {
    "label": "Recipe",
    "format": "string"
  },
  "servings": {
    "label": "Servings",
    "format": "integer"
  },
  "nutritionPerServing.kcal": {
    "label": "kcal",
    "format": "integer"
  },
  "nutritionPerServing.protein_g": {
    "label": "Protein (g)",
    "format": "number"
  },
  "nutritionPerServing.fat_g": {
    "label": "Fat (g)",
    "format": "number"
  },
  "nutritionPerServing.carbs_g": {
    "label": "Carbs (g)",
    "format": "number"
  },
  "nutritionPerServing.matchedIngredients": {
    "label": "Matched",
    "format": "integer"
  },
  "nutritionPerServing.totalIngredients": {
    "label": "Counted",
    "format": "integer"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Video to Recipe API: YouTube Recipe Extractor & Nutrition Actor is ready to run with the inputs already set for "Calculate calories and macros per serving for a recipe". [Sign up or log in](https://console.apify.com/create-task-from-example/IJSIE4w8xxPbMVHuk) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Calculate calories and macros per serving for a recipe" task

The Video to Recipe API: YouTube Recipe Extractor & Nutrition Actor will start running based on the input automatically. You can also change all the input fields, like captions and mixed items, youtube video links, and more, to match your specific use case.

### 3. Receive the "Calculate calories and macros per serving for a recipe" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as recipe, servings, kcal, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Calculate calories and macros per serving for a recipe" task via API](https://apify.com/messnomore/video-to-recipe.md).

## About this Actor

This example demonstrates how to use [Video to Recipe API: YouTube Recipe Extractor & Nutrition](https://apify.com/messnomore/video-to-recipe.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/messnomore/video-to-recipe.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/messnomore/video-to-recipe.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
