Open Food Facts API
Overview
Open Food Facts is a free, community-driven database of food products from around the world, containing nutritional facts, ingredients, allergens, and Eco-scores. No API key is required — you can look up any product by its barcode or search by name or nutrient. It is an excellent API for building nutrition trackers, diet apps, or sustainability dashboards.
Beginner Tip
Look up a product using its barcode number (the digits under the barcode on the package) via GET /api/v2/product/{barcode}.json — this is the most reliable way to get accurate data for a specific item.
Available Data
Example Response
{
"recipe": "Chicken Stir Fry",
"calories": 380,
"protein_g": 32,
"carbs_g": 28,
"fat_g": 14,
"ingredients": [
"chicken breast",
"bell pepper",
"soy sauce",
"garlic"
],
"prep_time_minutes": 20
} Field Reference
status 1 if the product was found, 0 if not found in the database. product.product_name Consumer-facing product name as labeled on the packaging. product.brands Comma-separated brand names associated with the product. product.nutriments Nutritional values per 100 g (e.g., energy-kcal_100g, fat_100g, sugars_100g, proteins_100g). product.ingredients_text Full ingredient list as printed on the packaging. product.nutriscore_grade Nutri-Score letter grade (a through e) indicating overall nutritional quality. Implementation Example
const url = "https://world.openfoodfacts.org/data";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Fully tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →BaconMockup
⭐ Beginner's PickBaconMockup is a fun, free API that serves placeholder images featuring bacon — great for filling in image slots during web or app development when you just need something visual.
Coffee
⭐ Beginner's PickThe Coffee API is a dead-simple, no-auth service that returns a random high-quality coffee photo every time you call it.
Foodish
⭐ Beginner's PickFoodish is a fun, free API that returns a random food dish image URL each time you call it.
Fruityvice
⭐ Beginner's PickFruityvice is a free, no-auth API that provides nutritional and botanical data for dozens of common fruits.
Open Brewery DB
⭐ Beginner's PickOpen Brewery DB is a free, open-source API that provides data on breweries, cideries, and bottle shops across multiple countries.