Create ingredient
recipal_create_ingredientWRITE: create a custom ingredient (private to your account) with its nutrition facts. For a food ingredient give nutrition_unit and nutrition_quantity (the serving the nutrients are entered for, e.g. 1 cup; for units beyond gram/oz/lb/kg add them in measures first) and all required nutrients. food and non_food cannot be changed later. Non-food items: set food=false and non_food to labor, packaging, safety, other_hourly or other_fixed. POST /ingredients.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| food | No | true (default) for a food ingredient; false for a non-food item. | |
| name | Yes | Ingredient name (unique unless private). | |
| brand | No | Brand name, mainly to verify data. | |
| source | No | Data source: URL, supplier or recipe id. | |
| measures | No | Custom units, e.g. [{quantity:1, unit:'cup', equivalent_quantity:240, equivalent_unit:'gram'}]. | |
| non_food | No | Required when food=false. | |
| allergens | No | Allergens by name, e.g. {"Milk": true, "Almond": true, "other-shellfish": "Oyster"}. Standard names: Wheat, Peanuts, Soy, Sesame, Mustard, Sulfites, Milk (Goat milk, Sheep milk), Egg (Duck egg, Quail egg), Fish (Tuna, Cod, Salmon, Bass), Shellfish (Crab, Lobster, Shrimp), tree nuts (Almond, Cashew, Hazelnut, Macadamia nut, Pecan, Pine nut, Pistachio, Walnut ...), Gluten (Barley, Oats, Rye, Triticale). other-milk/-egg/-fish/-shellfish/-treenut take a free-text source. An empty object {} clears all allergens. | |
| nutrients | No | Nutrition facts (food ingredients only). Amounts per serving (nutrition_quantity x nutrition_unit): calories; grams for protein, fat, fat_saturated, fat_trans, carbohydrate, fiber, uncounted_fiber, sugar, added_sugar, sugar_alcohol, fat_monounsaturated, fat_polyunsaturated, omega_3, omega_6, water, ash; milligrams for cholesterol, sodium, calcium, iron, potassium, vitamin_c, vitamin_e, thiamin, riboflavin, niacin, vitamin_b6, pantothenic_acid, phosphorus, magnesium, zinc, copper, manganese, chloride, choline; micrograms for vitamin_k, folate, vitamin_b12, biotin, iodine, selenium, chromium, molybdenum; IU for vitamin_d_IU and vitamin_a_IU. Required for a food ingredient: calories, protein, fat, fat_saturated, fat_trans, cholesterol, carbohydrate, fiber, sugar, added_sugar, sodium, calcium, iron, vitamin_a_IU, vitamin_c. | |
| nutrition_unit | No | Required for food and safety ingredients. Food: the unit the nutrients are entered in (gram, oz, lb, kg, "100 grams", a unit from measures, or a volume unit such as cup once measures includes a volume). Safety: deg_f, deg_c, ph, brix, aw, seconds, minutes, hours, psi, ppm, percent, pass_fail or each. | |
| ingredient_list | No | Ingredient list text as it appears on a label, e.g. "Curlies (Milk, Sugar)". | |
| nutrition_quantity | No | Required for food ingredients: quantity of nutrition_unit the nutrients are for, e.g. 0.5 for 0.5 cup. |