# Bulk Barcode Check-Digit Validator: EAN, UPC (`comall-agency/barcode-checkdigit-validator`) Actor

Validate GS1 check digits for EAN-13, EAN-8 and UPC-A barcodes in bulk, or compute the missing digit for a code sent one digit short. The mode is picked per code, so mixed batches work in one run. Pure algorithm: no product database, no third-party API, no signup.

- **URL**: https://apify.com/comall-agency/barcode-checkdigit-validator.md
- **Developed by:** [Comall Agency](https://apify.com/comall-agency) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 barcode checkeds

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

## Barcode Check-Digit Validator — EAN-13, EAN-8, UPC-A

Catch a mistyped barcode before it reaches a label, a product feed or a
warehouse system. This Actor validates the GS1 check digit of a batch of
barcodes, and — if you send a code that is one digit short — computes the
check digit you are missing.

Pure algorithm. No third-party API, no signup, no API key, and no network
call of any kind during the check.

### What it does

Every EAN-13, EAN-8 and UPC-A barcode ends with a check digit derived from
the digits before it by the standard GS1 weighting scheme (alternating 3
and 1, summed, then subtracted from the next multiple of ten). This Actor
applies that scheme in both directions:

- **Validate mode** — you send a complete code, it recomputes the expected
  check digit and tells you whether the one you sent matches.
- **Compute mode** — you send a code one digit short, it returns the code
  completed with the correct check digit.

The mode is chosen automatically from the length of what you send, so a
mixed batch of complete and partial codes works in a single run.

### Use cases

- **Product feeds and catalogues** — check a supplier's GTIN column before
  importing it, instead of discovering the bad rows downstream.
- **Label printing** — verify a code before committing it to physical
  labels, where a mistake costs a reprint.
- **Warehouse and ERP data cleanup** — bulk-check barcodes exported from a
  spreadsheet or an ERP in one run.
- **Building a code** — you have the GS1 prefix and item reference and need
  the trailing check digit computed correctly.

### Input

```json
{ "codes": ["4006381333931", "036000291452", "7351353", "400638133393"] }
```

`codes` is the only field, and it is required. Send full codes, partial
codes, or a mix of both.

### Output (one row per code)

```json
{
  "input": "4006381333931",
  "format": "EAN-13",
  "mode": "validate",
  "valid": true,
  "expected_check_digit": 1,
  "corrected_code": "4006381333931",
  "verdict": "valid"
}
```

### Pricing

Pay-per-event: **$0.003 per barcode checked**, charged once a completed
answer is produced — whether the verdict is valid or invalid. An input that
produces no answer because our own logic failed is never charged.

### Limitations — read this before you buy

This is GS1 check-digit arithmetic only, for EAN-13, EAN-8 and UPC-A.

- It does **not** look up the product. There is no GTIN database behind it:
  it cannot tell you the brand, the name or the price of an item.
- ITF-14 and GS1-128 are **not** supported.
- A valid check digit means the code is internally consistent, not that the
  code has ever been assigned to a real product.

### FAQ

**Does a "valid" result mean the barcode exists?**
No. It means the check digit is arithmetically correct for the digits in
front of it. Verifying that a GTIN is registered to a real product requires
a product database, which this Actor deliberately does not use.

**What happens with a code of the wrong length?**
It is reported with `verdict: "invalid_format"` rather than failing the run,
so one bad row never stops a batch.

### Related Actors

Part of the same family of small, single-purpose checkers on this account —
each does one thing, priced per item checked:

- [IBAN Validator & Formatter](https://apify.com/comall-agency/iban-validator-formatter) — ISO 13616 length + mod-97 checksum, fully offline.
- [Card Number Validator (Luhn)](https://apify.com/comall-agency/card-number-validator) — Luhn checksum and card-network detection, output is masked.
- [EU VAT Number Checker](https://apify.com/comall-agency/eu-vat-checker) — official VIES lookup.
- [Email Address Validator](https://apify.com/comall-agency/email-address-validator) — syntax, domain and MX checks.
- [Password Strength Checker](https://apify.com/comall-agency/password-strength-checker) — entropy scoring, never returns the password.
- [Cron Expression Validator](https://apify.com/comall-agency/cron-expression-tool) — plain-English description and next run times.

# Actor input Schema

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

EAN-13 (13 digits), EAN-8 (8 digits) or UPC-A (12 digits) codes. Accepts a full code (validates the check digit) or one digit short (computes the correct check digit).

## Actor input object example

```json
{
  "codes": [
    "4006381333931",
    "036000291452",
    "7351353"
  ]
}
```

# Actor output Schema

## `results` (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 = {
    "codes": [
        "4006381333931",
        "036000291452",
        "7351353"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("comall-agency/barcode-checkdigit-validator").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": [
        "4006381333931",
        "036000291452",
        "7351353",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("comall-agency/barcode-checkdigit-validator").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": [
    "4006381333931",
    "036000291452",
    "7351353"
  ]
}' |
apify call comall-agency/barcode-checkdigit-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,comall-agency/barcode-checkdigit-validator"
        }
    }
}

```

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/ptRs5k0TUxbUWfmvp/builds/7KoEfgweJ4hjpV5p4/openapi.json
