# Open Food Facts Extractor (`cynix_dev/open-food-facts`) Actor

Search and extract food-product data from Open Food Facts as clean typed JSON: name, brand, ingredients, allergens, nutrition (energy/fat/sugars/salt/protein), Nutri-Score, NOVA, Eco-Score, labels, image and source URL. No API key required.

- **URL**: https://apify.com/cynix\_dev/open-food-facts.md
- **Developed by:** [Cynix Dev](https://apify.com/cynix_dev) (community)
- **Categories:** Developer tools, MCP servers, Automation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.17 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Open Food Facts Extractor

**Food product data** from Open Food Facts — name, brand, ingredients, allergens, per-100g nutrition, **Nutri-Score**, **NOVA** processing group, Eco-Score, labels and images. Search, look up barcodes, or pull a whole brand. No API key.

### What it does

Open Food Facts is a collaborative database of packaged food products from around the world, with over a million entries. This Actor gives you three ways in:

- **`product`** — fetch exact products by EAN/UPC **barcode**.
- **`search`** — full-text search (`nutella`, `almond milk`, `protein bar`).
- **`by_brand`** — everything catalogued for a brand.

Filters let you narrow by category, country, Nutri-Score grade and NOVA group, so you can ask precise questions like "Nutri-Score A or B breakfast cereals sold in France" and get a clean table back.

### Features

- **Barcode lookup** — pass a list of EAN/UPC codes and get one record each.
- **Nutri-Score filter** — restrict to grade `a`–`e` for healthier-product analysis.
- **NOVA filter** — isolate ultra-processed foods (group 4) or minimally processed (group 1).
- **Full nutrition per 100 g** — energy in both kJ and kcal, fat, sugars, protein, salt.
- **Allergens and ingredients** as text, ready for parsing or LLM analysis.
- **Eco-Score and labels** — organic, halal, fair-trade and other certifications.
- **Country and category scoping** for market-specific research without post-filtering.
- **Product images and source URLs** on every record.

### What people use it for

- Nutrition and public-health research — compare processing levels across a category.
- Retail and CPG competitive analysis — audit a rival brand's portfolio and scores.
- App and chatbot backends — barcode lookup for a food-scanning feature.
- Diet and allergen tooling — filter products by allergen or certification.
- Sustainability reporting — pull Eco-Score data across a product range.

### Nutri-Score, NOVA and Eco-Score explained

| Score | Scale | What it measures |
| --- | --- | --- |
| **Nutri-Score** | `a` (best) → `e` (worst) | Overall nutritional quality: energy, sugar, salt, saturated fat versus fibre, protein, fruit/veg content |
| **NOVA** | `1` → `4` | Degree of industrial processing; `1` is unprocessed/minimally processed, `4` is ultra-processed |
| **Eco-Score** | `a` → `e` | Estimated environmental impact across the life cycle |

These are the same indicators printed on packaging across much of Europe, which makes them useful for like-for-like comparison.

#### Data completeness

Open Food Facts is contributor-driven. Popular products in France, Germany, Spain, Belgium and Switzerland are richly documented; coverage is thinner elsewhere and for niche items. Expect some empty nutrition or score fields, and sort by `popularity` when you want well-documented products first.

### Input

Pick a `mode` first. `codes` is used only for barcode lookups; `searchTerms`, `brands`, `categories` and the score filters drive the search modes.

| Field | Type | Default | What it does |
| --- | --- | --- | --- |
| `mode` | string | `search` | product = fetch one product by barcode; search = full-text search; by\_brand = search scoped to a brand. Options: `search`, `product`, `by_brand`. |
| `codes` | array | `[]` | EAN/UPC barcodes to fetch (one per line). Only used when Mode = Single product. |
| `searchTerms` | string | `chocolate` | Free-text query, e.g. 'nutella', 'almond milk'. Ignored in product mode. |
| `brands` | string | — | Restrict to a brand, e.g. 'nestle'. Used by search and by\_brand modes. |
| `categories` | string | — | OFF category tag, e.g. 'breakfast-cereals', 'cheeses'. |
| `countries` | string | — | Limit to a country tag, e.g. 'france', 'united-states'. |
| `nutriscoreGrade` | string | — | Only return products with this Nutri-Score grade or better (a/b/c/d/e). Leave empty for all. |
| `novaGroup` | string | — | Only return products in this NOVA ultra-processing group (1-4). Leave empty for all. |
| `maxResults` | integer | `50` | Cap on records returned. Range 1–1000. |
| `pageSize` | integer | `50` | Records fetched per API page (1-100). Range 1–100. |
| `sortBy` | string | `popularity` | Result ordering for search / by\_brand modes. Options: `relevance`, `popularity`, `last_modified`, `product_name`, `nutriscore`, `nova`, `ecoscore`, `created_t`. |

#### Input example

```json
{
  "mode": "search",
  "searchTerms": "chocolate",
  "maxResults": 10,
  "pageSize": 50,
  "sortBy": "popularity"
}
```

### Output

One record per product. Nutrition values are per 100 g/ml as published. Fields are sparse where contributors haven't filled them in — normal for a crowd-sourced database.

Every dataset record contains: `code`, `product_name`, `brands`, `categories`, `quantity`, `countries`, `ingredients_text`, `allergens`, `labels`, `nova_groups`, `nutriscore_grade`, `ecoscore_grade`, `energy_100g_kj`, `energy_100g_kcal`, `fat_100g`, `sugars_100g`, `proteins_100g`, `salt_100g`, `additives_n`, `image_url`, `url`, `mode`.

#### Output example

A real record from a run of this Actor:

```json
{
  "code": "6111246721261",
  "product_name": "Fromage Blanc Nature",
  "brands": "Milky Food Professional",
  "categories": "Cheeses, fr:Fromages blancs natures",
  "quantity": "1 kg",
  "countries": "Canada, France, Morocco, United States",
  "ingredients_text": "Lait de vache pasteurisé, Protéines de lait de vache, Crème de lait de vache, Ferment lactique, Amidon, Epaississant, Sorbate de potassium",
  "allergens": "milk",
  "labels": "Halal, No additives",
  "nova_groups": "4",
  "nutriscore_grade": "c",
  "ecoscore_grade": "b",
  "energy_100g_kj": "643",
  "energy_100g_kcal": "159",
  "fat_100g": "11",
  "sugars_100g": "4",
  "proteins_100g": "5",
  "salt_100g": "0.1",
  "additives_n": "",
  "image_url": "https://images.openfoodfacts.org/images/products/611/124/672/1261/front_fr.118.400.jpg",
  "url": "https://world.openfoodfacts.org/product/6111246721261",
  "mode": "search"
}
```

Export the dataset as JSON, CSV, Excel, XML or JSONL from the Console, or pull it programmatically through the Apify API and any of the official clients.

### How to use it

1. Click **Try for free** (or **Start** if you already have an Apify account).
2. Fill in the input fields described above — the defaults already produce a working run.
3. Press **Start** and watch the log; results stream into the dataset as they are found.
4. When the run finishes, open the **Output/Storage** tab and export as JSON, CSV or Excel.

Runs can be scheduled (hourly, daily, weekly) and wired into Slack, Google Sheets, Zapier, Make, webhooks or your own backend through Apify integrations. Everything the Console does is also available over the [Apify API](https://docs.apify.com/api/v2).

### Pricing

This Actor is billed on Apify's **pay-per-event** model: a small charge when a run starts, plus a charge for each result written to the dataset. You only pay for records you actually receive — a run that finds nothing costs only the start event. Current rates are always shown on the **Pricing** tab of this page, and the run log prints your usage as it goes.

Free-plan credits from Apify cover a large amount of light usage, so you can evaluate the Actor before committing to anything.

### FAQ

#### Do I need an API key?

No. Open Food Facts is an open database with a free public API. Please keep run volumes reasonable — it's a non-profit project funded by donations.

#### How do I look up a specific product?

Set `mode` to `product` and put its EAN/UPC barcode in `codes`. You can pass many barcodes in one run, one per line.

#### Why are some nutrition fields empty?

Contributors enter data manually from packaging, so completeness varies by product and country. Sorting by `popularity` surfaces the best-documented entries.

#### Can I filter to only healthy products?

Set `nutriscoreGrade` to `a` or `b` for better-scoring items, and/or `novaGroup` to `1` or `2` to exclude ultra-processed products.

#### What licence covers this data?

Open Food Facts data is published under the Open Database License (ODbL), and product images under Creative Commons terms. Attribute Open Food Facts if you redistribute the data.

### Other Actors by cynix\_dev

| Actor | What it does |
| --- | --- |
| [Recipe Extractor — Clean Structured Recipes](https://apify.com/cynix_dev/recipe-extractor) | Paste recipe URLs, get back just the recipe: ingredients, numbered steps, times, yield, nutrition, and rating as clean typed … |
| [Recipe URL Scraper — Keyword Search](https://apify.com/cynix_dev/recipe-url-scraper) | Enter keywords (bread, pasta, mediterranean, lunch…) and get back matching recipe URLs with titles from the web and top recipe … |
| [Recipe Extractor — Clean Structured Recipes](https://apify.com/cynix_dev/recipe-extractor) | Paste recipe URLs, get back just the recipe: ingredients, numbered steps, times, yield, nutrition, and rating as clean typed … |
| [FDA Drug Database Extractor](https://apify.com/cynix_dev/fda-drug-database) | FDA Drug Database Extractor: Orange Book (patents/exclusivity), NDC Directory, openFDA (adverse events, recalls, labeling), … |

### Legal and responsible use

This Actor collects only publicly available information. You are responsible for how you use the data, including compliance with the target site's Terms of Service, robots directives, copyright, and data protection law such as GDPR and CCPA. Do not use it to gather personal data without a lawful basis.

### Support and feedback

Found a bug, hit a site change, or need an extra field? Open a ticket on the **Issues** tab of this Actor — issues are read and fixed. Feature requests and custom-scraper enquiries are welcome through the same channel.

# Actor input Schema

## `mode` (type: `string`):

product = fetch one product by barcode; search = full-text search; by\_brand = search scoped to a brand.

## `codes` (type: `array`):

EAN/UPC barcodes to fetch (one per line). Only used when Mode = Single product.

## `searchTerms` (type: `string`):

Free-text query, e.g. 'nutella', 'almond milk'. Ignored in product mode.

## `brands` (type: `string`):

Restrict to a brand, e.g. 'nestle'. Used by search and by\_brand modes.

## `categories` (type: `string`):

OFF category tag, e.g. 'breakfast-cereals', 'cheeses'.

## `countries` (type: `string`):

Limit to a country tag, e.g. 'france', 'united-states'.

## `nutriscoreGrade` (type: `string`):

Only return products with this Nutri-Score grade or better (a/b/c/d/e). Leave empty for all.

## `novaGroup` (type: `string`):

Only return products in this NOVA ultra-processing group (1-4). Leave empty for all.

## `maxResults` (type: `integer`):

Cap on records returned.

## `pageSize` (type: `integer`):

Records fetched per API page (1-100).

## `sortBy` (type: `string`):

Result ordering for search / by\_brand modes.

## Actor input object example

```json
{
  "mode": "search",
  "codes": [],
  "searchTerms": "chocolate",
  "maxResults": 50,
  "pageSize": 50,
  "sortBy": "popularity"
}
```

# Actor output Schema

## `dataset` (type: `string`):

One record per product: name, brand, nutrition, labels, allergens, ingredients, image and source URL.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("cynix_dev/open-food-facts").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("cynix_dev/open-food-facts").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call cynix_dev/open-food-facts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cynix_dev/open-food-facts"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/rDjFlgo8PL2XaoFol/builds/tZCsSucHsCwsC9TtC/openapi.json
