Nutrition calculation
Parse Ingredients
Authorization
BearerAuth AuthorizationBearer <token>
JWT Bearer token authentication
In: header
Request Body
application/json
ingredient_texts*array<>
Raw ingredient text lines to parse and resolve
Items
1 <= itemsResponse Body
application/json
application/json
curl -X POST "https://evh09u6ys0.execute-api.us-west-2.amazonaws.com/us/nutrition/parse" \ -H "Content-Type: application/json" \ -d '{ "ingredient_texts": [ "2 cups banana, mashed", "100g almond milk" ] }'{
"data": {
"ingredient_resolutions": [
{
"converted": {
"quantity": 59,
"steps": [
{
"calculation": "0.5 cup x 236ml/cup = 118ml",
"factor": 236,
"input_quantity": 0.5,
"input_unit": "cup",
"output_quantity": 118,
"output_unit": "ml"
}
],
"unit": "g"
},
"matches": {
"candidates": [
{
"category": "Fruits and Fruit Juices",
"ingredient_id": "f_usda_ff:1105073",
"ingredient_name": "Bananas, overripe, raw",
"search_confidence": 0.95
}
],
"query_text": "flour",
"selected_match": {
"category": "Fruits and Fruit Juices",
"ingredient_id": "f_usda_ff:1105073",
"ingredient_name": "Bananas, overripe, raw",
"search_confidence": 0.95
}
},
"original_text": "1/2 cup flour",
"parsed": {
"ingredient_name": "flour",
"quantity": 0.5,
"quantity_text": "1/2",
"unit": "cup"
}
}
],
"total_ingredients": 0
},
"meta": {
"version": "string",
"request_id": "string",
"timestamp": "string"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}