Nutrition APIs compared: where the calorie numbers actually come from
USDA, Edamam, Nutritionix, Spoonacular, Open Food Facts and Tiny Plates, and why their numbers don't agree.
By Chris Artmann ·
Every nutrition API gives you a number like "475 kcal". It looks precise. It almost never is. And two APIs can give you very different numbers for the same dish, because they got them from different places.
If you're building a fitness app, a diet tracker or a meal planner, it helps to know where those numbers come from. So let's follow them back to the source. Then we'll compare the main APIs, including ours, and say what each one is good for.
Where the numbers come from
Almost every calorie figure you'll ever see comes from one of three places.
The first is lab analysis. Someone took a food, like raw broccoli or cooked rice, and measured what's in it. National food tables are built this way. In the US that's the USDA's FoodData Central. Many countries have their own, like the UK's CoFID or Sweden's food database from Livsmedelsverket. These are the gold standard for basic foods. They're also where most other APIs get their data in the end.
The second is package labels. A manufacturer prints a nutrition panel on the box, and a database copies it. The USDA's branded foods data works like this, and so does Open Food Facts, where volunteers type in labels. Labels are good, but they're rounded and they're allowed some wiggle room by law.
The third is calculation. Take a recipe, match each ingredient line to a food in one of the tables above, add it all up and divide by servings. This is how most recipe nutrition is made, whether a website does it or an API does it for you.
That third one is where things get fuzzy.
Take "2 pounds chicken breast". Raw or cooked? Cooked chicken has lost water, so 100 g of it has more calories than 100 g raw. Take "1 medium onion". How big is medium? Take "salt to taste". How much is that, really? Take "serve with rice or naan". Is that in the number or not? And "serves 4 to 6" means the per-serving number can move by half depending on who picked 4 or 6.
None of these have a right answer. Every calculator makes choices. So when two APIs disagree by 20% on a lasagne, neither is lying. They just chose differently.
Here's a real example. Three chicken tikka masala recipes from three sites publish 249 kcal, 475 kcal and 738 kcal a serving. Same dish name. One is a lighter recipe with a 3/4-cup serving. One is made with heavy cream and butter. The third has 80 g of carbs a serving, so it likely counts the rice on the plate. All three numbers are "right" for what they describe, but you can't compare them, because each site worked its label out its own way.
The APIs, side by side
| API | Where its numbers come from | Free option | Best for |
|---|---|---|---|
| USDA FoodData Central | Lab analysis, survey data and branded labels | Yes. Public domain, 1,000 requests an hour | Single foods, building your own calculator |
| Edamam Nutrition Analysis | Calculated from your ingredient lines against its own food database | No. From $29 a month, 10-day trial on the smallest plan | Analysing recipes users type in |
| Nutritionix | Its own database of common, branded and restaurant foods | No public free tier. Trial on request | Food logging from plain-language text |
| Spoonacular | Calculated from ingredients with its own algorithm | Yes. 50 points a day, backlink required | Recipes and nutrition from one API |
| Open Food Facts | Package labels, entered by volunteers | Yes. ODbL, no key | Barcodes and packaged food |
| FatSecret Platform | Its own food database | Yes. Basic tier, 5,000 calls a day, US only | Food logging, a big US food list |
| Tiny Plates | Calculated from each recipe's ingredients, the same way for every recipe | Yes. 50 requests a day | Recipes with nutrition, and filtering by it |
Prices and limits were checked in October 2026. They change, so check each pricing page before you commit.
USDA FoodData Central is where we'd start if you want to understand the numbers. It's free, it's public domain under CC0, and it's the source many other APIs build on. It has a few kinds of data. Foundation Foods and SR Legacy are analysed basic foods. FNDDS is foods as Americans actually eat them, like "chicken curry". Branded Foods is label data from manufacturers. You need a free data.gov key, and the default limit is 1,000 requests an hour.
curl 'https://api.nal.usda.gov/fdc/v1/foods/search?api_key=DEMO_KEY&query=chicken%20breast%20raw'
What it doesn't do is read a recipe. If you want nutrition for "2 cups flour, 3 eggs", you parse the lines, pick the right food for each, convert cups to grams, and add it up. That's real work. We wrote about the first step in parsing ingredient lines.
Edamam Nutrition Analysis does that work for you. Send ingredient lines and it sends back calories, macros and micronutrients, line by line. It's good at it. But there's no free plan. The smallest plan is $29 a month with a 10-day trial. Attribution is required on every plan. And watch the caching rules: on the smallest plan you can't cache results at all, and the next plan up only allows a few figures like calories and protein.
Nutritionix is built for food logging. Its natural-language search turns "a big mac and a coke" into nutrition, and it knows a lot of restaurant and branded items. Its developer site now says it can't keep a public free tier going, so you'll need to ask for a trial. It's a strong pick for a calorie tracker if you can pay for it.
Spoonacular works out recipe nutrition from the ingredients, using its own food data. The nice part is you get recipes and nutrition from one API, and it can analyse recipes you send it too. The free plan is 50 points a day with a backlink. Paid plans start at $29 a month. Note the caching rule: most data can only be kept for an hour. More in our Spoonacular alternatives post.
Open Food Facts is the one for anything with a barcode. The nutrition comes straight off the package, typed in by volunteers. It's free and open under the ODbL, so you share alike and give credit. Data quality varies by product, since it's crowdsourced. Popular products are usually well checked. Obscure ones can have gaps.
FatSecret has a free Basic tier with 5,000 calls a day, US foods only, and attribution required. Startups, non-profits and students can apply for a bigger free plan.
What Tiny Plates gives you
Tiny Plates is a recipe API, and every recipe comes with its nutrition. We work it out from the recipe's ingredients against USDA FoodData Central and the Swedish Food Agency's database, the same way for every recipe. So the three tikka masalas above become numbers you can actually compare, and a recipe whose site never published a label gets nutrition too.
You get the figures three ways. perServing is one plate, perRecipe is the whole pot, and per100g is the fair way to compare dishes with different serving sizes. Calories, protein, fat, saturated fat, carbohydrates, sugar, fiber, salt, sodium and cholesterol have their own keys, and vitamins and minerals sit under micronutrients.
"nutrition": {
"incomplete": [],
"servings": 8,
"perServing": {
"calories": { "value": 201, "unit": "kcal" },
"protein": { "value": 5.6, "unit": "g" },
"fat": { "value": 7.4, "unit": "g" },
"fiber": { "value": 3.3, "unit": "g" },
"sodium": { "value": 76, "unit": "mg" },
"sugar": { "value": 16.9, "unit": "g" }
}
}
The bigger difference is filtering. Search, popular recipes, pantry matching and similar recipes all take a minimum and a maximum of each of those ten nutrients, per serving, on every plan. So "curry with at least 30 g of protein and under 600 calories" is one request:
curl 'https://api.tinyplates.dev/search?query=curry&minProtein=30&maxCalories=600' \
-H 'Authorization: Bearer rd_your_api_key'
There are presets too: high-protein, high-fiber, low-calorie and low-sodium. The MCP tools take the same filters, so an agent can find "a high-protein vegetarian lunch" for your user.
If a nutrient is listed in incomplete, read it as "at least this much". A recipe that doesn't say how many servings it makes has no perServing, and the filters leave it out, so every result really is under your limit. There's more in the nutrition launch post and the filtering docs.
So when is Tiny Plates the right pick? When you want recipes and their nutrition from one API, and you want to filter by it without paying first. If you need to analyse recipes your users type in, Edamam or Spoonacular do that. For barcodes, use Open Food Facts. For single foods, go straight to USDA.
How accurate is accurate enough?
Even lab values are averages. A tomato in July isn't a tomato in January. Labels in the US and the EU are allowed to be off by a fair margin. Being within 10 to 20% of the "real" number is normal for a home-cooked meal, whoever does the maths.
For most apps that's fine. A meal planner that says "about 500 kcal" is helping. Someone choosing between a 250 and a 740 kcal curry gets a useful answer either way. Round the number when you show it, and it reads the way it should.
For anything medical, like diabetes, kidney disease or eating disorders, a general API isn't enough on its own. Keep a person in the loop. It's the same thing we say about allergen data.
If recipes with nutrition and nutrition filters fit what you're building, grab a free Tiny Plates key and try the search above.