Back to Dashboard

Food and Recipe Scoring Algorithm Reference

Part 1: The Average Score (1-8)

The Average Score provides a general nutritional rating for a food, independent of any user. It starts with a baseline score of 5 and is adjusted based on the following rules, applied to the food’s per-100g nutritional values. The final result is capped between 1 and 8.

Nutrient & Condition Points Rationale
Starting Score5A neutral baseline.
Fibre > 6g+2Excellent source of fiber.
Fibre > 3g+1Good source of fiber.
Protein > 20g+2Excellent source of protein.
Protein > 10g+1Good source of protein.
Sugars > 15g-2High in sugar.
Sugars > 5g-1Medium sugar content.
Saturated Fat > 5g-2High in saturated fat.
Saturated Fat > 1.5g-1Medium saturated fat.
Salt > 1.5g-2High in salt.
Salt > 0.3g-1Medium salt content.

Part 2: The Personalization Layer

This layer takes the Average Score and applies a series of adjustments based on the specific user’s health profile (“God JSON”). This generates the Adjustment Value (e.g., +2, -3) shown in the black badge.

A. Major Penalties (Deal-Breakers)

ConditionPoints
User has "celiac_status": "Severe" AND food has "gluten": true-4
User has "lactose_status": "High" AND food has "lactose": true-3
User has "ibs_status": "Severe" AND food has "fodmaps": true-2

B. Weighted Health Risk Penalties

ConditionPoints
User has "bp_high": "Yes" AND food Salt > 0.3g/100g-1
User has "diabetes_status": "High" AND food Sugars > 5g/100g-1

C. Goal-Oriented Bonuses

ConditionPoints
User has "weight_objective": "loss" AND food Fibre > 6g/100g+1
User has "weight_objective": "loss" AND food Protein > 15g/100g+1
User has "muscle_objective": "1" AND food Protein > 15g/100g+1

D. Targeted Nutrient Bonuses

ConditionPoints
User’s protocol includes “Potassium” AND food Potassium ≥ 250mg/100g+1
User’s protocol includes “Magnesium” AND food Magnesium ≥ 25mg/100g+1

Final Score Formula: The final “Match Score” shown to the user is simply: (Average Score + Total Adjustment Value), capped between 1 and 10.

Nutrient Level Definitions (per 100g)

This section details the specific thresholds used to determine if a nutrient level is considered Low, Medium, or High. These values drive the Traffic Light colors and the points awarded in the scoring algorithm.

Official UK Traffic Light System

Nutrient Low (Green) Medium (Amber) High (Red)
Fat (Total) ≤ 3.0g > 3.0g to ≤ 17.5g > 17.5g
Saturated Fat ≤ 1.5g > 1.5g to ≤ 5.0g > 5.0g
Sugars ≤ 5.0g > 5.0g to ≤ 22.5g > 22.5g
Salt ≤ 0.3g > 0.3g to ≤ 1.5g > 1.5g

Internal Scoring Thresholds

Nutrient Low (0 points) Good Source (+1 point) High Source (+2 points)
Protein ≤ 10g > 10g to ≤ 20g > 20g
Fiber ≤ 3g > 3g to ≤ 6g > 6g

Micronutrient “Source Of” Thresholds

These values define the minimum amount needed per 100g for a food to be considered a “source of” that micronutrient, based on providing 15% of the UK/EU Nutrient Reference Value (NRV). The personalization algorithm uses these as a baseline.

Nutrient “Source Of” Threshold Basis (15% of NRV)
Iron> 2.1 mgNRV = 14mg
Magnesium> 56 mgNRV = 375mg
Potassium> 300 mgNRV = 2000mg
Vitamin C> 12 mgNRV = 80mg
Vitamin D> 0.75 mcgNRV = 5mcg
Vitamin B12> 0.37 mcgNRV = 2.5mcg

Note on Energy & Carbohydrates: Energy (kcal) and Carbohydrates (g) are not included in the threshold tables as their values are highly contextual. A “high” value is not inherently negative and depends entirely on the user’s daily energy needs, goals, and activity level.