Vigyata.AI
Is this your channel?

Get Nutrition Facts From Barcode in Google Sheets

287 views· 11 likes· 14:01· Mar 5, 2026

🛍️ Products Mentioned (2)

Use Open Food Facts API in Google Sheets with Apps Script (Custom Function + On Edit) Sheet/Code: https://docs.google.com/spreadsheets/d/1Zqus8ch_K-GNsdxrkOiCsF1gkOyBZOQcDCNb_6lEqOE/copy API documentation: https://openfoodfacts.github.io/openfoodfacts-server/api/ref-v2/#get-/api/v2/product/-code- The script shows how to pull product information from Open Food Facts into Google Sheets using barcodes. It walks through using the Open Food Facts API documentation to generate a curl request, then converting that request into a Google Apps Script custom function using UrlFetchApp.fetch and JSON parsing. The function is simplified to call the v2 product endpoint and return specific fields like product name, brand, calories, and ingredients, including handling missing products. It then demonstrates automating the lookup with an onEdit trigger so that when a user enters a barcode in column A (on a specified sheet), the script writes multiple returned values into adjacent columns, adds required permissions/triggers, logs/debugs barcode retrieval, and handles empty barcodes to avoid errors. 00:00 Intro Food Facts 00:14 API Docs and Curl 01:12 Apps Script Fetch 03:02 Custom Function Test 03:49 Dynamic Barcode URL 04:43 AI Cleanup Parsing 06:25 Multiple Fields Output 07:22 Auto Fill On Edit 10:24 Triggers and Permissions 11:13 Debug Empty Barcode 13:26 Wrap Up and Next

🎬 More from Better Sheets