Skip to content

15 Jun 2026

Background

I have been using Nutritionix as my source for ingredient data for this website. However, Nutritionix has stopped giving free API access to the ingredient database.

Changes Completed

I have updated the site to use Edamam as the primary source for ingredient data.

  1. Edamam API Client (parser/Edamam_api_call.py): Created the new client that formats recipe ingredients and queries Edamam’s REST API, parsing the nested JSON structure (under ingredients[0]['parsed'][0]['nutrients']) to build the per-100g database rows.
  2. Switch Fallback Query (parser/nutrition_labels_creator.py): Updated the parser to call get_edamam_data() when missing ingredients are found, rendering the nutrition facts returned by Edamam.
  3. Recipe Demo Card (parser/ingredients_string_creator.py): Updated the recipe details footer to point to Edamam's interactive Nutrition Analysis API demo page, keeping the legacy Nutritionix link commented out for future reference.
  4. Global Hoisting (parser/nutrition_labels_creator.py): Modified nutrition_labels_creator.py to read the database CSV files (ingredient_nutrient_db.csv and unit_db.csv) at the module global scope, preventing repetitive file reads on every recipe parsing call.
  5. Caching & Concurrency (parser/Edamam_api_call.py): Implemented local file-based JSON caching (./parser/db/edamam_cache.json) and concurrent requests in Edamam_api_call.py using a ThreadPoolExecutor.

It keeps the basic premise same as in when missing ingredients are found using Edamam, I update the ingredients_nutrient_db.csv file to include the new ingredient with its nutritional information thereby reducing API calls in future.