OpenFoodFacts Scraper - Barcode, Search & Nutrition avatar

OpenFoodFacts Scraper - Barcode, Search & Nutrition

Pricing

from $1.00 / 1,000 product scrapeds

Go to Apify Store
OpenFoodFacts Scraper - Barcode, Search & Nutrition

OpenFoodFacts Scraper - Barcode, Search & Nutrition

Looks up Open Food Facts products by barcode or free-text search in one actor. Returns brand, ingredients, allergens, full nutrition facts, Nutri-Score, NOVA group and eco-score per product. $0.001 per product.

Pricing

from $1.00 / 1,000 product scrapeds

Rating

0.0

(0)

Developer

Gio

Gio

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

18 days ago

Last modified

Features

Limited permissions

Share

Look up products in the Open Food Facts crowd-sourced database by barcode or by free-text search, and get back brand, ingredients, allergens, full nutrition facts, Nutri-Score, NOVA group and eco-score in one structured record per product.

Why use this scraper

Open Food Facts is a genuinely open, free database of over 3 million food products contributed by volunteers worldwide, but pulling it into a nutrition app, a dietary research pipeline or an e-commerce catalog still means handling two different access patterns (barcode lookup vs. free-text search), two different response shapes, and flattening deeply nested nutrition fields by hand.

This Actor does that flattening for you: give it a list of barcodes or a search term, and it returns one flat JSON object per product with the fields a nutrition app, a labeling tool or a research dataset actually needs, pulled straight from the names Open Food Facts itself uses for its most common and most complete fields.

Overview

  • Input: either a list of barcodes to look up directly, or a free-text search term (optionally filtered by country).
  • Output: one flattened JSON record per product, with identity (name, brand, categories), ingredients and allergens, full nutrition-per-100g breakdown, and the three Open Food Facts scores (Nutri-Score, NOVA group, Eco-Score).
  • Speed: barcode lookups run at roughly 4 per second; search mode pages through 100 results at a time.
  • Cost: pay per product actually returned; a barcode that does not exist in the database is still flagged in the output but not charged as a scraped product.

Supported inputs

Two modes, selected with the mode field:

  • barcodes - provide one or more EAN13/UPC barcodes directly; the Actor looks each one up individually and returns its full product record, or a product_not_found flag if that barcode is not in the Open Food Facts database.
  • search - provide a free-text searchTerm (product name search) and, optionally, a country tag (e.g. en:france, en:brazil, en:united-states) to narrow results to products sold in that country; the Actor pages through matching products automatically.

Use cases

  • Nutrition and diet apps - enrich a user's logged meal or scanned barcode with full nutrition and Nutri-Score data without building a food database from scratch.
  • E-commerce catalog enrichment - grocery and specialty-food retailers backfilling product pages with ingredients, allergens and nutrition tables for products they already sell.
  • Dietary and public-health research - pull Nutri-Score, NOVA group (ultra-processing level) and eco-score distributions across a category or country for academic or policy research.
  • Allergen and labeling compliance tools - cross-check a product catalog against Open Food Facts' allergen tags to flag undeclared allergens before they reach a label.
  • Price and assortment monitoring for private-label teams - compare a retailer's own product's nutrition profile against named competitor products pulled by barcode.

How it works

For barcodes mode, the Actor calls Open Food Facts' own per-product JSON endpoint once per barcode and maps the nested nutriments object into flat, per-100g fields (energyKcal100g, sugars100g, salt100g, etc.) alongside the product's identity and scoring fields. For search mode, it pages through Open Food Facts' search endpoint with your term and optional country filter, applying the same flattening to every product returned. Either way, a product's code is the Open Food Facts barcode, which doubles as the canonical product URL (world.openfoodfacts.org/product/<code>) included in every output record.

Input configuration

Example 1 - Direct barcode lookup, multiple products at once:

{
"mode": "barcodes",
"barcodes": ["3017624010701", "5449000000996"],
"maxItems": 10
}

Example 2 - Free-text search for a product name:

{
"mode": "search",
"searchTerm": "chocolate",
"maxItems": 50
}

Example 3 - Free-text search filtered to one country:

{
"mode": "search",
"searchTerm": "yogurt",
"country": "en:brazil",
"maxItems": 100
}

mode is required; barcodes is required for barcodes mode, searchTerm for search mode. maxItems defaults to 100, max 5,000.

Output sample

Real output from a live barcode lookup:

{
"barcode": "3017624010701",
"productName": "Nutella",
"brands": "Ferrero",
"categories": "Schoko- und Haselnussaufstriche, Other",
"categoriesTagsEn": ["en:breakfasts", "en:spreads", "en:sweet-spreads", "en:hazelnut-spreads", "en:chocolate-spreads"],
"ingredientsText": "sugar, palm oil, hazelnuts, skimmed milk powder, fat reduced cocoa, emulsifier, vanillin",
"allergens": "Schalenfrüchte",
"allergensTags": ["en:nuts"],
"nutriscore": "e",
"novaGroup": null,
"ecoscore": "d",
"quantity": "400.0 g",
"energyKcal100g": 539,
"fat100g": 30.9,
"sugars100g": 56.3,
"proteins100g": 6.3,
"salt100g": 0.1075,
"imageUrl": "https://images.openfoodfacts.org/images/products/301/762/401/0701/front_en.100.400.jpg",
"url": "https://world.openfoodfacts.org/product/3017624010701"
}

And a second real product from the same lookup:

{
"barcode": "5449000000996",
"productName": "Coca-Cola Original",
"brands": "COCA-COLA SERVICES SA/NV",
"categoriesTagsEn": ["en:beverages", "en:carbonated-drinks", "en:soft-drinks", "en:colas"],
"ingredientsText": "Agua carbonatada, azúcar, colorante (E-150d), acidulante (ácido fosfórico), aromas naturales (contiene cafeína).",
"nutriscore": "e",
"novaGroup": 4,
"ecoscore": "not-applicable",
"quantity": "330 ml",
"energyKcal100g": 42.4,
"sugars100g": 10.6,
"proteins100g": 0,
"salt100g": 0,
"url": "https://world.openfoodfacts.org/product/5449000000996"
}

Key output fields

FieldTypeDescription
barcodestringEAN13/UPC code, also the canonical Open Food Facts product id.
productNamestringProduct name as entered by contributors.
brandsstringBrand name(s), comma-separated when more than one is listed.
categories / categoriesTagsEnstring / arrayHuman-readable categories, and the same categories as normalized English tags.
ingredientsTextstringFull ingredients list, in whichever language the product's label was entered in.
allergens / allergensTagsstring / arrayDeclared allergens, in free text and as normalized tags.
nutriscorestringNutri-Score letter grade (a best to e worst).
novaGroupinteger | nullNOVA ultra-processing classification, 1 (unprocessed) to 4 (ultra-processed); null when Open Food Facts has not classified it yet.
ecoscorestringEco-Score environmental impact grade.
energyKcal100g, fat100g, sugars100g, proteins100g, salt100g (and more)number | nullNutrition facts per 100g/100ml, straight from the product's nutriments object.
imageUrlstring | nullFront-of-package product photo.
urlstring | nullCanonical Open Food Facts product page.

Pricing

Pay per product returned, no subscription:

EventPrice
Actor start$0.00005 (one-time per run)
Product scraped$0.001

A 100-product run (the default) costs about $0.10; a 1,000-product run costs about $1.00. A barcode that returns product_not_found is not charged.

What makes this richer than the competition

Two other Open Food Facts scrapers on the Apify Store, by real, verified numbers:

  • naimurhasanrwd/openfoodfacts-product-scraper (2 users in the last 30 days) covers the same barcode-or-search approach and the same core fields (brand, category, Nutri-Score, ingredients), but does not expose NOVA group or Eco-Score in its advertised output. This Actor returns all three Open Food Facts scores (Nutri-Score, NOVA group, Eco-Score) together in every record.
  • omao/openfoodfacts (2 users in the last 30 days) covers barcode lookup at the same $0.001/record price point as this Actor, but is barcode-only; it has no free-text search mode, so finding products without already knowing their barcode means looking them up elsewhere first. This Actor covers both access patterns, barcode and search, from a single input schema.

Notes & limitations

  • Full-text search (search mode) depends on Open Food Facts' own public search endpoint, which can occasionally return a temporary server error (HTTP 503) under load; barcode lookups (barcodes mode) hit a different, more consistently available endpoint and are the more reliable path when you already know the product's barcode.
  • Open Food Facts is contributor-maintained: not every product has every field filled in (a novaGroup of null, as in the Nutella sample above, means no contributor has classified that product's NOVA group yet, not a scraping gap).
  • Nutrition fields are reported exactly as the product's label was entered into Open Food Facts; the Actor does not recalculate or validate nutrition math.
  • A barcode not found in the database returns {barcode, error: "product_not_found"} rather than an empty or fabricated record, so you can distinguish "not in the database" from "found but missing a field."

FAQ

Can I look up a barcode that isn't in Open Food Facts yet? No; the Actor returns product_not_found for barcodes Open Food Facts does not have, since it is a lookup against their crowd-sourced data, not a universal product database.

What's the difference between Nutri-Score, NOVA group and Eco-Score? Nutri-Score grades overall nutritional quality (A-E), NOVA group grades degree of processing (1-4, ultra-processed at 4), and Eco-Score grades environmental impact; Open Food Facts computes all three independently and this Actor returns whichever ones that product has been scored on.

Does search mode work in languages other than English? Yes, Open Food Facts is multilingual; searchTerm matches whatever language the product names were entered in, so a Portuguese or French product name search works the same way as an English one.

Why did my search mode run return a fetch_failed error? Open Food Facts' search endpoint occasionally returns a temporary server error; retry the run, or switch to barcodes mode if you already know the product codes you need.

Can I filter search results to a specific country? Yes, with the optional country field using Open Food Facts' own country tags (en:france, en:brazil, en:united-states, etc.).

Is this the same data as scanning a product with the Open Food Facts mobile app? Yes, same underlying database; this Actor queries the same public API the app and website use.

For AI Agents & LLM Apps

This Actor can be called directly from an LLM agent or application without writing a scraper integration by hand.

Via MCP (mcp.apify.com): add this Actor as a tool to any MCP-compatible client (Claude, Cursor, etc.) and call it with the same input shown above; the agent receives the dataset rows as its tool result.

Via API, using run-sync-get-dataset-items to get results back in the same request:

POST https://api.apify.com/v2/acts/gio21~openfoodfacts-scraper/run-sync-get-dataset-items?token=<YOUR_TOKEN>
Content-Type: application/json
{
"mode": "barcodes",
"barcodes": ["3017624010701"],
"maxItems": 5
}

The response is the JSON array of scraped products, ready to feed straight into an agent's context, for example a nutrition-coaching agent answering "is this a healthy snack?" from a scanned barcode.

Disclaimer

This Actor is an independent tool that queries the public Open Food Facts API. It is not affiliated with, endorsed by, or sponsored by the Open Food Facts association or any of its contributors. All trademarks mentioned are the property of their respective owners.

SEO Keywords

Open Food Facts scraper, barcode product lookup API, Nutri-Score scraper, NOVA group data, nutrition facts API, food database scraper, EAN barcode scraper, Eco-Score scraper.