APIYard
Back to APIs
HealthAPI KeyFree tier

Nutritionix

Access nutrition facts for 800,000+ foods and restaurant menu items. Search by natural language like 'I ate two eggs and toast'.

Base URL

https://trackapi.nutritionix.com/v2
nutritioncaloriesfoodNLPrestaurant

Endpoints

POST/natural/nutrients

Get nutrition facts from natural language food input.

const response = await fetch("https://trackapi.nutritionix.com/v2/natural/nutrients", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "x-app-id": "YOUR_APP_ID",
  "x-app-key": "YOUR_API_KEY"
  },
  body: JSON.stringify({
  "query": "2 eggs and a slice of whole wheat toast"
})
});

const data = await response.json();
console.log(data);

Response Preview

{
  "foods": [
    { "food_name": "egg", "nf_calories": 143, "nf_protein": 12.6 },
    { "food_name": "whole wheat toast", "nf_calories": 81, "nf_protein": 3.4 }
  ]
}