# Open Food Facts Scraper — Barcode, Nutrition & Labels (`haketa/openfoodfacts-scraper`) Actor

Look up food products by barcode, or pull by category or brand, with Nutri-Score, NOVA, Eco-Score, nutrition facts per 100g, ingredients, allergens, labels and image. Powered by Open Food Facts. Keyless, no anti-bot.

- **URL**: https://apify.com/haketa/openfoodfacts-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** E-commerce, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Open Food Facts Scraper — Barcode, Nutrition & Labels

Look up **food products by barcode**, or pull products by **category or brand** — and get **Nutri-Score, NOVA group, Eco-Score, nutrition facts (per 100g), ingredients, allergens, labels, countries and image**. Clean JSON/CSV/Excel.

Powered by **Open Food Facts** (an open, collaborative food database). **Keyless**, no anti-bot — built for diet & nutrition apps, e-commerce, health tools and CPG research.

***

### What this Actor does

Give it barcodes, categories and/or brands, and for each product it returns:

- **Identity** — barcode, product name, brands, categories, quantity.
- **Scores** — **Nutri-Score** (A–E), **NOVA** processing group (1–4), **Eco-Score** (A–E).
- **Nutrition per 100g** — energy (kcal), fat, saturated fat, sugars, salt, proteins, fiber.
- **Composition** — ingredients text, **allergens**, labels (organic, vegan, gluten-free…).
- **Context** — countries sold in, stores, product image and the Open Food Facts page.

***

### Why use it

- **Barcode → full nutrition.** Turn a list of barcodes into a complete nutrition + labels dataset.
- **Health & diet ready.** Nutri-Score, NOVA, sugars, salt and allergens — exactly what diet, nutrition and health apps need.
- **Category & brand sweeps.** Pull every product in a category or for a brand for market/CPG research.
- **Keyless and open.** No API key, no anti-bot — the open Open Food Facts database.
- **Images included.** Product image URLs for every item that has one.

***

### Who it's for

- **Diet, nutrition & health app developers** needing structured food data.
- **E-commerce & grocery teams** enriching product catalogs by barcode.
- **CPG & market researchers** analyzing categories and brands.
- **Data & AI builders** powering food/nutrition assistants.

***

### Quick start

#### Run it in the console (no code)

1. Fill any of the fields:

   ```
   Barcodes:   3017620422003
   Brands:     lindt, coca-cola
   Categories: breakfast-cereals, sodas
   ```

2. Click **Start**, then export as **JSON, CSV, Excel or HTML**.

Leave everything empty for a **demo** (Nutella barcode).

#### Run it via API (Python)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "barcodes": ["3017620422003"],
    "brands": ["lindt"],
    "categories": ["chocolates"],
}

run = client.actor("YOUR_USERNAME/openfoodfacts-scraper").call(run_input=run_input)

for p in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{p['productName']} — Nutri {p['nutriscoreGrade'].upper()} — {p['energyKcal']} kcal — sugars {p['sugars']}")
```

#### Run it via API (JavaScript)

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('YOUR_USERNAME/openfoodfacts-scraper').call({
    barcodes: ['3017620422003'],
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((p) => console.log(`${p.productName}: ${p.nutriscoreGrade} / NOVA ${p.novaGroup}`));
```

***

### Input

| Field | Type | Description |
|---|---|---|
| **Barcodes** | array | Product barcodes (EAN/UPC), one per line. Empty-all = demo. |
| **Categories** | array | English category tags — `chocolates`, `sodas`, `yogurts`, `breakfast-cereals`. |
| **Brands** | array | Brand tags — `lindt`, `coca-cola`, `nestle`. |
| **Max products per query** | integer | Cap per category/brand (paginates by 100). Default 100. |
| **Speed (parallel queries)** | integer | Queries at once. Default 5. |
| **Proxy configuration** | object | Apify Proxy. On by default. |

> **Note on search:** Open Food Facts' free-text search is unreliable, so this Actor works by **barcode** and by **category/brand tags** (which are robust). For specific products, barcodes are the most precise input.

***

### Output

One record per product:

```json
{
  "source": "3017620422003",
  "sourceType": "barcode",
  "barcode": "3017620422003",
  "productName": "Nutella",
  "brands": "Nutella, Ferrero",
  "categories": "Breakfast, Spreads, Hazelnut spreads, ...",
  "quantity": "400 g",
  "nutriscoreGrade": "e",
  "novaGroup": "4",
  "ecoscoreGrade": "unknown",
  "energyKcal": "539",
  "fat": "30.9",
  "saturatedFat": "10.6",
  "sugars": "56.3",
  "salt": "0.107",
  "proteins": "6.3",
  "fiber": "",
  "ingredientsText": "Sugar, palm oil, hazelnuts 13%, ...",
  "allergens": "milk, nuts, soybeans",
  "labels": "",
  "countries": "France, ...",
  "imageUrl": "https://images.openfoodfacts.org/...",
  "url": "https://world.openfoodfacts.org/product/3017620422003",
  "scrapedAt": "2026-10-10T12:00:00.000Z"
}
```

| Field | Description |
|---|---|
| `barcode` / `productName` / `brands` / `categories` / `quantity` | Identity. |
| `nutriscoreGrade` | Nutri-Score A–E. |
| `novaGroup` | NOVA processing group 1–4 (4 = ultra-processed). |
| `ecoscoreGrade` | Eco-Score A–E (when available). |
| `energyKcal` / `fat` / `saturatedFat` / `sugars` / `salt` / `proteins` / `fiber` | Nutrition per 100g. |
| `ingredientsText` / `allergens` / `labels` | Composition, allergens, labels. |
| `countries` / `stores` / `imageUrl` / `url` | Context, image and link. |
| `scrapedAt` | ISO timestamp. |

***

### Tips & notes

- **Barcodes are most precise.** For specific products, use barcodes; category/brand are best for sweeps.
- **Category tags are English slugs.** e.g. `breakfast-cereals`, `carbonated-drinks`, `plant-based-foods`.
- **Data completeness varies.** Open Food Facts is crowd-sourced — popular products are rich; some have gaps (that's the underlying data, passed through as-is).
- **Per-100g nutrition.** Values are normalized to 100g/100ml for easy comparison.
- **Dedupe.** The same product can appear via multiple queries — dedupe on `barcode` if needed.

***

### Frequently asked questions

**Do I need an API key?**
No — Open Food Facts is a free, open database.

**Can I look up specific products?**
Yes — paste barcodes (EAN/UPC) for precise lookups with full detail.

**Can I pull a whole category or brand?**
Yes — add category or brand tags; the Actor paginates through the matches.

**Does it include Nutri-Score and allergens?**
Yes — Nutri-Score, NOVA, Eco-Score, allergens, labels and per-100g nutrition.

**Is free-text search supported?**
Open Food Facts' free-text search is unreliable, so this Actor uses barcodes and category/brand tags, which are robust.

***

### Export & integrate

Results are available as **JSON, CSV, Excel, HTML** and via the **Apify API**. Push to **Google Sheets**, a **webhook**, **Make**, **Zapier** or your database.

*Data from Open Food Facts, a collaborative, free and open database.*

# Actor input Schema

## `barcodes` (type: `array`):

One product barcode (EAN/UPC) per line — e.g. `3017620422003`. Returns full product details. Leave all fields empty for a demo.

## `categories` (type: `array`):

Pull products in a category (English category tag) — e.g. `chocolates`, `breakfast-cereals`, `sodas`, `yogurts`. One per line.

## `brands` (type: `array`):

Pull products for a brand — e.g. `lindt`, `coca-cola`, `nestle`. One per line.

## `maxItemsPerQuery` (type: `integer`):

How many products to keep per category/brand query (paginates in blocks of 100).

## `maxConcurrency` (type: `integer`):

How many queries at once. Open Food Facts is a non-profit — keep modest.

## `proxyConfiguration` (type: `object`):

Apify Proxy. On by default.

## Actor input object example

```json
{
  "barcodes": [
    "3017620422003",
    "737628064502"
  ],
  "categories": [],
  "brands": [],
  "maxItemsPerQuery": 100,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `source` (type: `string`):

Query value

## `sourceType` (type: `string`):

barcode/category/brand

## `barcode` (type: `string`):

EAN/UPC

## `productName` (type: `string`):

Product name

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

Brands

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

Categories

## `quantity` (type: `string`):

Quantity

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

a-e

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

Processing group 1-4

## `ecoscoreGrade` (type: `string`):

a-e

## `energyKcal` (type: `string`):

kcal per 100g

## `fat` (type: `string`):

Fat per 100g

## `saturatedFat` (type: `string`):

Saturated fat

## `sugars` (type: `string`):

Sugars per 100g

## `salt` (type: `string`):

Salt per 100g

## `proteins` (type: `string`):

Proteins per 100g

## `fiber` (type: `string`):

Fiber per 100g

## `ingredientsText` (type: `string`):

Ingredients

## `allergens` (type: `string`):

Allergens

## `labels` (type: `string`):

Labels (organic, vegan…)

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

Sold in

## `imageUrl` (type: `string`):

Product image

## `url` (type: `string`):

Open Food Facts page

## `scrapedAt` (type: `string`):

Timestamp

# 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 = {
    "barcodes": [
        "3017620422003",
        "737628064502"
    ],
    "categories": [],
    "brands": [],
    "maxItemsPerQuery": 100,
    "maxConcurrency": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/openfoodfacts-scraper").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 = {
    "barcodes": [
        "3017620422003",
        "737628064502",
    ],
    "categories": [],
    "brands": [],
    "maxItemsPerQuery": 100,
    "maxConcurrency": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/openfoodfacts-scraper").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 '{
  "barcodes": [
    "3017620422003",
    "737628064502"
  ],
  "categories": [],
  "brands": [],
  "maxItemsPerQuery": 100,
  "maxConcurrency": 5
}' |
apify call haketa/openfoodfacts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,haketa/openfoodfacts-scraper"
        }
    }
}
```

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/N6m2IGbvReO3c0qvG/builds/IhnXq3oZYJDBn1b7p/openapi.json
