# Open Food Facts Products Scraper (`devilscrapes/open-food-facts-products-scraper`) Actor

Export curated Open Food Facts product data — barcode, name, brand, quantity, category/label/country tags, nutriscore, ecoscore, NOVA group and ingredients — filtered by brand, category, country or search term, as clean JSON, CSV or Excel.

- **URL**: https://apify.com/devilscrapes/open-food-facts-products-scraper.md
- **Developed by:** [DevilScrapes](https://apify.com/devilscrapes) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 81.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## Open Food Facts Products Scraper

**💰 $2.20 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Export curated Open Food Facts product data — barcode, name, brand, quantity, category/label/country tags, nutriscore, ecoscore, NOVA group and ingredients — filtered by brand, category, country or search term, as clean JSON, CSV or Excel.

</div>

***

### 🎯 What this scrapes

This Actor searches Open Food Facts — the crowdsourced, keyless product database covering 3M+ barcoded products — and exports a curated slice: barcode, product name, brand, quantity, category/label/country tags, nutriscore, ecoscore, NOVA processing group and ingredients. Filter by brand, category, country or free-text search term, and stop after however many products you need.

### 🔥 What we handle for you

- 🛡️ **Browser fingerprint rotation** — `curl-cffi` impersonates real Chrome / Firefox / Safari TLS handshakes on every request, even though Open Food Facts is a friendly public API.
- 🔁 **Retries with exponential backoff** — Open Food Facts intermittently serves a transient 503 under valid queries; we retry up to 5 times (2s → 30s cap) before ever giving up.
- 🎯 **A curated field list, not the full ~140 KB product document** — we request only the fields your dataset needs, keeping runs fast and cheap.
- 🧊 **Clean, typed dataset rows** — Pydantic-validated, ISO-8601 timestamps, stable product codes, JSON / CSV / Excel export straight from the Apify Console.
- 💰 **Pay-Per-Event pricing** — you only pay for results that hit your dataset. No data, no charge.

### 💡 Use cases

- CPG / retail intelligence — pull a competitor brand's full catalog with nutrition, eco and processing scores in one export.
- Nutrition & health research — build a scored dataset (nutriscore, ecoscore, NOVA) for a category or country without hand-rolling Open Food Facts' pagination.
- Ingredient audits — export ingredients\_text alongside category and label tags to screen a brand's lineup for a claim (organic, allergen, etc.).
- Retail catalog enrichment — attach barcode, quantity and image\_url to an existing SKU list by matching on `code`.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `brandsTag` | `string` | no | 'nutella' | Filter to products whose brand facet matches this tag, e.g. <code>nutella</code>, <code>coca-cola</code>. Leave blank… |
| `categoriesTag` | `string` | no | '—' | Filter to a category facet tag, e.g. <code>en:sodas</code>. Leave blank to skip this filter. |
| `countriesTag` | `string` | no | '—' | Filter to a country facet tag, e.g. <code>en:france</code>. Leave blank to skip this filter. |
| `searchTerms` | `string` | no | '—' | Free-text search across product name and brand. Leave blank to skip this filter. |
| `maxResults` | `integer` | no | 100 | Stop after this many products. Each product is one billed result row. |
| `proxyConfiguration` | `object` | no | {'useApifyProxy': False} | Open Food Facts is a public, keyless API and does not fingerprint clients — a proxy is optional. Leave this off unless… |

#### Example input

```json
{
  "brandsTag": "nutella",
  "maxResults": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `code` | `string` | Barcode / product code. |
| `product_name` | `string` | Product display name. |
| `brands` | `string` | Comma-separated brand names as OFF stores them. |
| `quantity` | `string` | Free-text pack size, e.g. '1 kg'. |
| `categories_tags` | `array` | OFF category taxonomy tags. |
| `labels_tags` | `array` | OFF label taxonomy tags (organic, fair-trade, etc.). |
| `countries_tags` | `array` | Countries the product is sold in. |
| `nutriscore_grade` | `string` | a-e or unknown/not-applicable. |
| `ecoscore_grade` | `string` | a-e or unknown/not-applicable. |
| `nova_group` | `integer` | 1-4 processing-level classification. |
| `ingredients_text` | `string` | Raw ingredients list as published. |
| `packaging_tags` | `array` | Packaging material/type tags. |
| `stores` | `string` | Comma-separated store names where reported sold. |
| `image_url` | `string` | Front product image URL. |
| `product_url` | `string` | Built as https://world.openfoodfacts.org/product/<code>. |
| `scraped_at` | `string` | ISO 8601 UTC at row creation. |

#### Example output

```json
{
  "code": "3017620422003",
  "product_name": "Nutella",
  "brands": "Nutella, Ferrero, Yum yum",
  "quantity": null,
  "categories_tags": [
    "en:breakfasts",
    "en:spreads",
    "en:sweet-spreads"
  ],
  "labels_tags": [],
  "countries_tags": [
    "en:france"
  ],
  "nutriscore_grade": "e",
  "ecoscore_grade": "unknown",
  "nova_group": 4,
  "ingredients_text": "Sucre, huile de palme, NOISETTES 13%, cacao maigre 7,4%, LAIT \u00e9cr\u00e9m\u00e9 en poudre 6,6%, LACTOSERUM en poudre, \u00e9mulsifiants: l\u00e9cithines [SOJA), vanilline. Sans gluten.",
  "packaging_tags": [],
  "stores": null,
  "image_url": "https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.879.400.jpg",
  "product_url": "https://world.openfoodfacts.org/product/3017620422003",
  "scraped_at": "2026-08-20T12:00:00+00:00"
}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.20 | One-off warm-up charge per run |
| `result` | $0.002 | Per dataset item |

Example: 1 000 results at the rates above ≈ **$2.20**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- Open Food Facts is a crowdsourced database — coverage and field completeness vary by product and region; a product missing from Open Food Facts simply won't appear.
- The Actor requires at least one filter (brand, category, country or search term) — an unfiltered full-database pull is out of scope.
- Nutrient-value-by-100g numeric breakdowns and single-barcode lookup are not included in v1.

### ❓ FAQ

**Do I need to filter by something?**

Yes — set at least one of Brand tag, Category tag, Country tag or Search terms. Open Food Facts holds 3M+ products; an unfiltered pull isn't supported.

**Why don't I see every field for every product?**

Open Food Facts is community-maintained — not every product has a filled-in nutriscore, ecoscore, or ingredients list. Missing fields come back as `null`, never a crash.

**Is this legal?**

We only fetch data Open Food Facts already publishes through its own public search API. Respect Open Food Facts' own terms before reusing the data commercially.

**How do I export to Sheets?**

After the run finishes, click *Storage → Dataset → Export* and pick CSV — Google Sheets imports it directly.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Actor input Schema

## `brandsTag` (type: `string`):

Filter to products whose brand facet matches this tag, e.g. <code>nutella</code>, <code>coca-cola</code>. Leave blank to skip this filter.

## `categoriesTag` (type: `string`):

Filter to a category facet tag, e.g. <code>en:sodas</code>. Leave blank to skip this filter.

## `countriesTag` (type: `string`):

Filter to a country facet tag, e.g. <code>en:france</code>. Leave blank to skip this filter.

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

Free-text search across product name and brand. Leave blank to skip this filter.

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

Stop after this many products. Each product is one billed result row.

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

Open Food Facts is a public, keyless API and does not fingerprint clients — a proxy is optional. Leave this off unless your account requires egress through Apify Proxy.

## Actor input object example

```json
{
  "brandsTag": "nutella",
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "brandsTag": "nutella",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/open-food-facts-products-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 = {
    "brandsTag": "nutella",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/open-food-facts-products-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 '{
  "brandsTag": "nutella",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call devilscrapes/open-food-facts-products-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/open-food-facts-products-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/FQlxRqdUGdyDpBbpW/builds/7w8vT6Hp35ih4bdTF/openapi.json
