BETTERMENU
Studio

Get Recipe Nutritional Analysis

Analyze recipe nutrition by ingredient — see which ingredients contribute the most to each nutrient (protein, fat, calories, vitamins, minerals, etc.).

Use this to answer: "where does the protein come from?", "which ingredient has the most calories?", "break down nutrients by ingredient", "nutrient sources"

Returns per-nutrient breakdown with top contributing ingredients and their percentage contribution. Use nutrient_set=fda_mandatory&top_n=3 for typical FDA label analysis. BMID refers to the BetterMenu nutrient identifier (e.g., n_protein, n_vitamin_c).

Returns 404 if nutrition has not been calculated yet.

Related endpoints:

  • computeRecipeNutrition — must be called first to generate data (⑥)
  • getRecipeNutrition — total nutrition without per-ingredient breakdown
GET
/studio/recipes/{recipe_id}/analysis

Authorization

BearerAuth
AuthorizationBearer <token>

JWT Bearer token authentication

In: header

Path Parameters

recipe_id*string

Unique recipe identifier

Query Parameters

nutrient_set?|

Predefined nutrient group (e.g., fda_mandatory, macronutrients, vitamins_minerals)

bmids?|

Comma-separated nutrient BMIDs (e.g., n_cf0wwfrw2sf4y,n_rqzvdbxyn4o7t)

top_n?|

Max contributors per nutrient, sorted by amount descending

Response Body

application/json

application/json

curl -X GET "https://loading/studio/recipes/string/analysis"
{
  "data": {
    "ingredients": [
      {
        "name": "string",
        "quantity_g": 0
      }
    ],
    "nutrients": [
      {
        "bmid": "string",
        "name": "string",
        "unit": "string",
        "total": "string",
        "contributions": [
          {
            "ingredient_index": 0,
            "amount": "string"
          }
        ]
      }
    ]
  },
  "meta": {
    "version": "string",
    "request_id": "string",
    "timestamp": "string"
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}