I Tested 8 Nutrition APIs With the Same Query. Only 2 Returned Correct Data.
Source: Dev.to
Experiment Overview
Last week I ran a simple experiment: I sent the exact same query—“100 g skinless chicken breast”—to eight different nutrition APIs and compared their responses to the USDA FoodData Central database (the gold standard for nutrition data in the US).
USDA Reference
| Nutrient | USDA Value |
|---|---|
| Energy | 165 kcal |
| Protein | 31.02 g |
| Total Fat | 3.57 g |
| Saturated Fat | 1.01 g |
| Cholesterol | 85 mg |
Results
| API | Calories | Protein | Fat | Accuracy |
|---|---|---|---|---|
| API A | 165 | 31 g | 3.6 g | ✅ |
| API B | 239 | 27.3 g | 13.6 g | ❌ |
| API C | 165 | 31 g | 3.6 g | ✅ |
| API D | 195 | 29.5 g | 7.7 g | ❌ |
| API E | 172 | 26 g | 6.8 g | ❌ |
| API F | 148 | 31.5 g | 1.2 g | ❌ |
| API G | 165 | 30.9 g | 3.8 g | ⚠️ |
| Nutrition Tracker API | 165 | 31.02 g | 3.57 g | ✅ |
Only three of the eight APIs returned accurate data, and one of those (API G) showed slight rounding discrepancies.
Why Some APIs Were Inaccurate
- User‑submitted data without validation – Entries like “chicken breast” with skin, bones, or cooked in oil can become the default record.
- Outdated USDA data – One API was still using the 2015 USDA dataset; the USDA updates its database regularly, so old values become stale.
- Variant mismatches – “Chicken breast” can refer to raw vs. cooked, skinless vs. skin‑on, bone‑in vs. boneless, grilled vs. fried, etc. Some APIs returned the wrong variant entirely.
Real‑world impact
- A 50 kcal error per meal × 4 meals/day = 200 kcal/day → 1,400 kcal/week, roughly half a pound of weight difference.
- Protein misreporting (e.g., 27 g vs. 31 g) can affect clinical dosing (e.g., 1.2 g protein/kg body weight).
- Nutrition labels have legal requirements; incorrect data can lead to FDA compliance issues and liability.
Ensuring Accurate Data
Every food item in the Nutrition Tracker API maps directly to a USDA FoodData Central record, eliminating ambiguity.
{
"data": {
"fdcId": 331960,
"description": "Chicken, breast, meat only, raw"
}
}
When you search “chicken breast,” the NLP parser identifies:
- Base food (chicken breast)
- Cooking method (if specified)
- Portion/quantity (100 g, 1 cup, etc.)
and returns the exact USDA match.
Fat breakdown example
{
"Fat": {
"value": 3.57,
"unit": "g",
"breakdown": {
"saturated": { "value": 1.01, "unit": "g" },
"monounsaturated": { "value": 1.24, "unit": "g" },
"polyunsaturated": { "value": 0.77, "unit": "g" },
"trans": { "value": 0.02, "unit": "g" },
"other": { "value": 0.53, "unit": "g", "note": "Includes phospholipids and minor fatty acids" }
}
}
}
1.01 + 1.24 + 0.77 + 0.02 + 0.53 = 3.57 g ✓ – the math checks out.
Every response includes the USDA FDC ID, so you can verify the source yourself—no black boxes.
How to Verify Yourself
- Pick a food you know well.
- Send the same query to multiple nutrition APIs.
- Compare the results to USDA FoodData Central.
You’ll likely see the same patterns of discrepancy.
Test It Yourself
curl -X POST "https://nutrition-tracker-api.p.rapidapi.com/v1/calculate/natural" \
-H "X-RapidAPI-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "100g chicken breast"}'
Compare the response to the USDA FDC record. Every single value should match.
Links
- 🔬 [Verify on USDA FoodData Central]
- 🚀 [Try the API on RapidAPI]
- 📦 SDKs (Python, JavaScript, Java)
If you find a data discrepancy in any nutrition API, feel free to comment or open an issue. I’ll fix it or explain why the USDA value differs from expectations.