Estimate Calories From Any Meal in One API Call
Published July 17, 2026
A calorie estimation API turns what a user ate — a food name or a list of ingredients — into estimated calories and macros. It is the layer behind "search what you ate and get calories" features, saving users from manual lookups. This guide shows how estimation works with the Calorie API — 1M+ foods and a recipe endpoint on a free tier — and how to keep the numbers accurate.
Two Ways to Estimate Calories
- By food name: search a food and read its per-serving calories. Fast, best for single items.
- By ingredient list: resolve each ingredient to a food ID via search, then total the calories across all ingredients and quantities. Best for meals and recipes, and far more accurate than guessing a whole-dish number.
Estimate a Meal From Ingredients
Resolve each ingredient to a food_id with search, then post the IDs and gram weights:
curl -X POST "https://api.calorieapi.com/api/v1/public/calc/recipe" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"servings": 1,
"ingredients": [
{"food_id": 78003, "grams": 220},
{"food_id": 23572, "grams": 150},
{"food_id": 11549, "grams": 120}
]
}'
The response returns total and per_serving calories and macros plus ingredients_resolved, so users can see where the calories come from.
Estimate a Single Food by Name
curl "https://api.calorieapi.com/api/v1/search/foods?q=cheeseburger" \
-H "X-API-Key: YOUR_API_KEY"
Keeping Estimates Accurate
| Practice | Why |
|---|---|
| Ask for gram weights | Portions drive accuracy more than food choice |
| Prefer ingredient totals | Whole-dish guesses vary wildly |
| Use verified/generic foods | Consistent baseline vs branded self-reports |
| Show the breakdown | Lets users correct a wrong portion |
Accuracy comes from good portion data and a broad food database — see food API calorie data accuracy.
Start Building
- Get a free API key
- Related: Calories by ingredients calculator API
- Related: Portion size scaler API
Frequently Asked Questions
What is a calorie estimation API?
It is an API that turns a food name or ingredient list into estimated calories and macros, powering features where users search what they ate instead of looking up each food manually.
How accurate is calorie estimation from an API?
Accuracy depends mostly on portion data. Totaling calories from an ingredient list with gram weights is far more accurate than guessing a single number for a whole dish.
Can I estimate calories from an ingredient list?
Yes. You resolve each ingredient to a food ID via search, then a recipe endpoint accepts those IDs with gram weights and returns total and per-serving calories and macros, which is the most reliable estimation method.
Is there a free calorie estimation API?
Yes. The Calorie API includes search and recipe-calculation endpoints on a free tier of 1,000 requests per month with no credit card.
