GET /foods/barcode/:upc
Resolve a UPC/EAN barcode to a food item.
Path parameters
- Name
upc- Type
- string
- Description
UPC or EAN barcode value.
Example request
curl -H "x-api-key: YOUR_API_KEY" \
"https://api.macrofy.com/foods/barcode/012000161155"
Example response
{
"id": "food_coke",
"name": "Coca-Cola Classic",
"brand": "Coca-Cola",
"serving": { "amount": 12, "unit": "fl_oz" },
"macros": { "calories": 140, "protein": 0, "carbs": 39, "fat": 0 }
}