There's No Food.com Recipe Nutrition API — Here's the Better Fix
Published July 17, 2026
Developers search for a Food.com recipe nutrition API to pull calories and protein for recipes by ID. The reality: Food.com does not publish an official, supported public nutrition API. Undocumented internal endpoints and scraping the proteinContent or calories fields off a recipe page break the moment the site changes. The durable approach is to compute nutrition from the ingredient list using a nutrition API you control.
Why Scraping Food.com Is Fragile
- No stable contract: internal recipe endpoints (rid-based JSON, GraphQL) are undocumented and can change without notice.
- Terms of service: scraping recipe data may violate the site's terms.
- Incomplete fields: per-recipe nutrition may be missing, rounded, or absent for user-submitted recipes.
The Reliable Pattern: Compute From Ingredients
Instead of trusting one scraped number, resolve each ingredient to a stable food ID via search, then send those IDs and gram weights to a nutrition API and let it total the macros. You get calories and protein you can defend and recompute.
# 1) Resolve each ingredient to a food_id
curl "https://api.calorieapi.com/api/v1/search/foods?q=chicken+breast" \
-H "X-API-Key: YOUR_API_KEY" # results[0].id -> 90121
# 2) Total the recipe from resolved food_ids + 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": 90121, "grams": 300},
{"food_id": 41240, "grams": 14},
{"food_id": 78003, "grams": 200}
]
}'
Example Response
{
"servings": 1,
"total": { "calories": 812, "protein_g": 71.4, "carbohydrates_g": 54.2, "fat_g": 24.1, "fiber_g": 1.2, "sugars_g": 0.3 },
"per_serving": { "calories": 812, "protein_g": 71.4, "carbohydrates_g": 54.2, "fat_g": 24.1, "fiber_g": 1.2, "sugars_g": 0.3 },
"ingredients_resolved": 3
}
Now the protein value is reproducible and independent of any one recipe site.
Scraped Field vs Computed Nutrition
| Approach | Reliability | Maintenance |
|---|---|---|
Scrape Food.com proteinContent | Breaks on site changes | High |
| Undocumented rid/GraphQL endpoint | No stability guarantee | High |
| Compute from ingredients via API | Stable, reproducible | Low |
Start Building
Frequently Asked Questions
Does Food.com have a nutrition API?
Food.com does not publish an official, supported public nutrition API. Some internal rid-based JSON or GraphQL endpoints exist, but they are undocumented and can change or break without notice.
Can I scrape recipe protein from Food.com?
You can read fields like proteinContent from a recipe page, but scraping is fragile, may violate the site's terms, and often has missing or rounded values. Computing nutrition from ingredients is more reliable.
How do I get reliable recipe nutrition data?
Send the recipe's ingredients and quantities to a nutrition API's recipe endpoint. It totals calories and macros from a maintained food database, so the values are reproducible and independent of any recipe site.
Is there an API that totals recipe nutrition?
Yes. You resolve each ingredient to a food ID via search, then the Calorie API recipe endpoint accepts those food IDs with gram weights and returns total and per-serving calories, protein, carbs, and fat.
