Zum Hauptinhalt springen

API Reference

This page provides a complete reference for all field values, enumerations, and response structures in the Eaternity API.

Query Parameters

These parameters can be added to most API endpoints to control the response:

full-resource

ValueDefaultDescription
trueNoReturns complete JSON response with all fields
falseYesReturns minimal response (saves bandwidth)

When to use: Set full-resource=true when you need all calculated values. Use false (default) for faster responses when you only need the core metrics (rating, co2-value).

Fields included only with full-resource=true:

  • Detailed ingredient breakdowns
  • All nutrient values
  • Improvement percentages
  • Reduction values

indicators

ValueDefaultDescription
trueNoIncludes VitaScore and environmental indicators
falseYesExcludes additional indicators

When to use: Set indicators=true when you need nutritional scoring (VitaScore) or environmental metrics (water footprint, rainforest, animal welfare, seasonality, local sourcing).

Additional fields when indicators=true:

  • vita-score-points, vita-score-rating, vita-score-award
  • water-footprint-rating, scarce-water-liters
  • rainforest-label, rainforest-rating
  • animal-treatment-label, animal-treatment-rating
  • season-label, season-rating
  • local-label, local-rating

nutrient-values

ValueDefaultDescription
trueNoIncludes nutrient-values-estimated-per-specified-amount for each ingredient
falseYesExcludes nutrient value estimates

ingredients-declaration

ValueDefaultDescription
trueNoIncludes parsed ingredients-declaration data for each ingredient
falseYesExcludes ingredient declaration data

return-uids

ValueDefaultDescription
trueNoIncludes internal uid fields in response for recipes and ingredients
falseYesExcludes internal UIDs

transient (query parameter)

ValueDefaultDescription
trueNoRecipe is calculated but not permanently stored — it will not appear in monthly reports or statistics.
falseYesRecipe is saved normally and included in reports
transient has two meanings

As a query parameter, transient=true means the recipe is calculated but not permanently stored. As a body field in batch requests, "transient": true means the recipe is saved but excluded from the monthly summary. Both are valid for sub-recipes, test submissions, or any recipe you do not want included in reports.


Ingredient Field Values

transport

How the ingredient is transported from origin to the kitchen.

ValueDescriptionCO₂ Impact
groundRoad, rail, or ship transportLower
airAir freightHigher (10-50x ground)

Default: ground

production

The production method used to grow or produce the ingredient.

ValueDescription
standardConventional farming/production
greenhouseGrown in heated greenhouse
organicCertified organic production
fair-tradeFair trade certified
farmSmall-scale farm production
wild-caughtWild-caught (seafood)
sustainable-fishSustainably certified fishing

Default: standard

processing

The level of processing applied to the ingredient.

ValueDescription
rawUnprocessed, whole ingredient
unbonedWith bones (meat/fish)
bonedBones removed
skinnedSkin removed
beheadedHead removed (fish)
filletFilleted (meat/fish)
cutCut into pieces
boiledPre-cooked by boiling
peeledOuter layer removed

Default: raw

conservation

How the ingredient is preserved/stored.

ValueDescriptionEnergy Impact
freshNo preservation, short shelf lifeLowest
frozenFrozen storageHigher (cold chain)
driedDehydratedLow
conservedPreserved (salt, sugar, etc.)Low
cannedSealed in cansMedium
boiled-downReduced/concentratedMedium

Default: fresh

packaging

The packaging material used.

ValueDescription
noneNo packaging (bulk)
plasticPlastic packaging
paperPaper/cardboard
petPET plastic bottles
tinTin cans
aluAluminum
glasGlass containers
cardboardCardboard boxes
tetraTetra Pak cartons

Default: none

unit

The measurement unit for the ingredient amount.

ValueDescription
gramWeight in grams
literVolume in liters

Default: gram

Multi-Value Fields

The origin, transport, production, processing, conservation, and packaging fields accept comma-separated values when multiple apply. For example: "production": "organic, fair-trade".


Response Fields

CO₂ Metrics

FieldTypeDescription
co2-valueintegerCO₂ emissions in grams CO₂e per serving
ratingstringClimate rating from A (best) to E (worst)
eaternity-awardbooleantrue if recipe is climate-friendly (rating A)
co2-value-improvement-percentagenumberPercentage better than average for this food category
co2-value-reduction-valuenumberGrams of CO₂ saved compared to category average

Rating Scale

RatingCO₂ per PortionDescription
A≤ 400gExcellent - Very low environmental impact
B401-600gGood - Low environmental impact
C601-1000gAverage - Moderate environmental impact
D1001-1500gBelow Average - High environmental impact
E> 1500gPoor - Very high environmental impact

Ingredient Response Fields

These fields are returned for each ingredient when full-resource=true:

FieldTypeDescription
ratingstringCO₂ rating for this ingredient (A-E). A is best, E is worst.
co2-valueintegerAbsolute CO₂ emissions for the ingredient in grams for the specified amount
co2-value-improvement-percentagefloatComparison of this ingredient's CO₂ footprint per food unit to the average
co2-value-reduction-valuefloatGrams of CO₂ saved compared to an average product providing the same nutritional value
bar-chartnumberPercentage contribution of this ingredient to total recipe CO₂ (0-100)
foodUnitnumberNutritional density value used for CO₂ per nutrition calculations
nutrient-values-estimated-per-specified-amountobjectBackend-estimated nutrient values for the specified amount (when nutrient-values=true is set)

foodUnit Explained

The foodUnit represents the nutritional value of a food item, used to calculate CO₂ emissions per unit of nutrition rather than per gram. This ensures fair comparison between foods with different caloric densities.


Vita Score

The Vita Score rates nutritional quality on an A-E scale based on health risk factors.

Core Fields

FieldTypeDescription
vita-score-pointsnumberTotal points (lower is healthier)
vita-score-ratingstringRating A (healthiest) to E
vita-score-awardbooleantrue if recipe achieves A or B rating
energy-kcalsnumberTotal calories
nutrition-labelbooleantrue if nutritionally balanced

Risk Factor Fields

Each risk factor has two fields: {factor}-risk-factor-amount-gram (amount) and {factor}-risk-factor-points (health impact points).

Risk FactorHealthy DirectionDescription
fruitMore is betterFruit content
vegetableMore is betterVegetable content
wholegrainMore is betterWhole grain content
nuts-seedsMore is betterNuts and seeds
milkModerateDairy products
processed-meatLess is betterProcessed meat products
red-meatLess is betterRed meat content
saltLess is betterSodium content

Macronutrient Risk Points

FieldDescription
high-in-energy-risk-factor-pointsPoints for high calorie density
high-in-fat-risk-factor-pointsPoints for high fat content
low-in-fat-risk-factor-pointsPoints for insufficient fat
high-in-protein-risk-factor-pointsPoints for excess protein
low-in-protein-risk-factor-pointsPoints for insufficient protein

Environmental Indicators

Additional environmental impact metrics beyond CO₂. Enable with indicators=true.

All calculations use Life Cycle Assessment (LCA) methodology following ISO 14040/14044 standards, with peer-reviewed scientific data covering the complete supply chain from farm to plate.

CO₂ Interpretation

CO₂ values measure total greenhouse gas emissions in grams of CO₂-equivalent, including CO₂, methane (CH₄, 28x more potent), and nitrous oxide (N₂O, 265x more potent).

CO₂ per PortionCategoryEnvironmental Impact
< 400gExcellentVery low climate impact
400-600gGoodLow climate impact
600-1000gAverageModerate climate impact
1000-1500gBelow AverageHigh climate impact
> 1500gPoorVery high climate impact

Major emission sources: Agriculture (40-70%), Animal Production (20-50%), Transport (5-15%), Processing (5-10%), Storage (2-5%).

Water Footprint

FieldTypeDescription
scarce-water-litersnumberLiters of scarce water used
water-footprint-ratingstringA-E rating for water use
water-footprint-awardbooleantrue for excellent water efficiency
water-footprint-improvement-percentagenumber% better than average
water-footprint-reduction-valuenumberLiters saved vs average
Water per PortionCategory
< 100LVery low
100-500LLow
500-1000LModerate
1000-2000LHigh
> 2000LVery high

Animal Treatment

Assessment of animal welfare standards for animal-derived ingredients.

RatingDescriptionStandards
excellentHighest welfare standardsFree-range, organic, certified humane
goodAbove-average welfareCage-free, enriched housing
mediumStandard practicesConventional farming
poorBelow standard welfareIntensive/factory farming
very-poorWelfare concernsCramped conditions, no outdoor access
not-applicableNo animal productsVegan/vegetarian items

Rainforest Impact

Risk of deforestation associated with ingredients.

RatingRisk LevelCommon Ingredients
very-lowNegligible riskLocal vegetables, grains
lowMinimal riskCertified sustainable palm oil, cocoa
mediumModerate riskSome tropical fruits, nuts
highSignificant riskUncertified palm oil, beef from Brazil
very-highSevere riskSoy from deforested areas

Biodiversity Impact

Effect on ecosystems and species diversity.

RatingImpactContributing Factors
very-lowMinimal impactOrganic, diverse cropping, habitat-friendly
lowLow impactSustainable practices, crop rotation
mediumModerate impactConventional monoculture
highSignificant impactPesticide-intensive, habitat destruction
very-highSevere impactLarge-scale monoculture, deforestation

Energy Consumption

Total energy use throughout the supply chain, measured in Megajoules (MJ) per portion.

Energy per PortionCategory
< 1 MJVery low
1-3 MJLow
3-6 MJModerate
6-10 MJHigh
> 10 MJVery high

Soil Impact

Effect on soil health and degradation.

RatingImpactPractices
very-lowSoil buildingRegenerative agriculture, no-till
lowMinimal degradationOrganic, cover crops
mediumSome degradationConventional farming, rotation
highSignificant degradationIntensive monoculture, heavy tillage
very-highSevere degradationErosion-prone practices

Sustainability Labels

Each indicator has a {name}-label (boolean) and {name}-rating (A-E):

IndicatorLabel MeaningWhat It Measures
rainforestDeforestation-freeAvoids rainforest destruction
animal-treatmentWelfare certifiedMeets animal welfare standards
seasonIn seasonIngredient is in season locally
localLocally producedProduced within region

Nutrient Values

The nutrient-values object supports 42 nutritional fields. All are optional - provide what you have.

Basic Macronutrients

FieldUnitDescription
energy-kcalkcalEnergy in kilocalories
energy-kjoulekJEnergy in kilojoules
fat-gramgTotal fat
saturated-fat-gramgSaturated fat
monounsaturated-fat-milligrammgMonounsaturated fat
polyunsaturated-fat-milligrammgPolyunsaturated fat
cholesterol-milligrammgCholesterol
carbohydrates-gramgTotal carbohydrates
sucrose-gramgSugars
protein-gramgProtein
fibers-gramgDietary fiber
water-gramgWater content
sodium-chloride-gramgSalt
alcohol-volume-percent%Alcohol content

Vitamins

FieldUnitVitamin
vitamine-a1-microgrammcgVitamin A (retinol)
vitamine-b1-microgrammcgVitamin B1 (thiamine)
vitamine-b2-microgrammcgVitamin B2 (riboflavin)
vitamine-b6-microgrammcgVitamin B6 (pyridoxine)
vitamine-b12-microgrammcgVitamin B12 (cobalamin)
vitamine-c-milligrammgVitamin C
vitamine-d-microgrammcgVitamin D
vitamine-e-microgrammcgVitamin E (tocopherol)
vitamine-h-microgrammcgVitamin H (biotin)
vitamine-k-microgrammcgVitamin K
beta-carotene-milligrammgBeta-carotene
niacin-milligrammgNiacin (B3)
pantohen-milligrammgPantothenic acid (B5)
folic-acid-microgrammcgFolic acid (B9)

Minerals

FieldUnitMineral
sodium-milligrammgSodium
potassium-milligrammgPotassium
chlorine-milligrammgChlorine
calcium-milligrammgCalcium
magnesium-milligrammgMagnesium
phosphorus-milligrammgPhosphorus
iron-milligrammgIron
zinc-microgrammcgZinc
copper-microgrammcgCopper
manganese-microgrammcgManganese
flouride-microgrammcgFluoride
iodine-microgrammcgIodine

Other Compounds

FieldUnitDescription
purine-milligrammgPurine content
uric-acid-milligrammgUric acid

Recipe Special Fields

transient

ValueDescription
trueRecipe excluded from monthly summaries and reports
falseRecipe included in all statistics (default)

Use cases: Set transient: true for sub-recipes (sauces, stocks, bases) that are components of other recipes, or for any recipe you do not want included in reports. Transient recipes only count toward statistics when used as ingredients in non-transient recipes.

type (Ingredient)

ValueDescription
conceptual-ingredientsA regular ingredient
recipesReferences another recipe as a sub-recipe

Default: conceptual-ingredients


Data Sources

Eaternity's calculations use data from:

Environmental Databases

  • ecoinvent: Life cycle inventory database
  • AGRIBALYSE: French agricultural LCA database
  • WFLDB: Water Footprint Database
  • Eaternity Database: Proprietary ingredient database with 50,000+ entries

Nutritional Databases

  • USDA FoodData Central: US nutrient database
  • Swiss Food Composition Database: Swiss nutrient data
  • EuroFIR: European food information resource

Certifications & Standards

  • ISO 14040/14044: LCA methodology
  • ISO 14046: Water footprint
  • ISO 14067: Carbon footprint of products
  • PEF (Product Environmental Footprint): EU methodology