# Roma tomatoes, roasted, with a splash of heavy cream
curl "$ACIDEX_URL/v1/combinations/evaluate" \
-H "Authorization: Bearer $ACIDEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "foodId": "food_3bab6195decc17a9", "portionGrams": 200, "preparationId": "roasted" },
{ "foodId": "food_40e5af9a5038fee4", "portionGrams": 50 }
]
}'
// Node 18+, or any runtime with fetch
const res = await fetch(`${process.env.ACIDEX_URL}/v1/combinations/evaluate`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ACIDEX_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
items: [
{ foodId: "food_3bab6195decc17a9", portionGrams: 200, preparationId: "roasted" },
{ foodId: "food_40e5af9a5038fee4", portionGrams: 50 },
],
}),
});
const { triggerProfile, interactions } = await res.json();
console.log(res.headers.get("Acidex-Allowance-Remaining"), "requests left this month");
{
"items": [
{ "foodId": "food_3bab6195decc17a9", "name": "Tomato, roma", "preparationId": "roasted", "portionGrams": 200,
"preparation": { "id": "roasted", "name": "Roasted", "applied": false, "adjustedFactors": [],
"note": "No sourced effect of Roasted on this Food is known, so this is the Food's unchanged Trigger Profile." } },
{ "foodId": "food_40e5af9a5038fee4", "name": "Cream, heavy", "portionGrams": 50 }
],
"triggerProfile": [
{ "factor": "acidity", "kind": "pH", "status": "known", "value": 4.7, "knownPortionGrams": 250,
"estimate": true, "confidence": "low", "contributors": [ … ], "unknownFor": [] },
{ "factor": "fat", "kind": "amount_per_100g", "unit": "g", "status": "known", "value": 7.46,
"knownPortionGrams": 250, "confidence": "high", "contributors": [ … ], "unknownFor": [] },
{ "factor": "caffeine", "kind": "amount_per_100g", "unit": "mg", "status": "unknown",
"contributors": [], "unknownFor": [ { "name": "Tomato, roma", … }, { "name": "Cream, heavy", … } ] },
…
],
"interactions": []
}