Saltar al contenido principal

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

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


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 or B)
co2-value-improvement-percentagenumberPercentage better than average for this food category
co2-value-reduction-valuenumberGrams of CO₂ saved compared to category average

Rating Scale

RatingDescriptionTypical CO₂ Range
AExcellent - very low emissions< 500g CO₂e
BGood - below average emissions500-1000g CO₂e
CAverage emissions1000-1500g CO₂e
DAbove average emissions1500-2500g CO₂e
EHigh emissions> 2500g CO₂e

Ranges are approximate and vary by food category.

Ingredient Response Fields

FieldTypeDescription
bar-chartnumberPercentage contribution of this ingredient to total recipe CO₂ (0-100)
foodUnitnumberNutritional density value used for CO₂ per nutrition calculations

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₂.

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

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 (use for sub-recipes)
falseRecipe included in all statistics (default)

Use case: Set transient: true for sub-recipes (sauces, stocks, bases) that are components of other recipes. They 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