curl --request POST \
--url https://api.example.com/api/parseIngredients \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>"
}
'{
"success": true,
"data": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}Extract structured ingredient data from raw HTML or text using AI
curl --request POST \
--url https://api.example.com/api/parseIngredients \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>"
}
'{
"success": true,
"data": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}/api/parseIngredients endpoint extracts structured ingredient data from raw HTML or text content. It uses AI to parse ingredients into a structured format with amounts, units, ingredient names, descriptions, and substitutions.
This endpoint is useful when you have recipe HTML content but need to extract just the ingredients in a structured format.
true for successful responses[title, ingredientGroups]Show Parsed Data Structure
[
"Recipe Title", // string
[ // array of ingredient groups
{
"groupName": "For the sauce",
"ingredients": [
{
"amount": "2",
"units": "tablespoons",
"ingredient": "unsalted butter",
"description": "Creates silky base and rich mouthfeel",
"substitutions": ["ghee", "olive oil"]
}
]
}
]
]
false for error responsescurl -X POST https://your-domain.com/api/parseIngredients \
-H "Content-Type: application/json" \
-d '{
"text": "<h1>Gochujang Pasta</h1><h2>Ingredients</h2><ul><li>2 tablespoons unsalted butter</li><li>2 cloves garlic, minced</li><li>2 tablespoons gochujang</li><li>1/2 cup heavy cream</li></ul>"
}'
{
"success": true,
"data": "[\"Gochujang Pasta\", [{\"groupName\": \"For the sauce\", \"ingredients\": [{\"amount\": \"2\", \"units\": \"tablespoons\", \"ingredient\": \"unsalted butter\", \"description\": \"Creates silky base and rich mouthfeel\", \"substitutions\": [\"ghee\", \"olive oil\"]}, {\"amount\": \"2\", \"units\": \"tablespoons\", \"ingredient\": \"gochujang\", \"description\": \"Adds spicy-sweet depth and fermented complexity\", \"substitutions\": [\"sriracha mixed with miso\", \"sambal oelek\"]}]}]]"
}
data field contains:
[
"Gochujang Pasta",
[
{
"groupName": "For the sauce",
"ingredients": [
{
"amount": "2",
"units": "tablespoons",
"ingredient": "unsalted butter",
"description": "Creates silky base and rich mouthfeel",
"substitutions": ["ghee", "olive oil"]
},
{
"amount": "2",
"units": "tablespoons",
"ingredient": "gochujang",
"description": "Adds spicy-sweet depth and fermented complexity",
"substitutions": ["sriracha mixed with miso", "sambal oelek"]
}
]
}
]
]
{
"success": false,
"error": {
"code": "ERR_NO_RECIPE_FOUND",
"message": "No valid recipe found in the provided HTML"
}
}