# Open Food Facts EAN UPC GTIN Lookup (`automation-lab/ean-upc-gtin-product-lookup`) Actor

Resolve food-product EAN, UPC, and GTIN barcodes into normalized Open Food Facts identity, ingredient, nutrition, image, provenance, and status records.

- **URL**: https://apify.com/automation-lab/ean-upc-gtin-product-lookup.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.04 / 1,000 item extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 EAN UPC GTIN Lookup

Resolve batches of food-product EAN, UPC, and GTIN barcodes into normalized **openfoodfacts** records. The Actor returns product identity, brands, categories, ingredients, allergens, nutrition, food scores, images, source revisions, and an explicit status for every unique lookup.

It uses the anonymous Open Food Facts API. No API key, browser, proxy, or customer account is required.

### What can you do with this Open Food Facts lookup?

- Enrich grocery catalogs with product names, brands, package sizes, and categories.
- Validate barcode lists and separate found, not-found, and temporary lookup-error records.
- Add ingredients, allergens, Nutri-Score, NOVA group, Eco-Score, and per-100g nutrition to product data.
- Audit source freshness with Open Food Facts creation, modification, and revision metadata.
- Run repeatable barcode batches from Apify schedules, API clients, webhooks, or MCP tools.

This Actor is source-specific and food-focused. For a broader multi-database lookup with fewer food-specific fields, use [UPC Barcode Product Lookup](https://apify.com/automation-lab/upc-barcode-lookup).

### Who is this Actor for?

- **E-commerce catalog teams** matching supplier GTINs to readable food-product data.
- **Nutrition and diet app developers** importing ingredients and nutrition facts.
- **Data quality teams** checking whether barcode identifiers have public product records.
- **Market researchers** creating source-attributed food assortments.
- **Automation engineers** resolving recurring barcode batches without maintaining an Open Food Facts API client.

### Input

Provide `codes` as strings so leading zeroes are preserved.

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `codes` | string array | required | Valid EAN-8/GTIN-8, UPC-A, EAN-13, or GTIN-14 barcodes. Spaces and hyphens are accepted. |
| `maxItems` | integer | `100` | Maximum unique barcodes processed after deduplication, from 1 to 500. |
| `maxConcurrency` | integer | `3` | Concurrent source requests, from 1 to 5. Keep the default for stable, respectful access. |

```json
{
  "codes": ["3017620422003", "5449000000996", "2225954479223"],
  "maxItems": 3,
  "maxConcurrency": 2
}
```

Each barcode is validated with its standard GTIN check digit before any request starts. Duplicate inputs are looked up once and reported in `duplicateCount`.

### Output fields

The default dataset contains one row per unique processed barcode.

| Group | Fields |
| --- | --- |
| Identifier | `inputCode`, `gtin`, `format`, `status`, `duplicateCount` |
| Identity | `productName`, `genericName`, `brands`, `categories`, `quantity` |
| Ingredients | `ingredientsText`, `allergens`, `labels`, `countries` |
| Scores | `nutriScoreGrade`, `novaGroup`, `ecoScoreGrade` |
| Nutrition | `nutritionPer100g.energyKcal`, fat, saturated fat, carbohydrates, sugars, fiber, proteins, salt, sodium |
| Images | `images.front`, `images.ingredients`, `images.nutrition` |
| Provenance | `sourceUrl`, `sourceApiUrl`, `sourceRevision`, `sourceCreatedAt`, `sourceLastModifiedAt`, `lookedUpAt` |
| Failure detail | `error` for exhausted transient failures |

`status` is `found`, `not_found`, or `lookup_error`. Missing optional Open Food Facts fields are returned as `null` or empty arrays rather than guessed.

### Example product record

```json
{
  "inputCode": "3017620422003",
  "gtin": "3017620422003",
  "format": "EAN-13",
  "status": "found",
  "productName": "Nutella",
  "brands": ["nutella", "ferrero"],
  "categories": ["spreads", "sweet spreads"],
  "quantity": "400 g",
  "nutriScoreGrade": "e",
  "novaGroup": 4,
  "nutritionPer100g": {
    "energyKcal": 539,
    "fat": 30.9,
    "sugars": 56.3,
    "proteins": 6.3
  },
  "sourceUrl": "https://world.openfoodfacts.org/product/3017620422003",
  "duplicateCount": 1,
  "error": null
}
```

Source records are community-maintained and can change. Treat the example as a shape illustration, not a permanent claim about that product.

### How much does it cost to look up Open Food Facts products?

Pay-per-event pricing has a **$0.005 run-start fee** plus a tiered lookup-record event. At the BRONZE tier, each found or confirmed not-found record is **$0.0084**.

BRONZE calculation examples:

| Unique barcodes | Billing formula |
| ---: | --- |
| 1 | one run-start event + one item event |
| 10 | one run-start event + ten item events |
| 100 | one run-start event + one hundred item events |

Your Apify pricing tier may have a different per-record rate. Duplicates beyond their first occurrence do not create another lookup record or item charge.

### Getting started

1. Open the Actor in Apify Console.
2. Paste real barcode strings into **EAN, UPC, or GTIN codes**.
3. Keep concurrency at 3 unless you have a reason to lower it.
4. Click **Start**.
5. Review the Product lookups dataset view.
6. Export JSON, CSV, Excel, XML, or RSS, or connect the dataset to another workflow.

### Catalog enrichment workflow

Run the Actor with a supplier barcode column, then join the output back to your catalog on `gtin`. Use `status` to route records:

- `found`: import reviewed identity and food-specific fields;
- `not_found`: send to a manual data-completion queue;
- `lookup_error`: retry later because the source request failed temporarily.

For change monitoring, schedule the same task and compare `sourceRevision` or `sourceLastModifiedAt` with your previous dataset. The Actor reports timestamps; it does not itself store diffs or send alerts.

### Use the Actor with the Apify API

Replace `YOUR_TOKEN` with an Apify API token.

#### cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~ean-upc-gtin-product-lookup/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"codes":["3017620422003","5449000000996"],"maxItems":2}'
```

#### JavaScript

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/ean-upc-gtin-product-lookup').call({
  codes: ['3017620422003', '5449000000996'],
  maxItems: 2,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("automation-lab/ean-upc-gtin-product-lookup").call(
    run_input={"codes": ["3017620422003", "5449000000996"], "maxItems": 2}
)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

### Use with MCP and AI agents

#### Claude Code

Add the Actor to Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/ean-upc-gtin-product-lookup"
```

#### Claude Desktop, Cursor, and VS Code

Use this MCP server configuration in Claude Desktop, Cursor, or VS Code:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/ean-upc-gtin-product-lookup"
    }
  }
}
```

Example prompts:

- “Look up these grocery GTINs and return only products containing milk allergens.”
- “Resolve this supplier barcode batch and summarize all not-found identifiers.”
- “Compare the Open Food Facts source revision fields in these two run datasets.”

### Legality and responsible use

Open Food Facts is a collaborative database. Records may be incomplete, multilingual, outdated, or entered differently across markets. Verify important nutrition, allergen, safety, and compliance decisions against packaging or an authoritative source. This Actor normalizes public fields but does not certify their accuracy.

Use the data in accordance with Open Food Facts terms and database licensing requirements. Preserve attribution and share-alike obligations where they apply. Do not use this Actor to make unsupported medical or health claims.

### Limits and failure behavior

- Only standard 8, 12, 13, and 14 digit GTIN formats are accepted.
- Invalid lengths or check digits fail the run before charging the start event.
- At most 500 unique codes are processed per run.
- The Actor does not search by product name, category, brand, or image.
- The source can return products with only some fields populated.
- Transient 429, 5xx, timeout, and network failures are retried with backoff.
- An exhausted source failure produces a `lookup_error` row for diagnosis.
- No proxy fallback is used or needed for the public API route.

### Troubleshooting

**The run says the check digit is wrong.** Confirm that the full printed barcode was copied, including leading zeroes. Supply codes as strings, not spreadsheet numbers.

**A known product is `not_found`.** Check the product page URL in the output and retry the exact code. Open Food Facts may not contain that regional code or may store a different package variant.

**Some nutrition fields are null.** The source record did not expose those values. The Actor does not infer missing nutrition.

**I received `lookup_error`.** Inspect `error` and the run log, then retry later.

### FAQ

#### Does the OpenFoodFacts API require a key?

No. This Actor uses anonymous product lookup with a descriptive User-Agent. Your Apify token is still required when starting the Actor through Apify API or MCP.

#### Can I look up UPC codes with leading zeroes?

Yes. Enter them as strings. The output preserves the normalized submitted identifier and reports `format` as `UPC-A`.

#### Does the Actor download images?

No. It returns public image URLs, avoiding unnecessary transfer and storage costs.

#### Can I monitor product changes?

Yes. Schedule recurring runs and compare source revision or modification fields downstream. The Actor does not send alerts by itself.

#### Are not-found rows charged?

Yes, because they are confirmed lookup results and support validation workflows.

### Related Automation Lab Actors

- [UPC Barcode Product Lookup](https://apify.com/automation-lab/upc-barcode-lookup) — broader multi-source product identity lookup.
- [ASDA Grocery Products & Prices Scraper](https://apify.com/automation-lab/asda-grocery-products-prices) — UK grocery assortment and price monitoring.

# Actor input Schema

## `codes` (type: `array`):

Barcode identifiers to look up. Supports valid GTIN-8/EAN-8, UPC-A (12 digits), EAN-13, and GTIN-14 values. Use strings to preserve leading zeroes.

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

Maximum number of unique valid barcodes to process after deduplication.

## `maxConcurrency` (type: `integer`):

Concurrent Open Food Facts requests. Keep the default for respectful API use and stable retries.

## Actor input object example

```json
{
  "codes": [
    "3017620422003",
    "5449000000996",
    "9999999999994"
  ],
  "maxItems": 10,
  "maxConcurrency": 3
}
```

# Actor output Schema

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

Dataset containing one record per unique processed barcode.

# 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 = {
    "codes": [
        "3017620422003",
        "5449000000996",
        "9999999999994"
    ],
    "maxItems": 10,
    "maxConcurrency": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/ean-upc-gtin-product-lookup").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 = {
    "codes": [
        "3017620422003",
        "5449000000996",
        "9999999999994",
    ],
    "maxItems": 10,
    "maxConcurrency": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/ean-upc-gtin-product-lookup").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 '{
  "codes": [
    "3017620422003",
    "5449000000996",
    "9999999999994"
  ],
  "maxItems": 10,
  "maxConcurrency": 3
}' |
apify call automation-lab/ean-upc-gtin-product-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/ean-upc-gtin-product-lookup"
        }
    }
}

```

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/CI4btWVOrBPE0tCow/builds/traAKYy2U6JGOWr39/openapi.json
