addIngredient
URL
http://www.nutritter.com/api/addIngredient
Description
Add an ingredient to the authenticated user's ingredients
Authentication
Required
Parameters
name(required)
Description
The name of the ingredient
Type
string
Example Value
My Secret Sauce
brand(optional)
Description
The name of the brand
Type
string
Default Value
generic
Example Value
A1
serving_size_units(optional)
Description
The unit for serving size
Type
string
Default Value
serving
Example Value
cup
serving_size_quantity(optional)
Description
The number of serving size
Type
float
Default Value
1
Example Value
1.5
calories(optional)
Description
Calories
Type
float
Example Value
100
calories_from_fat(optional)
Description
Calories From Fat
Type
float
Example Value
100
total_fat(optional)
Description
Total Fat(g)
Type
float
Example Value
100
saturated_fat(optional)
Description
Saturated Fat(g)
Type
float
Example Value
100
trans_fat(optional)
Description
Trans Fat(g)
Type
float
Example Value
100
cholesterol(optional)
Description
Cholesterol(mg)
Type
float
Example Value
100
sodium(optional)
Description
Sodium(mg)
Type
float
Example Value
100
total_carbohydrates(optional)
Description
Total Carbohydrates(g)
Type
float
Example Value
100
dietary_fiber(optional)
Description
Dietary Fiber(g)
Type
float
Example Value
100
sugars(optional)
Description
Sugars(g)
Type
float
Example Value
100
protein(optional)
Description
Protein(g)
Type
float
Example Value
100
vitamin_a_percent(optional)
Description
Vitamin A (%)
Type
float
Example Value
100
vitamin_c_percent(optional)
Description
Vitamin C (%)
Type
float
Example Value
100
calcium_percent(optional)
Description
Calcium (%)
Type
float
Example Value
100
iron_percent(optional)
Description
Iron (%)
Type
float
Example Value
100
Example
An easy way to try the Nutritter API is to use cURL. Here is an example of a curl command for addIngredient:
Command
Output
<?xml version="1.0"?>
<result>
<name>My Secret Sauce</name>
<brand>
<name>NULL</name>
<avatar>
<small>http://www.nutritter.com/img/brands/NULL</small>
<medium>http://www.nutritter.com/img/brands/NULL</medium>
<large>http://www.nutritter.com/img/brands/NULL</large>
</avatar>
</brand>
<nutrition_facts>
<calories>100</calories>
<caloriesFromFat>100</caloriesFromFat>
<totalFat>100g</totalFat>
<saturatedFat>100g</saturatedFat>
<transFat>100g</transFat>
<cholesterol>100mg</cholesterol>
<sodium>100mg</sodium>
<totalCarbohydrate>100g</totalCarbohydrate>
<dietaryFiber>100g</dietaryFiber>
<sugars>100g</sugars>
<protein>100g</protein>
<vitaminA>100%</vitaminA>
<vitaminC>100%</vitaminC>
<calcium>100%</calcium>
<iron>100%</iron>
</nutrition_facts>
</result>