HeadlinesBriefing favicon HeadlinesBriefing.com

Counting Calories for Desi Recipes with AI

DEV Community •
×

A developer in the UK automated calorie counting for Pakistani recipes from Food Fusion's YouTube channel. After starting with the Nutracheck app to manage cholesterol, she found manually logging each ingredient from video descriptions tedious. She built a Python script using the YouTube Data API to extract ingredient lists from video descriptions.

The process stalled until she integrated Google Gemini to sanitize the mixed Urdu-English ingredient text. A refined prompt standardized quantities, converted units, and extracted only English names for the Nutritionix API. This created a clean, consistent input for calculating total calories per dish, solving a key data formatting hurdle.

The final workflow calculates a dish's total calories by summing each ingredient's data from Nutritionix. While effective for Food Fusion videos, the author notes limitations like database gaps for items like 'chicken powder.' The project demonstrates practical prompt engineering for automating a common, time-consuming task for home cooks.