Nutritionix API

⭐ Beginner's Pick Health / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

Nutritionix gives you access to the world's largest verified nutrition database, allowing you to look up calories, macronutrients, and micronutrients for branded and restaurant foods. It supports natural language queries like "2 eggs and toast" making it easy to build calorie trackers and diet apps. An API key is required, available after registering on their developer portal.

💡

Beginner Tip

Use the /v2/natural/nutrients endpoint with plain English food descriptions — you do not need to search for exact product names, which makes integration much faster.

Available Data

recipe name and ingredients
nutritional values
calorie count
serving size
preparation time

Example Response

JSON Response
{
  "recipe": "Chicken Stir Fry",
  "calories": 380,
  "protein_g": 32,
  "carbs_g": 28,
  "fat_g": 14,
  "ingredients": [
    "chicken breast",
    "bell pepper",
    "soy sauce",
    "garlic"
  ],
  "prep_time_minutes": 20
}

Field Reference

foods List of food items parsed from the natural language query.
food_name Standardized name of the identified food item.
nf_calories Total calorie count for the specified serving size.
nf_total_fat Total fat content in grams.
nf_total_carbohydrate Total carbohydrate content in grams.
nf_protein Protein content in grams.

Implementation Example

const url = "https://developer.nutritionix.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Missing or invalid x-app-id or x-app-key headers
Register at developer.nutritionix.com to get your App ID and API Key, then include both as request headers.
Food item not recognized The natural language query uses brand names not in the generic database
Try the /v2/search/instant endpoint for branded food search, or simplify the description.
429 Too Many Requests Free tier has a daily request limit
Cache results for common queries locally and upgrade to a paid plan if your usage is high.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Health
Difficulty Intermediate
Verified: 2026-04-04

Recipes Using Nutritionix

Build something with this API. Each recipe includes step-by-step instructions and code outlines.

Similar APIs

View All →