# Open Food Facts — Product & Nutrition Data by Barcode (`omao/openfoodfacts`) Actor

Look up food products by barcode and get clean JSON: name, brand, quantity, Nutri-Score, NOVA group, Eco-Score, ingredients, allergens and per-100g nutrition (calories, fat, sugar, protein, salt). Powered by Open Food Facts. No API key.

- **URL**: https://apify.com/omao/openfoodfacts.md
- **Developed by:** [Marouane Oulabass](https://apify.com/omao) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 products

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 — Product & Nutrition Data by Barcode (JSON)

**Look up food products by barcode — and get clean nutrition JSON.** Pass barcodes and get back a tidy row per product: name, brand, quantity, Nutri-Score, NOVA group, Eco-Score, ingredients, allergens and per-100g nutrition (calories, fat, sugar, protein, salt). Powered by Open Food Facts — no API key.

The easy way to enrich catalogs, diet apps and research with food and nutrition data.

### Who uses this

- 🥗 **Diet & nutrition apps** — show Nutri-Score, calories and ingredients.
- 🛒 **Grocery & e-commerce** — enrich product pages by barcode.
- 🏥 **Health & research** — study nutrition, additives and labels at scale.
- ♻️ **Sustainability tools** — surface Eco-Score and packaging info.
- 🧑‍💻 **Developers** — a clean food-data endpoint by barcode.

### What you get — one clean row per product

| Field | Description |
|---|---|
| `name` + `brands` | Product & brand |
| `quantity` | Package size |
| `categories` | Product categories |
| `nutriscore` | Nutri-Score (A–E) |
| `novaGroup` | NOVA processing group (1–4) |
| `ecoscore` | Eco-Score |
| `ingredientsText` | Ingredients |
| `allergens` + `labels` | Allergens & labels |
| `servingSize` | Serving size |
| `countries` | Sold-in countries |
| `imageUrl` + `url` | Image & product page |
| `found`, `barcode`, `scrapedAt` | Status & provenance |

### Example

**Input**

```json
{ "barcodes": ["3017620422003", "5449000000996"] }
```

**Output (one item)**

```json
{
  "barcode": "3017620422003",
  "found": true,
  "name": "Nutella", "brands": "Ferrero",
  "quantity": "400 g", "nutriscore": "e", "novaGroup": 4,
  "allergens": "en:milk, en:nuts, en:soybeans",
  "url": "https://world.openfoodfacts.org/product/3017620422003"
}
```

### Why this actor

- ✅ **Rich nutrition data** — Nutri-Score, NOVA, Eco-Score and per-100g values.
- 🧾 **Ingredients & allergens** — ready for diet and health apps.
- 🌍 **Global database** — millions of products worldwide.
- 🖼️ **Product images** — image URLs included.
- ⚡ **Fast & affordable** — pay only per product returned. No API key.

### Input options

- `barcodes` *(required)* — product barcodes (EAN/UPC) to look up.

### FAQ

**What barcode formats work?** Standard EAN/UPC barcodes as printed on packaging.

**What if a product isn't in the database?** The row is returned with `found: false` so you can tell.

**Do I get Nutri-Score and NOVA?** Yes — plus Eco-Score, ingredients and allergens when available.

**How fresh is the data?** Live from Open Food Facts on every run.

**Can I export to CSV/Excel/Google Sheets?** Yes — the dataset exports to JSON, CSV, Excel and HTML, or pull it via the API.

**What does it cost?** Pay-per-product — you're only charged for products actually returned.

***

*Tip: feed your inventory barcodes through this to enrich every SKU with nutrition and labels.*

# Actor input Schema

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

Product barcodes (EAN/UPC) to look up.

## `healthCheckMode` (type: `boolean`):

Internal monitoring: look up a canary product and FAIL if broken (no billing).

## Actor input object example

```json
{
  "barcodes": [
    "5449000000996",
    "7622210449283"
  ],
  "healthCheckMode": false
}
```

# Actor output Schema

## `products` (type: `string`):

All products (name, brand, Nutri-Score, NOVA, nutrition per 100g, ingredients).

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("omao/openfoodfacts").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"] }

# Run the Actor and wait for it to finish
run = client.actor("omao/openfoodfacts").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"
  ]
}' |
apify call omao/openfoodfacts --silent --output-dataset

```

## MCP server setup

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

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/QZaQDRXdAOQNC5htf/builds/p8rZmvRoYxFczhRvD/openapi.json
