# Open Food Facts Scraper — Nutrition & Barcode Lookup API (`factpipe/open-food-facts-scraper`) Actor

Look up food products by barcode (EAN/UPC) or keyword on Open Food Facts: nutrition per 100g, ingredients, allergens, Nutri-Score, NOVA, Eco-Score, brands. No API key. $1 per 1,000 products.

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

## Pricing

$1.00 / 1,000 product results

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

## Open Food Facts Scraper — Nutrition & Barcode Lookup API

Look up **food products by barcode (EAN/UPC)** or **keyword** and get clean, flat JSON from **Open Food Facts**, the largest open food database (millions of products worldwide): **nutrition facts per 100 g**, ingredients, allergens, traces, **Nutri-Score**, **NOVA group**, **Eco-Score**, brands, categories, labels and product image. Uses only the official Open Food Facts APIs — no HTML scraping, no proxies. Unknown barcodes are free.

### Quick start

1. Click **Start** with the two prefilled barcodes and the search `oat milk`. It finishes in under a minute.
2. You get up to 12 products with nutrition facts, ingredients, Nutri-Score and allergens.
3. That first run costs at most $0.012, well within Apify's free monthly credit. Then swap in your own input or schedule it.

### What you get

One record per product:

```json
{
  "query": "3017624010701",
  "found": true,
  "barcode": "3017624010701",
  "product_name": "Nutella",
  "brands": [
    "Ferrero"
  ],
  "quantity": "400.0 g",
  "serving_size": null,
  "categories": [
    "breakfasts",
    "spreads",
    "sweet-spreads",
    "pates-a-tartiner",
    "hazelnut-spreads",
    "chocolate-spreads",
    "cocoa-and-hazelnuts-spreads",
    "Other"
  ],
  "countries": [
    "france",
    "united-kingdom"
  ],
  "labels": [
    "no-gluten"
  ],
  "packaging": [
    "glass-jar"
  ],
  "ingredients_text": "sugar, palm oil, hazelnuts, skimmed milk powder, fat reduced cocoa, emulsifier, vanillin",
  "allergens": [
    "nuts"
  ],
  "traces": [
    "milk",
    "nuts",
    "soybeans"
  ],
  "nutriscore_grade": "e",
  "nova_group": null,
  "ecoscore_grade": "d",
  "energy_kcal_100g": 539,
  "fat_100g": 30.9,
  "saturated_fat_100g": 10.6,
  "carbohydrates_100g": 57.5,
  "sugars_100g": 56.3,
  "fiber_100g": null,
  "proteins_100g": 6.3,
  "salt_100g": 0.1075,
  "sodium_100g": 0.043,
  "image_url": "https://images.openfoodfacts.org/images/products/301/762/401/0701/front_en.100.400.jpg",
  "last_modified_at": "2026-08-05T16:48:26.000Z",
  "product_url": "https://world.openfoodfacts.org/product/3017624010701",
  "license": "ODbL 1.0 (Open Food Facts contributors)",
  "license_url": "https://opendatacommons.org/licenses/odbl/1-0/",
  "source_url": "https://world.openfoodfacts.org/api/v2/product/3017624010701.json?fields=...",
  "fetched_at": "2026-09-13T12:27:15.518Z"
}
```

### Use cases

- **Nutrition & diet apps**: resolve scanned barcodes to calories, macros, allergens and Nutri-Score.
- **E-commerce & grocery catalogs**: enrich product listings with ingredients, allergens, labels and images.
- **Food research & market analysis**: collect products by keyword and country with Nutri-Score and NOVA processing level.
- **AI agents**: tiny input schema, deterministic output — ideal via API or MCP.

### Input

| Field | Type | Notes |
|---|---|---|
| `barcodes` | string\[] | EAN-13, EAN-8, UPC-A or GTIN-14 |
| `searchTerms` | string\[] | Product keywords, e.g. `peanut butter` |
| `country` | string | Optional search filter, e.g. `united-states`, `france` |
| `maxResultsPerSearch` | integer | Products per search term (default 50, max 1000) |

Crowd-sourced data: some products have incomplete fields; missing values are `null`, never guessed.

### Pricing (pay per event)

| Event | Price | Meaning |
|---|---|---|
| `product-result` | **$1.00 per 1,000** ($0.001 each) | One product with a name or nutrition data delivered. **Unknown barcodes, empty products, duplicates and empty runs are never charged.** No start fee. |

Example: 10,000 products cost **$10.00**. You only pay for delivered results.

### Related factpipe Actors

- [FDA Recalls Scraper API — Food, Drug & Device Recalls](https://apify.com/factpipe/fda-recalls-monitor) — FDA food, drug and device recalls
- [Wikipedia Scraper API — Articles, Summaries & Full Text](https://apify.com/factpipe/wikipedia-scraper) — Wikipedia articles and summaries

### FAQ

**Do I need an Open Food Facts API key?**
No. The official Open Food Facts API is keyless. The Actor sends an identifying User-Agent as Open Food Facts requests and respects its published rate limits.

**Can I look up UPC barcodes from US products?**
Yes. UPC-A (12 digits), EAN-13, EAN-8 and GTIN-14 are accepted; spaces and dashes are removed automatically.

**Can I use the data commercially?**
Open Food Facts data is licensed under the Open Database License (ODbL): commercial use is allowed with attribution, and databases you publish that are derived from it must stay under ODbL. Every record carries `license` and `product_url` for attribution.

**Does it include contributor or user data?**
No. Only product facts are requested; contributor usernames are never collected.

**Can I call it from Python, JavaScript, Make, Zapier or an AI agent?**
Yes. Run it through the Apify API or official Python/JavaScript clients, connect it to Make, Zapier, n8n, Slack or Google Sheets via Apify integrations, or expose it to AI agents through the Apify MCP server. Input is small and output is deterministic flat JSON.

### Reliability

Official Open Food Facts APIs, rate limits respected (product reads and searches paced separately), retries with backoff, structured failure reporting, daily health checks and issue triage.

# Actor input Schema

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

EAN-13, EAN-8, UPC-A or GTIN-14 barcodes. Fastest path; unknown barcodes are free.

## `searchTerms` (type: `array`):

Product keywords, e.g. peanut butter, oat milk, protein bar.

## `country` (type: `string`):

Optional: restrict searches to products sold in a country, e.g. united-states, france, germany, united-kingdom.

## `maxResultsPerSearch` (type: `integer`):

Products returned (and charged) per search term.

## Actor input object example

```json
{
  "barcodes": [
    "3017624010701",
    "0851087000250"
  ],
  "searchTerms": [
    "oat milk"
  ],
  "maxResultsPerSearch": 10
}
```

# Actor output Schema

## `resultsDatasetUrl` (type: `string`):

No description

# 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": [
        "3017624010701",
        "0851087000250"
    ],
    "searchTerms": [
        "oat milk"
    ],
    "maxResultsPerSearch": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("factpipe/open-food-facts-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": [
        "3017624010701",
        "0851087000250",
    ],
    "searchTerms": ["oat milk"],
    "maxResultsPerSearch": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("factpipe/open-food-facts-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": [
    "3017624010701",
    "0851087000250"
  ],
  "searchTerms": [
    "oat milk"
  ],
  "maxResultsPerSearch": 10
}' |
apify call factpipe/open-food-facts-scraper --silent --output-dataset

```

## MCP server setup

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