{"openapi":"3.1.0","info":{"title":"Nutrition Analysis - Calories & Macros from Text","description":"Meal in plain words (any language) or a photo to foods, grams, calories, macros and micronutrients from USDA data; food search and barcodes.","version":"v1"},"servers":[{"url":"https://nutrition-analysis-calories-macros-from-text.p.rapidapi.com","description":"RapidAPI"}],"paths":{"/v1/nutrition/analyze":{"post":{"tags":["Meal Analysis"],"summary":"Calories, macros and micronutrients of a meal described in words","description":"Get calories and nutrients of a meal described in words, any language\n('2 eggs and toast with butter'): each food's grams, USDA match and\nnutrients, then totals. Values come from USDA FoodData Central; unknown\nfoods go to `unmatched`. 10 credits up to 5 foods, +2 per extra food.","operationId":"analyzeMealText","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeRequest"},"examples":{"Analyze Meal Text":{"summary":"Analyze Meal Text","value":{"text":"2 eggs fried in butter, a slice of toast and a glass of orange juice"}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MealAnalysis"},"examples":{"Analyze Meal Text":{"summary":"Analyze Meal Text (real response)","value":{"language":"en","items":[{"input":"2 eggs fried in butter","name":"egg, fried in butter","quantity":2.0,"unit":"egg","grams":110.0,"grams_source":"portion","portion":{"label":"1 egg","grams":55.0},"match":{"fdc_id":2707159,"description":"Egg, whole, fried with butter","dataset":"fndds","category":"Eggs and omelets"},"nutrients":{"calories_kcal":200.0,"protein_g":12.8,"fat_g":16.1,"saturated_fat_g":6.6,"carbs_g":0.99,"fiber_g":0.0,"sugar_g":0.24,"cholesterol_mg":438.0,"sodium_mg":289.0,"calcium_mg":50.6,"iron_mg":1.7,"vitamin_d_ug":2.6,"vitamin_b12_ug":0.84,"...":"..."}},{"input":"a slice of toast","name":"bread, toasted","quantity":1.0,"unit":"slice","grams":25.0,"grams_source":"portion","portion":{"label":"1 medium or regular slice","grams":25.0},"match":{"fdc_id":2707599,"description":"Bread, white, toasted","dataset":"fndds","category":"Yeast breads"},"nutrients":{"calories_kcal":73.2,"protein_g":2.6,"fat_g":0.98,"carbs_g":13.5,"...":"..."}},{"input":"a glass of orange juice","name":"orange juice","quantity":1.0,"unit":"glass","grams":248.0,"grams_source":"estimated","match":{"fdc_id":2709186,"description":"Orange juice, 100%, NFS","dataset":"fndds","category":"Citrus juice"},"nutrients":{"calories_kcal":117.0,"protein_g":1.9,"carbs_g":25.3,"vitamin_c_mg":71.2,"...":"..."}}],"unmatched":[],"totals":{"calories_kcal":390.0,"protein_g":17.3,"fat_g":17.9,"carbs_g":39.8,"fiber_g":1.4,"sugar_g":22.0,"sodium_mg":418.0,"vitamin_c_mg":71.2,"...":"..."},"incomplete":[],"macros":{"protein_pct":17.8,"carbs_pct":40.9,"fat_pct":41.4},"total_grams":383.0,"source":"USDA FoodData Central (public domain)","note":"Estimates for information only, not medical or dietary advice. Nutrient values come from USDA FoodData Central; quantities given without a weight are estimated."}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Analyze Meal Text"}},"/v1/nutrition/analyze/photo":{"post":{"tags":["Meal Analysis"],"summary":"Calories and macros of a meal photo, from its URL","description":"The foods and portions on a meal photo, estimated by vision, then\nmatched to USDA foods for calories, macros and micronutrients. Portions\nfrom a photo are estimates: add a `description` to help. 15 credits for\nup to 5 foods, +2 per extra food.","operationId":"analyzeMealPhoto","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhotoRequest"},"examples":{"Analyze Meal Photo":{"summary":"Analyze Meal Photo","value":{"url":"https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Full_English_breakfast_-_London%2C_UK.jpg/1280px-Full_English_breakfast_-_London%2C_UK.jpg"}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MealAnalysis"},"examples":{"Analyze Meal Photo":{"summary":"Analyze Meal Photo","value":{"language":"en","items":[{"input":"2 eggs fried in butter","name":"egg, fried in butter","part_of":"pork schnitzel","quantity":2,"unit":"egg","grams":110,"grams_source":"portion","portion":{"label":"1 large","grams":50},"assumption":"1 pot taken as 125 g, the usual size there (USDA's '1 4 oz container' is 113 g)","match":{"fdc_id":2707159,"description":"Egg, whole, fried with butter","dataset":"fndds","category":"Eggs and omelets"},"nutrients":{"calories_kcal":196,"protein_g":13.6,"fat_g":15.0,"carbs_g":0.8}}],"unmatched":[{"input":"a spoon of homemade chutney","name":"mango chutney, homemade","grams":15,"reason":"No close food in the USDA database."}],"totals":{"calories_kcal":196,"protein_g":13.6,"fat_g":15.0,"carbs_g":0.8},"incomplete":["vitamin_d_ug"],"macros":{"protein_pct":24.1,"carbs_pct":33.6,"fat_pct":42.3},"total_grams":480,"source":"USDA FoodData Central (public domain)","note":"Estimates for information only, not medical or dietary advice. Nutrient values come from USDA FoodData Central; quantities given without a weight are estimated."}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Analyze Meal Photo"}},"/v1/nutrition/analyze/photo/upload":{"post":{"tags":["Meal Analysis"],"summary":"Calories and macros of an uploaded meal photo","description":"Same as Analyze Meal Photo, for a file sent as multipart/form-data\n(field `file`). 15 credits for up to 5 foods, +2 per extra food.","operationId":"analyzeUploadedMealPhoto","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_Analyze_Uploaded_Meal_Photo"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MealAnalysis"},"examples":{"Analyze Uploaded Meal Photo":{"summary":"Analyze Uploaded Meal Photo","value":{"language":"en","items":[{"input":"2 eggs fried in butter","name":"egg, fried in butter","part_of":"pork schnitzel","quantity":2,"unit":"egg","grams":110,"grams_source":"portion","portion":{"label":"1 large","grams":50},"assumption":"1 pot taken as 125 g, the usual size there (USDA's '1 4 oz container' is 113 g)","match":{"fdc_id":2707159,"description":"Egg, whole, fried with butter","dataset":"fndds","category":"Eggs and omelets"},"nutrients":{"calories_kcal":196,"protein_g":13.6,"fat_g":15.0,"carbs_g":0.8}}],"unmatched":[{"input":"a spoon of homemade chutney","name":"mango chutney, homemade","grams":15,"reason":"No close food in the USDA database."}],"totals":{"calories_kcal":196,"protein_g":13.6,"fat_g":15.0,"carbs_g":0.8},"incomplete":["vitamin_d_ug"],"macros":{"protein_pct":24.1,"carbs_pct":33.6,"fat_pct":42.3},"total_grams":480,"source":"USDA FoodData Central (public domain)","note":"Estimates for information only, not medical or dietary advice. Nutrient values come from USDA FoodData Central; quantities given without a weight are estimated."}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Analyze Uploaded Meal Photo"}},"/v1/nutrition/foods/search":{"get":{"tags":["Food Database"],"summary":"Search USDA foods by name: nutrients per 100 g and portions","description":"Over 13,000 USDA foods (Foundation, SR Legacy and FNDDS), best match\nfirst, each with 24 nutrients per 100 g and its household portions\n(1 cup, 1 slice, 1 large...). No AI. 1 credit.","operationId":"searchFoods","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":120,"description":"Food name in English, e.g. 'greek yogurt', 'chicken breast grilled', 'big mac'.","examples":["greek yogurt"],"title":"Q"},"description":"Food name in English, e.g. 'greek yogurt', 'chicken breast grilled', 'big mac'."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Foods to return, 1-50.","default":10,"title":"Limit"},"description":"Foods to return, 1-50."},{"name":"dataset","in":"query","required":false,"schema":{"enum":["foundation","sr_legacy","fndds"],"type":"string","description":"Only one USDA dataset: foundation (analysed ingredients), sr_legacy (reference foods, fast foods) or fndds (foods as eaten).","title":"Dataset"},"description":"Only one USDA dataset: foundation (analysed ingredients), sr_legacy (reference foods, fast foods) or fndds (foods as eaten)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodSearchResponse"},"examples":{"Search Foods":{"summary":"Search Foods","value":{"query":"greek yogurt","count":10,"foods":[{"fdc_id":2707159,"description":"Egg, whole, fried with butter","dataset":"fndds","category":"Eggs and omelets","per_100g":{"calories_kcal":196,"protein_g":13.6,"fat_g":15.0,"carbs_g":0.8},"portions":[{"label":"1 large","grams":50}]}],"source":"USDA FoodData Central (public domain)"}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Search Foods"}},"/v1/nutrition/foods/{fdc_id}":{"get":{"tags":["Food Database"],"summary":"One USDA food by FDC id, for 100 g or any amount","description":"Nutrients per 100 g, household portions, and optionally the nutrients\nof `grams`. 404 `food_not_found` (not billed) for an unknown id. 1 credit.","operationId":"getFoodNutrients","parameters":[{"name":"fdc_id","in":"path","required":true,"schema":{"type":"integer","maximum":99999999,"minimum":1,"description":"USDA FDC id.","examples":[2707159],"title":"Fdc Id"},"description":"USDA FDC id."},{"name":"grams","in":"query","required":false,"schema":{"type":"number","maximum":10000,"exclusiveMinimum":0,"description":"Also give the nutrients of this many grams.","examples":[150],"title":"Grams"},"description":"Also give the nutrients of this many grams."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodDetail"},"examples":{"Get Food Nutrients":{"summary":"Get Food Nutrients","value":{"fdc_id":2707159,"description":"Egg, whole, fried with butter","dataset":"fndds","category":"Eggs and omelets","per_100g":{"calories_kcal":196,"protein_g":13.6,"fat_g":15.0,"carbs_g":0.8},"portions":[{"label":"1 large","grams":50}],"amount":{"grams":150,"nutrients":{"calories_kcal":196,"protein_g":13.6,"fat_g":15.0,"carbs_g":0.8}},"source":"USDA FoodData Central (public domain)"}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Nothing found for this identifier. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Get Food Nutrients"}},"/v1/nutrition/barcode":{"get":{"tags":["Barcode"],"summary":"Packaged food by EAN/UPC barcode: nutrition, Nutri-Score, allergens","description":"Name, brand, quantity, serving size, nutrients per 100 g (or 100 ml)\nand per serving, Nutri-Score, NOVA group, allergens, traces and\ningredients, from Open Food Facts (ODbL: credit it when you show the\ndata). 404 `product_not_found` (not billed) for an unknown barcode.\n1 credit.","operationId":"getProductByBarcode","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","maxLength":32,"description":"EAN-13, EAN-8, UPC-A or GTIN-14 digits.","examples":["3017624010701"],"title":"Code"},"description":"EAN-13, EAN-8, UPC-A or GTIN-14 digits."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PackagedFood"},"examples":{"Get Product by Barcode":{"summary":"Get Product by Barcode","value":{"barcode":"3017624010701","name":"Nutella","brand":"Ferrero","quantity":"400 g","serving_size":"15 g","serving_grams":15,"categories":["Spreads"],"allergens":["nuts"],"traces":["milk","soybeans"],"nutriscore":"e","nova_group":4,"per":"100g","per_100":{"calories_kcal":196,"protein_g":13.6,"fat_g":15.0,"carbs_g":0.8},"salt_g_per_100":0.11,"per_serving":{"calories_kcal":196,"protein_g":13.6,"fat_g":15.0,"carbs_g":0.8},"url":"https://world.openfoodfacts.org/product/3017624010701","source":"Open Food Facts (openfoodfacts.org), ODbL 1.0"}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Nothing found for this identifier. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Get Product by Barcode"}}},"components":{"schemas":{"AnalyzeRequest":{"properties":{"text":{"type":"string","maxLength":2000,"minLength":1,"title":"Text","description":"What was eaten, in any language and in plain words: '2 eggs and a slice of toast with butter', '200 g de riz et un yaourt'. Weights, volumes, household measures and counts are understood.","examples":["2 eggs fried in butter, a slice of toast and a glass of orange juice"]}},"type":"object","required":["text"],"title":"AnalyzeRequest"},"Body_Analyze_Uploaded_Meal_Photo":{"properties":{"file":{"type":"string","title":"File","description":"Photo, up to 20 MB.","format":"binary"},"description":{"type":"string","maxLength":300,"title":"Description","description":"Optional hint about the meal (e.g. 'chicken curry, about 300 g'): helps name dishes and portions the photo cannot show."}},"type":"object","required":["file"],"title":"Body_Analyze Uploaded Meal Photo"},"ErrorBody":{"properties":{"status":{"type":"integer","title":"Status","examples":[400]},"code":{"type":"string","title":"Code","examples":["invalid_url"]},"message":{"type":"string","title":"Message","examples":["A website URL is required."]}},"type":"object","required":["status","code","message"],"title":"ErrorBody"},"ErrorEnvelope":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorEnvelope"},"Food":{"properties":{"fdc_id":{"type":"integer","title":"Fdc Id","examples":[2707159]},"description":{"type":"string","title":"Description","examples":["Egg, whole, fried with butter"]},"dataset":{"type":"string","title":"Dataset","examples":["fndds"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","examples":["Eggs and omelets"]},"per_100g":{"$ref":"#/components/schemas/Nutrients"},"portions":{"items":{"$ref":"#/components/schemas/Portion"},"type":"array","title":"Portions","description":"USDA household measures with their weight."}},"type":"object","required":["fdc_id","description","dataset","per_100g"],"title":"Food"},"FoodAmount":{"properties":{"grams":{"type":"number","title":"Grams","examples":[150]},"nutrients":{"$ref":"#/components/schemas/Nutrients"}},"type":"object","required":["grams","nutrients"],"title":"FoodAmount"},"FoodDetail":{"properties":{"fdc_id":{"type":"integer","title":"Fdc Id","examples":[2707159]},"description":{"type":"string","title":"Description","examples":["Egg, whole, fried with butter"]},"dataset":{"type":"string","title":"Dataset","examples":["fndds"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","examples":["Eggs and omelets"]},"per_100g":{"$ref":"#/components/schemas/Nutrients"},"portions":{"items":{"$ref":"#/components/schemas/Portion"},"type":"array","title":"Portions","description":"USDA household measures with their weight."},"amount":{"anyOf":[{"$ref":"#/components/schemas/FoodAmount"},{"type":"null"}],"description":"Nutrients of the amount asked for with `grams`."},"source":{"type":"string","title":"Source","examples":["USDA FoodData Central (public domain)"]}},"type":"object","required":["fdc_id","description","dataset","per_100g","source"],"title":"FoodDetail"},"FoodMatch":{"properties":{"fdc_id":{"type":"integer","title":"Fdc Id","description":"USDA FoodData Central id (see Get Food).","examples":[2707159]},"description":{"type":"string","title":"Description","examples":["Egg, whole, fried with butter"]},"dataset":{"type":"string","title":"Dataset","description":"foundation, sr_legacy or fndds (foods as eaten).","examples":["fndds"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","examples":["Eggs and omelets"]}},"type":"object","required":["fdc_id","description","dataset"],"title":"FoodMatch"},"FoodSearchResponse":{"properties":{"query":{"type":"string","title":"Query","examples":["greek yogurt"]},"count":{"type":"integer","title":"Count","examples":[10]},"foods":{"items":{"$ref":"#/components/schemas/Food"},"type":"array","title":"Foods"},"source":{"type":"string","title":"Source","examples":["USDA FoodData Central (public domain)"]}},"type":"object","required":["query","count","foods","source"],"title":"FoodSearchResponse"},"MacroSplit":{"properties":{"protein_pct":{"type":"number","title":"Protein Pct","examples":[24.1]},"carbs_pct":{"type":"number","title":"Carbs Pct","examples":[33.6]},"fat_pct":{"type":"number","title":"Fat Pct","examples":[42.3]},"alcohol_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Alcohol Pct"}},"type":"object","required":["protein_pct","carbs_pct","fat_pct"],"title":"MacroSplit","description":"Share of the calories from each macronutrient (protein and carbs at\n4 kcal/g, fat at 9, alcohol at 7), in percent."},"MealAnalysis":{"properties":{"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"ISO 639-1 code of the text.","examples":["en"]},"items":{"items":{"$ref":"#/components/schemas/MealItem"},"type":"array","title":"Items"},"unmatched":{"items":{"$ref":"#/components/schemas/Unmatched"},"type":"array","title":"Unmatched","description":"Foods found in the input but not in the USDA database: left out of the totals rather than guessed."},"totals":{"$ref":"#/components/schemas/Nutrients"},"incomplete":{"items":{"type":"string"},"type":"array","title":"Incomplete","description":"Nutrients of the totals that USDA lacks for at least one item (those totals are sums of the items that have them).","examples":[["vitamin_d_ug"]]},"macros":{"anyOf":[{"$ref":"#/components/schemas/MacroSplit"},{"type":"null"}]},"total_grams":{"type":"number","title":"Total Grams","examples":[480]},"source":{"type":"string","title":"Source","examples":["USDA FoodData Central (public domain)"]},"note":{"type":"string","title":"Note","examples":["Estimates for information only, not medical or dietary advice. Nutrient values come from USDA FoodData Central; quantities given without a weight are estimated."]}},"type":"object","required":["items","totals","total_grams","source","note"],"title":"MealAnalysis"},"MealItem":{"properties":{"input":{"type":"string","title":"Input","description":"The words of your text (or what the photo shows) for this food.","examples":["2 eggs fried in butter"]},"name":{"type":"string","title":"Name","description":"The food in English, as eaten.","examples":["egg, fried in butter"]},"part_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Part Of","description":"Set when USDA lacks a dish: this item is one of its ingredients (the dish is counted through them).","examples":["pork schnitzel"]},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quantity","examples":[2]},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit","examples":["egg"]},"grams":{"type":"number","title":"Grams","description":"Weight eaten, in grams.","examples":[110]},"grams_source":{"type":"string","enum":["stated","portion","estimated"],"title":"Grams Source","description":"stated: a weight or volume you gave; portion: your count times a USDA household portion; estimated: an ordinary portion (the AI's estimate, or the usual local size: see assumption).","examples":["portion"]},"portion":{"anyOf":[{"$ref":"#/components/schemas/Portion"},{"type":"null"}],"description":"The USDA household portion used, when one was."},"assumption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assumption","description":"The portion assumed when the amount was not a weight or volume you gave: a local standard size, a US household portion, or one ordinary portion.","examples":["1 pot taken as 125 g, the usual size there (USDA's '1 4 oz container' is 113 g)"]},"match":{"$ref":"#/components/schemas/FoodMatch"},"nutrients":{"$ref":"#/components/schemas/Nutrients"}},"type":"object","required":["input","name","grams","grams_source","match","nutrients"],"title":"MealItem"},"Nutrients":{"properties":{"calories_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Calories Kcal","examples":[196]},"protein_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Protein G","examples":[13.6]},"fat_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat G","examples":[15.0]},"saturated_fat_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Saturated Fat G"},"monounsaturated_fat_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monounsaturated Fat G"},"polyunsaturated_fat_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Polyunsaturated Fat G"},"carbs_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Carbs G","examples":[0.8]},"fiber_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fiber G"},"sugar_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sugar G"},"cholesterol_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cholesterol Mg"},"sodium_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sodium Mg"},"potassium_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Potassium Mg"},"calcium_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Calcium Mg"},"iron_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Iron Mg"},"magnesium_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Magnesium Mg"},"zinc_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Zinc Mg"},"vitamin_a_ug":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vitamin A Ug","description":"Vitamin A, RAE, in µg."},"vitamin_c_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vitamin C Mg"},"vitamin_d_ug":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vitamin D Ug"},"vitamin_b12_ug":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vitamin B12 Ug"},"folate_ug":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Folate Ug","description":"Folate, DFE, in µg."},"water_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Water G"},"alcohol_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Alcohol G"},"caffeine_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Caffeine Mg"}},"type":"object","title":"Nutrients","description":"Nutrients of an amount of food. A missing field means the source has no\nvalue for it (never estimated)."},"PackagedFood":{"properties":{"barcode":{"type":"string","title":"Barcode","examples":["3017624010701"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","examples":["Nutella"]},"brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand","examples":["Ferrero"]},"quantity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity","examples":["400 g"]},"serving_size":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Serving Size","examples":["15 g"]},"serving_grams":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Serving Grams","examples":[15]},"categories":{"items":{"type":"string"},"type":"array","title":"Categories","examples":[["Spreads"]]},"ingredients":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ingredients"},"allergens":{"items":{"type":"string"},"type":"array","title":"Allergens","examples":[["nuts"]]},"traces":{"items":{"type":"string"},"type":"array","title":"Traces","examples":[["milk","soybeans"]]},"nutriscore":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nutriscore","description":"a to e.","examples":["e"]},"nova_group":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nova Group","description":"NOVA processing group, 1 to 4.","examples":[4]},"has_nutrition":{"type":"boolean","title":"Has Nutrition","description":"Whether Open Food Facts has the nutrition table."},"per":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Per","description":"100g or 100ml: the basis of per_100.","examples":["100g"]},"per_100":{"anyOf":[{"$ref":"#/components/schemas/Nutrients"},{"type":"null"}]},"salt_g_per_100":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Salt G Per 100","examples":[0.11]},"per_serving":{"anyOf":[{"$ref":"#/components/schemas/Nutrients"},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"url":{"type":"string","title":"Url","examples":["https://world.openfoodfacts.org/product/3017624010701"]},"source":{"type":"string","title":"Source","examples":["Open Food Facts (openfoodfacts.org), ODbL 1.0"]}},"type":"object","required":["barcode","has_nutrition","url","source"],"title":"PackagedFood"},"PhotoRequest":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url","description":"Direct link to a photo of the meal: JPEG, PNG, WEBP, HEIC, GIF, BMP or TIFF, up to 20 MB.","examples":["https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Full_English_breakfast_-_London%2C_UK.jpg/1280px-Full_English_breakfast_-_London%2C_UK.jpg"]},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Description","description":"Optional hint about the meal (e.g. 'chicken curry, about 300 g'): helps name dishes and portions the photo cannot show."}},"type":"object","required":["url"],"title":"PhotoRequest"},"Portion":{"properties":{"label":{"type":"string","title":"Label","examples":["1 large"]},"grams":{"type":"number","title":"Grams","examples":[50]}},"type":"object","required":["label","grams"],"title":"Portion"},"Unmatched":{"properties":{"input":{"type":"string","title":"Input","examples":["a spoon of homemade chutney"]},"name":{"type":"string","title":"Name","examples":["mango chutney, homemade"]},"grams":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Grams","examples":[15]},"reason":{"type":"string","title":"Reason","examples":["No close food in the USDA database."]}},"type":"object","required":["input","name","reason"],"title":"Unmatched"}},"securitySchemes":{"RapidAPIKey":{"type":"apiKey","in":"header","name":"X-RapidAPI-Key"},"RapidAPIHost":{"type":"apiKey","in":"header","name":"X-RapidAPI-Host"}}},"tags":[{"name":"Meal Analysis","description":"A meal in words or a photo, to calories, macros and micronutrients."},{"name":"Food Database","description":"USDA foods: search, nutrients per 100 g and household portions. No AI."},{"name":"Barcode","description":"Packaged food by barcode, from Open Food Facts. No AI."}],"security":[{"RapidAPIKey":[],"RapidAPIHost":[]}]}