All posts
guide data

Understanding the Nutrition Data

A deep dive into our data sources, nutrient coverage, and how to work with 40+ nutrients per product.

updated July 24, 2026 FoodBase Team 3 min read

Data sources

Our database merges two major open data sources into a unified, normalized format:

Open Food Facts (4.1M products) — a community-maintained, global database with strong European coverage. Products include barcodes, multilingual names/ingredients, Nutri-Score grades, NOVA classification, allergen data, and images. Licensed under ODbL.

USDA FoodData Central (2.0M products) — the United States Department of Agriculture’s comprehensive food composition database. Includes lab-verified nutrient values for branded products, foundation foods, and legacy reference foods. Public domain.

Together, that’s 6.1 million unique food products — more than any single source provides alone.

How we merge the data

When a product exists in both databases (matched by barcode), we prioritize USDA nutrient values (lab-verified) and supplement with Open Food Facts metadata (images, allergens, Nutri-Score, multilingual names). This gives you the best of both worlds: accurate nutrition data with rich product metadata.

Nutrient tiers

Not every product has every nutrient measured. We organize nutrients into tiers by data coverage:

Tier 1: Core macros (97%+ coverage)

Available for nearly every product in our database:

NutrientFieldUnit
Energyenergy_kcal, energy_kjkcal, kJ
Proteinproteins_gg
Carbohydratescarbs_gg
Fatfat_gg
Sugarssugars_gg
Saturated fatsaturated_fat_gg
Sodiumsodium_mgmg
Saltsalt_gg
Fiberfiber_gg

Tier 2: Common nutrients

Available for a large share of products — especially lab-verified entries — but far from all. Coverage varies by nutrient and keeps improving as sources update:

NutrientField
Cholesterolcholesterol_mg
Trans fattrans_fat_g
Calciumcalcium_mg
Ironiron_mg
Vitamin Cvitamin_c_mg
Potassiumpotassium_mg
Vitamin Avitamin_a_iu
Added sugarsadded_sugars_g

Tier 3: Extended nutrients

Available for a smaller subset, primarily lab-analyzed foods:

Vitamin D, magnesium, zinc, phosphorus, B vitamins (B1, B2, B6, B9, B12), niacin, pantothenic acid, manganese, copper, selenium, iodine, alcohol, starch, polyols, monounsaturated fat, polyunsaturated fat, omega-3 fatty acids, and omega-6 fatty acids.

Working with the data

All values are per 100g

Every nutrient value in our API is normalized to per 100g of product. To calculate per-serving values, multiply by the serving size:

const perServing = (valuePer100g, servingGrams) => {
  return Math.round(valuePer100g * (servingGrams / 100) * 10) / 10;
};

// Example: 42 kcal per 100g, 330ml can
perServing(42, 330); // → 138.6 kcal

Handling null values

The API returns null for nutrients that aren’t available for a given product. Your app should handle missing values gracefully — don’t assume every product has every field.

const calories = food.nutrition_summary?.energy_kcal ?? "N/A";

Multilingual support

Open Food Facts products include names and ingredients in multiple languages. The name field returns an array of {lang, text} objects:

[
  {"lang": "main", "text": "Coca-Cola"},
  {"lang": "fr", "text": "Coca-Cola en canette"},
  {"lang": "de", "text": "Coca-Cola"}
]

The name_default field always contains the primary language text for quick access without parsing the array.

Data quality

We apply several quality filters during our data pipeline:

  • Physical caps on nutrient values to filter garbage data (e.g., protein can’t exceed 100g per 100g)
  • Unit normalization to ensure consistent units across sources (g, mg, mcg, IU)
  • Deduplication by barcode with lab-verified values taking priority for overlapping products
  • Completeness scoring to help you filter by data quality when needed

Want to eyeball the data before writing code? Every product in the catalog has a public page in the product explorer showing exactly the fields the API returns — nutrition table, ingredients, allergens, scores and all.

Build it with FoodBase

6.1M products, 40+ nutrients and AI food analysis — free to start, no credit card.