# Barcode Lookup API — EAN, UPC & GTIN Product Enrichment (`s-r/gtin-product-enrich`) Actor

Turn bulk EAN, UPC and GTIN codes into one product record each: title, brand, category, description, images and size, plus ingredients, allergens, nutrition per 100 g and Nutri-Score for food. Every field carries its source. For catalogue teams, pricing tools and food apps.

- **URL**: https://apify.com/s-r/gtin-product-enrich.md
- **Developed by:** [SR](https://apify.com/s-r) (community)
- **Categories:** E-commerce, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.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

## Barcode Lookup — GTIN Product Enrichment

Use this barcode lookup to turn EAN, UPC and GTIN codes into product records for catalogue enrichment. It combines available product content from UPCitemdb with food label information from Open Food Facts for the same barcode identity. Each usable product becomes one dataset row, including the source information needed to assess the result.

This Actor is useful when a retailer needs product titles and images, a catalogue team needs brand and category text, or a food application needs available ingredients and nutrition labels. Coverage depends on the two source databases. Some codes have no record, some products have incomplete labels, and the sources sometimes disagree. The output reports those differences instead of presenting database content as verified product truth.

### Barcode lookup input

Provide `gtins` as a list of one to one hundred barcode strings or whole numbers. The alternative name `barcodes` accepts the same list; provide only one of these fields. Supported formats are GTIN-8, UPC-A, EAN-13 and GTIN-14 with a valid check digit. Use strings for codes with leading zeroes, because numbers cannot preserve them. An incorrect code is rejected before any product lookup starts.

Equivalent zero-padded codes are combined into one identity. The first normalized input form becomes `gtin`, and `input_gtins` preserves the distinct input aliases. A packaging GTIN with a nonzero packaging indicator remains a separate identity. A carton and its consumer unit are not automatically treated as the same product.

The optional `country` uses a two-letter country code and defaults to US. It is request context, not proof that a product is sold or manufactured in that country. The optional `language` defaults to English. Available language-specific food names and ingredients are selected when present. Otherwise the source text is returned with its actual language or an explicit unknown-language indication. The Actor does not translate labels.

Use `fields` to select `core`, `images`, `dimensions`, `ingredients`, `allergens`, `nutrition` and `scores`. All groups are selected by default. Source checks and product identity remain the same when fewer groups are returned. Provenance, source status and differences remain available so a compact response is still auditable.

### Barcode lookup output and product content

The dataset contains only usable products. A usable product needs a matching barcode and an actual product name from at least one source. Missing codes, empty database stubs and lookup failures do not become paid diagnostic rows. The run output also contains diagnostics for those cases, progress information and readable warnings.

Core content includes `gtin`, `title`, `brand`, `category` and `description` when present. Generic content prefers UPCitemdb; Open Food Facts fills missing values. `images` contains available image URLs and `image_url` matches the first image. These are links, not downloaded or independently checked image files. Size, weight, dimensions and package quantity retain their source meaning without inferred conversions.

Food content can include ingredient text, allergen tags, possible traces, nutrients, Nutri-Score and NOVA. These groups come only from Open Food Facts for the same identity. Ingredients and scores are label/database information, not medical advice or an independent assessment. Missing allergen information never proves that a product is allergen-free. Possible traces are kept separate from listed allergens.

Nutrition is reported per 100 grams only when the source explicitly provides that reference basis. A source basis of 100 millilitres produces `nutrition_per_100ml`. An unknown basis remains unknown. Only numeric nutrient values with confirmed units are included; missing values do not become zero. The Actor does not mix serving values, prepared-product values or ingredient estimates into the reported table, and does not calculate density, energy or salt conversions.

Every selected source value is traceable through `provenance`, including the source name, source barcode, public API URL, retrieval time and source field. `source_status` distinguishes found content, confirmed misses, empty records and failures. `conflicts` preserves different source titles, brands, categories and quantities. A disagreement is a review signal, not proof that either database is correct.

#### Example: a food record from one barcode

Input `{"gtins": ["54491472"], "language": "en", "country": "NL"}` delivered the row below. The row is abbreviated for readability: in the delivered dataset every selected value also carries `provenance` (source, source barcode, API URL, retrieval time and source field), and `nutrition_per_100ml` carries a `source_field` per nutrient.

```json
{
  "gtin": "54491472",
  "input_gtins": ["54491472"],
  "title": "3 Packs Of 24 X 500ml Coke Bottle (coca Cola)",
  "brand": "Coca-Cola Hbc Northern Ireland",
  "category": "Health & Beauty > Health Care",
  "images": ["https://images.openfoodfacts.org/images/products/000/005/449/1472/front_en.801.400.jpg"],
  "image_url": "https://images.openfoodfacts.org/images/products/000/005/449/1472/front_en.801.400.jpg",
  "dimensions": {"quantity": "500 ml", "quantity_value": 500, "quantity_unit": "ml"},
  "food": {
    "ingredients": "Carbonated Water. Sugar. Colour (Caramel E150d). Acid (Phosphoric Acid). Natural Flavourings, Caffeine Flavouring",
    "ingredients_language": "en",
    "allergens": [],
    "traces": [],
    "nutrition_basis": "100ml",
    "nutrition_per_100ml": {
      "energy_kcal": {"value": 44, "unit": "kcal"},
      "sugars": {"value": 10.9, "unit": "g"},
      "salt": {"value": 0, "unit": "g"}
    },
    "nutriscore_grade": "e",
    "nova_group": 4
  },
  "conflicts": [
    {
      "field": "title",
      "selected_source": "upcitemdb",
      "values": [
        {"value": "3 Packs Of 24 X 500ml Coke Bottle (coca Cola)", "provenance": {"source": "upcitemdb"}},
        {"value": "Cola", "provenance": {"source": "openfoodfacts"}}
      ]
    }
  ],
  "source_status": {
    "upcitemdb": {"status": "found"},
    "openfoodfacts": {"status": "found"}
  }
}
```

Three things in that row are worth reading closely. The nutrition reference basis is `100ml`, so the nutrients live in `nutrition_per_100ml` and are never relabelled as per 100 grams. The empty `allergens` list is empty label data, not a statement that the drink contains no allergens. And the two databases returned different titles for the same barcode, so the conflict is reported with both values instead of being silently resolved.

A non-food barcode behaves the same way without the food groups. `4002293401102` returned `title` `Wusthof Gourmet 3-Inch Serrated Paring Knife`, `brand` `W?sthof`, the category `Home & Garden > Kitchen & Dining > Kitchen Tools & Utensils` and five image links from the product database, while `source_status.openfoodfacts.status` reads `not_found`. That is a complete successful lookup: one source has the product, the other database simply has no record for that code.

### Barcode lookup use cases

- **Catalogue enrichment.** A retailer or marketplace imports a spreadsheet of barcodes and needs title, brand, category, description, images and size per code before a listing can go live. One row per usable barcode, one cursor per page of a larger import.
- **Feeding price comparison and shopping feeds.** Tools that match offers on EAN, UPC or GTIN need the canonical product text behind a code, so an offer can be attached to a product instead of to a bare number.
- **Food and nutrition applications.** Grocery, diet and health apps look up a barcode and want ingredients, allergens, nutrients per 100 grams or 100 millilitres, Nutri-Score and NOVA group on the same identity as the catalogue text.
- **Data quality review.** Where two databases disagree, `conflicts` gives both values with their sources, which turns a data-cleaning backlog into a review queue with evidence instead of a guess.
- **Selective fields.** Run with `fields` reduced to what the task needs, for example `core` and `images` for a catalogue load, or `ingredients`, `allergens`, `nutrition` and `scores` for a food label check, without losing provenance.

### Barcode lookup compared with the alternatives

Free barcode lookup websites such as barcodelookup.com and go-upc.com answer one code at a time behind an advertising-supported page. They are fine for a single question in a browser; they do not take a hundred codes, return structured rows with per-field provenance, or add food label data to the same identity.

GS1 services answer a different question: who owns a prefix, a company or a code range. That is registration and identifier governance, not product content. A GS1 lookup will not give you a title, an image or a nutrition table.

Looking up a code against a single database leaves a systematic hole. A product database can carry titles, images and dimensions while the food label fields are missing; a food database carries ingredients, allergens and nutrition while plenty of non-food products are simply absent, and its catalogue text is often thinner. Open Food Facts alone cannot enrich a kitchen knife, and a catalogue database alone cannot tell you the Nutri-Score.

This Actor queries both databases for the same barcode identity, applies a documented source priority per field group, keeps the nutrition reference basis of the source, and reports misses, empty records and disagreements as status rather than as invented content. Bulk input, field selection and a continuation cursor for larger sets are part of the request, not a wrapper you have to build. The Store also holds narrower companions: a barcode register lookup that stops at manufacturer and country text, image search by EAN, and a food-only nutrition lookup. This listing is the combined product record.

### Pricing and free-plan limits

The billing unit is one usable product successfully delivered to the dataset. There is no separate product charge for a missing code, an ingredient field, a food score, a source difference or a continuation page. Review the current price displayed on this listing before starting a run; this documentation does not set a marketplace price.

Free-plan runs examine at most ten input positions and deliver at most ten products. A miss among those positions does not cause additional positions from a larger list to be examined. The same field groups and provenance are available within that limit. A paid run accepts up to one hundred input positions, subject to source availability and the stated input requirements.

### Barcode lookup progress and incomplete enrichment

Large lists are processed in successive bounded requests. The Actor collects continuation pages automatically within its run budget. API users receive `pagination.next_cursor` and repeat the original normalized input and options with that cursor. Completed products are not repeated during normal sequential continuation. Keep continuation tokens private and use them within twenty-four hours.

A continuation page can legitimately deliver zero products when every code on that page is a confirmed miss in both databases; the page still returns the next cursor, so an empty page in the middle of a larger set is not the end of the list and costs nothing. Continuing with a token that has expired, was altered, or was issued for a different input is rejected with `invalid_input` before any product lookup starts, so a truncated or edited cursor never turns into a silent partial result.

A failed requested source can leave a usable product with partial enrichment. Its source status and warnings explain the missing stage. A confirmed non-food record can still be a complete successful lookup even when the food database has no matching record. The Actor does not promise complete coverage of all issued barcodes, current prices, inventory, verified GS1 ownership or verified market availability.

### Barcode lookup FAQ

#### Can this barcode lookup handle an unknown code?

Yes. A correctly formatted code is checked in both sources. If neither provides a usable product, no product row is delivered or charged. Diagnostics distinguish a confirmed miss from a source failure.

#### Why can the product title and food label disagree?

The sources are independent databases and can contain incomplete, outdated or incorrect contributions. The Actor follows its documented source priority and exposes the competing values in `conflicts` for review.

#### Does an empty allergen list mean the food is safe for an allergy?

No. Empty or missing label data is not evidence of absence. Consult the original product label and appropriate professional guidance when food allergies matter.

#### Can I look up more than one hundred barcodes in a run?

One run accepts up to one hundred input positions. For a larger set, send the first batch, read `pagination.next_cursor`, and repeat the normalized input and options with that cursor. Products already delivered are not repeated during normal sequential continuation.

#### Can I reuse the food data and images?

Open Food Facts data is supplied under its applicable open-data terms, including attribution and ODbL obligations. Image rights are separate. Preserve source attribution and check the relevant reuse terms for your application; the Actor does not grant additional rights over source content.

# Actor input Schema

## `gtins` (type: `array`):

GTIN-8, UPC-A, EAN-13 or GTIN-14 codes with valid check digits. Use strings to preserve leading zeroes.

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

Alias for gtins. Provide only one of the two lists.

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

ISO country code for request routing; not a verified product market.

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

ISO language code for available source labels. Falls back to source text; no translation.

## `fields` (type: `array`):

Field groups to return. Both sources are checked regardless of selection.

## `cursor` (type: `string`):

Protected continuation token. Repeat the original input and options.

## Actor input object example

```json
{
  "gtins": [
    "3017620422003"
  ],
  "country": "US",
  "language": "en",
  "fields": [
    "core",
    "images",
    "dimensions",
    "ingredients",
    "allergens",
    "nutrition",
    "scores"
  ]
}
```

# Actor output Schema

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

One usable product per unique GTIN, with available product details, food label data and field-level sources. Missing barcodes produce no dataset row.

## `output` (type: `string`):

OUTPUT record with the run's counts and status flags.

## `errors` (type: `string`):

Failures with a code and a redacted message. Absent when the run had none.

# 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 = {
    "gtins": [
        "3017620422003"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/gtin-product-enrich").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 = { "gtins": ["3017620422003"] }

# Run the Actor and wait for it to finish
run = client.actor("s-r/gtin-product-enrich").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 '{
  "gtins": [
    "3017620422003"
  ]
}' |
apify call s-r/gtin-product-enrich --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,s-r/gtin-product-enrich"
        }
    }
}
```

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/kWHj5y2TZ69DawyW6/builds/ScssjDKZssSrYKrXX/openapi.json
