# Open Food Facts Grocery Products, Barcodes & Nutrition Scraper (`slavako/open-food-facts-products-scraper`) Actor

Scrape Open Food Facts database: 3.5M+ grocery products, barcodes (EAN/UPC), ingredients, allergens, NutriScore, EcoScore, and nutrition facts.

- **URL**: https://apify.com/slavako/open-food-facts-products-scraper.md
- **Developed by:** [Sviatoslav](https://apify.com/slavako) (community)
- **Categories:** Developer tools, AI, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 grocery product records

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?

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 Grocery Products, Barcodes & Nutrition Scraper

Fast, reliable, and production-ready Apify Actor to search and extract consumer packaged goods, grocery products, barcodes (EAN-13, UPC-A), ingredients, allergens, NutriScore, EcoScore, and 100g nutritional facts from the official **Open Food Facts** global collaborative database (over 3.5 million products).

***

### Features

- **Direct Open Food Facts REST API Integration:** Access the world's largest open food and grocery database with zero API keys required.
- **Universal Barcode Lookup & Keyword Search:** Search by product name, brand, or food category, or lookup exact EAN-13/UPC barcodes.
- **Complete Nutritional Breakdown:** Extracts energy (kcal/kJ), total fat, saturated fat, carbohydrates, sugars, dietary fiber, proteins, and salt per 100g.
- **Official Health & Environmental Scores:** Captures official NutriScore (A to E), EcoScore environmental impact (A to E), and NOVA ultra-processed food group (1 to 4).
- **Ingredient & Allergen Transparency:** Extracts full ingredient lists, recognized allergens, traces, and palm oil indicators.
- **Brand & Packaging Insights:** Retrieves brand names, quantity/packaging specifications, categories, and front product image URLs.
- **LLM & E-Commerce Ready:** Clean JSON output formatted for retail price monitoring, FMCG competitive analytics, and AI nutrition assistants.
- **Ultra-Lightweight & Cost-Effective:** Operates on 128 MB RAM with zero browser overhead and zero proxy surcharges.

***

### Use Cases

1. **FMCG & Grocery Retail Intelligence:** Track product formulations, packaging changes, and ingredient trends across multinational food brands.
2. **AI Nutrition & Health Tech Apps:** Power barcode-scanning health applications, diet trackers, and calorie counter bots.
3. **Food Allergen & Compliance Screening:** Identify undeclared allergens, traces, or additives across product lines.
4. **ESG & Sustainable Sourcing Audits:** Evaluate packaging materials, EcoScore ratings, and carbon footprints across consumer goods.

***

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `searchTerms` | String | `"chocolate"` | Product keyword, brand, or food category (e.g. `dark chocolate`, `protein bar`, `oat milk`). |
| `barcode` | String | `""` | Optional exact EAN-13 or UPC barcode (e.g. `3046920029759` for Lindt chocolate). |
| `sortBy` | String | `"unique_scans_n"` | Sort order: `unique_scans_n` (Most Scanned), `popularity_tags`, or `created_t`. |
| `maxResults` | Integer | `20` | Maximum number of products to scrape (1 to 500). |
| `includeNutrition` | Boolean | `true` | Extract full 100g nutritional breakdown. |
| `includeIngredients` | Boolean | `true` | Extract ingredient text and allergen tags. |
| `includeScores` | Boolean | `true` | Extract NutriScore, EcoScore, and NOVA ratings. |

***

### Output Example

Each product record is structured as follows:

```json
{
  "code": "3046920029759",
  "productName": "Extra fine dark chocolate",
  "brands": "Lindt",
  "quantity": "100g",
  "categories": [
    "Dark chocolate bars",
    "Extra fine dark chocolates",
    "Sweet snacks"
  ],
  "nutriScore": "d",
  "ecoScore": "d",
  "novaGroup": 3,
  "ingredientsText": "Cocoa mass, cocoa butter, low fat cocoa powder, sugar, natural vanilla bourbon.",
  "allergens": [],
  "nutriments100g": {
    "energyKcal": 592,
    "fat": 55,
    "saturatedFat": 30,
    "carbohydrates": 14,
    "sugars": 7,
    "proteins": 10,
    "salt": 0.03
  },
  "imageUrl": "https://images.openfoodfacts.org/images/products/304/692/002/9759/front_en.544.400.jpg",
  "openFoodFactsUrl": "https://world.openfoodfacts.org/product/3046920029759"
}
```

***

### Pay-Per-Event (PPE) Pricing

This Actor uses fair, transparent event-based pricing with **no recurring monthly subscription**:

| Event | Price (USD) | Description |
|---|---|---|
| **Actor Start** | **$0.003** | Charged once per execution run (128 MB RAM). |
| **Grocery Product Record** | **$0.001** | Primary charge per food/grocery product saved to dataset. |
| **Enriched Nutrition & Allergens** | **$0.002** | Charged per product enriched with 100g nutritional breakdown and allergen tags. |

***

### Disclaimer

This Actor is independently developed and is not officially affiliated with or endorsed by the Open Food Facts organization. All data is retrieved from official public Open Food Facts API endpoints in compliance with the Open Database License (ODbL).

# Actor input Schema

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

Product name, brand, or food category (e.g. 'dark chocolate', 'protein bar', 'oat milk', 'ketchup', 'granola').

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

Optional exact EAN-13, UPC, or JAN barcode (e.g. '3046920029759' for Lindt chocolate). Overrides search query if provided.

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

Order of retrieved grocery products.

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

Maximum number of grocery products to scrape (1 to 500).

## `includeNutrition` (type: `boolean`):

Extract full 100g energy, fats, sugars, proteins, and sodium (charged as enriched-nutrition-allergens).

## `includeIngredients` (type: `boolean`):

Extract ingredient text list, traces, and allergen tags.

## `includeScores` (type: `boolean`):

Extract official NutriScore grade, EcoScore grade, and NOVA processing classification.

## Actor input object example

```json
{
  "searchTerms": "chocolate",
  "barcode": "",
  "sortBy": "unique_scans_n",
  "maxResults": 20,
  "includeNutrition": true,
  "includeIngredients": true,
  "includeScores": true
}
```

# Actor output Schema

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

Extracted grocery products, barcodes, brands, NutriScore, EcoScore, ingredients, allergens, and nutritional facts.

# 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 = {
    "searchTerms": "chocolate"
};

// Run the Actor and wait for it to finish
const run = await client.actor("slavako/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 = { "searchTerms": "chocolate" }

# Run the Actor and wait for it to finish
run = client.actor("slavako/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 '{
  "searchTerms": "chocolate"
}' |
apify call slavako/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,slavako/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/84BB5ss0rQfnkwBzJ/builds/HKkgGHbOscKu2if68/openapi.json
