Quickstart
Get an API key, find a Food, and evaluate your first Combination in about five minutes.
1. Get an API key
Sign up in the Developer Console. There is no approval step. Accept the terms of use, and your first API key is shown once, on the next page. Copy it somewhere safe.
Every example in these docs reads two environment variables:
export ACIDEX_URL="https://api.acidex.com" # the Platform's address
export ACIDEX_API_KEY="acx_…" # the key you just copied
New accounts start on the Free Plan, which includes 1,000 requests a month.
2. Find a Food
Search the catalogue by name. Partial words and common alternative names both work: tom finds tomatoes, and san marzano finds them too. The best match comes first.
curl "$ACIDEX_URL/v1/foods?q=tomato%20roma" \
-H "Authorization: Bearer $ACIDEX_API_KEY"
{
"foods": [
{
"id": "food_3bab6195decc17a9",
"name": "Tomato, roma",
"category": "vegetable",
"preparations": [{ "id": "roasted", "name": "Roasted" }, { "id": "grilled", "name": "Grilled" }, …]
},
{ "id": "food_0873dea4018cddec", "name": "Tomatoes, raw", … },
…
],
"page": 1,
"pageSize": 20,
"nextPage": 2
}
The catalogue holds about 13,600 Foods from three USDA FoodData Central datasets, so the same food can appear once for each dataset that lists it. See What the catalogue holds.
Food IDs are stable, so store them alongside your own recipes. The Food IDs in these docs are examples. Use the IDs the catalogue returns to you. You can also look IDs up in the Console’s catalogue search, which doesn’t count against your Plan.
3. Read its Trigger Profile
curl "$ACIDEX_URL/v1/foods/food_3bab6195decc17a9" \
-H "Authorization: Bearer $ACIDEX_API_KEY"
The response lists all eight Trigger Factors. Each one is known, with a value, its source and a confidence level, or unknown. For “Tomato, roma”, Acidity (pH 4.6, from the FDA pH table) and Fat (0.425 g per 100 g, from USDA Foundation Foods) are known, and the other six are unknown. Unknown is never reported as zero. See Foods and search for the full shape.
4. Evaluate a Combination
Send the Foods in a dish, each with a Portion in grams and an optional Preparation:
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 }
]
}'
You get back one Trigger Profile for the whole Combination, weighted by Portion, and any Interactions between its Foods. Read Evaluating a Combination to learn how each value is worked out.
5. Show it to your users
Before you put Platform data in front of people, read Approved Wording and attribution. The terms of use require you to show the Approved Wording and attribution text the API gives you, unchanged.