# Open Food Facts Scraper — Nutrition, NutriScore & Barcodes (`parsing_machine/openfoodfacts-scraper`) Actor

Scrape food product data from Open Food Facts (world.openfoodfacts.org) via the official public API. Lookup by barcode or full-text search. Returns nutrition per 100g, NutriScore (a-e), NOVA group, eco-score, ingredients, allergens, brands, and images. No auth required. Pay per result.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Scraper — Nutrition, NutriScore & Barcodes | from $0.50/1K

**Built for nutrition-app developers, food-tech teams, and LLM pipelines** that need structured product data by barcode (EAN-13, UPC) or keyword — NutriScore, NOVA group, allergens, and 25+ fields per product. Official Open Food Facts API, no proxy, no auth.

Scrape food product data from [Open Food Facts](https://world.openfoodfacts.org) via the official public API. Lookup products by **barcode** (EAN-13, UPC) or **full-text search**. Returns a flat, analysis-ready record per product.

### What you get per product

| Field | Example |
|---|---|
| `barcode` | `737628064502` |
| `product_name` | `Thai peanut noodle kit` |
| `brands` | `Simply Asia` |
| `nutriscore_grade` | `d` |
| `nova_group` | `4` (1=unprocessed → 4=ultra-processed) |
| `ecoscore_grade` | `c` |
| `energy_kcal_100g` | `385.0` |
| `fat_100g`, `saturated_fat_100g` | `7.69`, `1.5` |
| `sugars_100g`, `fiber_100g` | `13.46`, `2.1` |
| `proteins_100g`, `salt_100g` | `8.3`, `0.72` |
| `ingredients_text` | `Rice Noodles (rice, water)...` |
| `categories` | `["plant-based-foods", "pastas"]` |
| `allergens` | `["peanuts", "soybeans"]` |
| `labels` | `["organic", "gluten-free"]` |
| `countries` | `["france", "united-states"]` |
| `image_url` | `https://images.openfoodfacts.org/...` |
| `url` | `https://world.openfoodfacts.org/product/...` |
| `parse_confidence` | `0.95` |

### Use cases

- **Nutrition apps** — bulk-import product data by barcode list
- **Diet trackers** — filter by NutriScore or NOVA group
- **Food research** — export full ingredient & allergen data for analysis
- **Retail / e-commerce** — enrich product catalog with nutrition info
- **Price comparison apps** — add nutritional context to product listings

### Input

```json
{
  "barcodes": ["737628064502", "3017620422003"],
  "searchQueries": ["organic yogurt", "gluten free pasta"],
  "maxItems": 200,
  "language": "en",
  "pageSize": 50,
  "skipNotFound": true
}
```

### Why this scraper?

- **Official API** — no scraping, no blocks, 100% reliable
- **Full nutritional panel** — competitors return <10 fields; we return 25+
- **NutriScore + NOVA + Eco-Score** in one record
- **Pagination** — search results paginated automatically up to `maxItems`
- **Confidence tracking** — every record includes `parse_confidence` and `warnings` so you know immediately if a product entry is sparse

### Pricing

Pay-per-result (PPE): **from $0.50 per 1,000 products**. No subscription. You pay only for what you extract.

| Volume | Cost |
|--------|------|
| 100 products | ~$0.05 |
| 1,000 products | ~$0.50 |
| 10,000 products | ~$5.00 |

***

### FAQ

**Do I need a proxy or API key?**
No. Open Food Facts is a public database with no authentication required — zero setup, zero friction.

**What output formats are available?**
JSON, CSV, and Excel — downloadable from the Apify dataset UI or via the REST API.

**Can I schedule this to run automatically?**
Yes. Use Apify's scheduler to keep your product database fresh on a cron schedule, with webhook delivery to your pipeline.

**What if a barcode is not found or returns an empty result?**
With `skipNotFound: true` (default), missing barcodes are silently skipped. With `skipNotFound: false`, a stub record with `parse_confidence=0` and `warnings=["product_not_found"]` is emitted — useful for auditing your barcode list.

### Data source

[Open Food Facts](https://world.openfoodfacts.org) — a free, open, collaborative database of food products from around the world. Licensed under [ODBL](https://opendatacommons.org/licenses/odbl/1-0/).

***

### Use with AI agents (MCP)

This actor is available as an MCP tool for Claude, GPT-4, and other AI agents that support the Model Context Protocol:

```
https://mcp.apify.com/?tools=bovi/openfoodfacts-scraper
```

Pass a barcode or food keyword and get back full nutritional panels — ideal for AI diet assistants, meal-planning apps, and food-labeling pipelines.

***

### vs. competitors

| | **This actor** | Typical food scraper |
|---|---|---|
| Data source | Official Open Food Facts API | HTML scraping / third-party aggregator |
| NutriScore + NOVA + Eco-Score | ✓ | Rarely all three |
| Barcode lookup (EAN-13/UPC) | ✓ | Sometimes |
| `parse_confidence` | ✓ | No |
| Proxy needed | No | Often required |
| Price | from $0.50/1K | $3–10/1K |

### Integrations

Built for nutrition-app developers and food-tech teams resolving barcodes to NutriScore, allergens, and macro data — the JSON/dataset output drops into the tools you already run, no glue code:

- **n8n / Make / Zapier** — trigger a run or pipe every new dataset item into 500+ apps (Google Sheets, Airtable, Slack, HubSpot, your database) with no code: [n8n](https://docs.apify.com/platform/integrations/n8n), [Make](https://docs.apify.com/platform/integrations/make), [Zapier](https://docs.apify.com/platform/integrations/zapier).
- **Webhooks** — fire your own endpoint the moment a run finishes, to push results straight into your pipeline ([docs](https://docs.apify.com/platform/integrations/webhooks)).
- **MCP server** — expose this actor as a tool to Claude, Cursor, or any [MCP client](https://mcp.apify.com) so an AI agent can pull this data mid-conversation ([guide](https://blog.apify.com/how-to-use-mcp/)).
- **API & SDKs** — fetch the dataset as JSON, CSV, or Excel through the Apify REST API or the Python / JS SDKs.

See all [Apify integrations](https://apify.com/integrations).

# Actor input Schema

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

List of product barcodes to look up (EAN-8, EAN-13, UPC-A, UPC-E formats all work). Example: 737628064502, 3017620422003. Leave empty to use searchQueries instead.

## `searchQueries` (type: `array`):

Full-text search queries for Open Food Facts (e.g. 'nutella', 'organic yogurt', 'gluten free bread'). Each query fetches up to maxItems products. Searches are paginated automatically.

## `maxItems` (type: `integer`):

Maximum total products to return across all barcodes and search queries. 0 = no limit. Default 100. Each barcode counts as 1; search queries are paginated up to this cap.

## `language` (type: `string`):

Preferred language for product names and ingredients text. ISO 639-1 code, e.g. 'en', 'fr', 'de', 'es'. Falls back to the stored language if the preferred language is not available. Default: en

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

Number of products to request per page during search (1–100). Default 50. Lower values reduce memory; higher values reduce total API calls.

## `skipNotFound` (type: `boolean`):

If true (default), barcodes with no product entry are silently skipped. If false, a stub record is emitted with parse\_confidence=0 and warnings=\['product\_not\_found'].

## Actor input object example

```json
{
  "barcodes": [
    "737628064502",
    "3017620422003"
  ],
  "searchQueries": [],
  "maxItems": 100,
  "language": "en",
  "pageSize": 50,
  "skipNotFound": true
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset containing Openfoodfacts Scraper records (product\_name, brands, barcode, quantity, nutriscore\_grade, nova\_group, ecoscore\_grade, energy\_kcal\_100g, categories, countries, url, parse\_confidence).

# 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": [
        "737628064502",
        "3017620422003"
    ],
    "searchQueries": [],
    "maxItems": 100,
    "language": "en",
    "pageSize": 50,
    "skipNotFound": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsing_machine/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": [
        "737628064502",
        "3017620422003",
    ],
    "searchQueries": [],
    "maxItems": 100,
    "language": "en",
    "pageSize": 50,
    "skipNotFound": True,
}

# Run the Actor and wait for it to finish
run = client.actor("parsing_machine/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": [
    "737628064502",
    "3017620422003"
  ],
  "searchQueries": [],
  "maxItems": 100,
  "language": "en",
  "pageSize": 50,
  "skipNotFound": true
}' |
apify call parsing_machine/openfoodfacts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parsing_machine/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/KsgmM5kqRuk1QROFR/builds/egSXZoPgxyQrnyhCN/openapi.json
