# GTIN Tools - UPC/EAN/GTIN validator and barcode renderer (`mettahometech/gtin-tools`) Actor

Validate and normalise UPC-A, EAN-13 and GTIN-14 codes (GS1 check digit), convert between them and render barcodes as PNG or SVG. No scraping: works only on the codes you supply.

- **URL**: https://apify.com/mettahometech/gtin-tools.md
- **Developed by:** [Metta Distribution](https://apify.com/mettahometech) (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

from $2.00 / 1,000 code validateds

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

## GTIN Tools -- UPC / EAN / GTIN validator and barcode renderer

Check and clean product barcodes in bulk. For every code you get:

- **valid / error** -- GS1 check digit verified; the reason when it fails (wrong length, bad check digit, 11-digit UPC missing its check digit -- with the digit it should have)
- **gtin14, ean13, upca** -- the same code in every standard form
- **barcode image** (optional) -- PNG or SVG, saved to the run's key-value store with a link

No scraping and no lookups: it works only on the codes you give it.

### Input

```json
{"codes": ["036000291452", "4006381333931", "00012345678905"], "render": "png"}
```

### Output (one item per code)

```json
{"input": "036000291452", "valid": true, "type": "UPC-A", "gtin14": "00036000291452",
 "ean13": "0036000291452", "upca": "036000291452", "check_digit": 2, "expected_check_digit": 2,
 "error": null, "barcode_key": "barcode-00001-036000291452.png", "barcode_url": "https://...", "symbology": "upca"}
```

### Use from an AI agent (MCP)

Agents can call this Actor as an MCP tool through Apify's MCP server. You pay the same per-event
prices as a normal run; you need an Apify account and API token (Console -> Settings -> API & Integrations).

Claude Code:

```
claude mcp add --transport http gtin-tools "https://mcp.apify.com/?tools=mettahometech/gtin-tools" --header "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Claude Desktop (`claude_desktop_config.json`):

```json
{"mcpServers": {"gtin-tools": {"command": "npx", "args": ["-y", "@apify/actors-mcp-server", "--actors", "mettahometech/gtin-tools"],
  "env": {"APIFY_TOKEN": "YOUR_APIFY_TOKEN"}}}}
```

Worked call -- ask the agent "Check these UPCs and tell me which are invalid: 036000291452, 036000291453". It calls the tool with:

```json
{"codes": ["036000291452", "036000291453"]}
```

and gets back two items: the first `valid: true`, the second `valid: false` with the expected check digit (2). Cost: 2 x $0.002.

More reseller tools for Canada: https://sellerfee.ca/tools

### Pricing (pay per event)

- $0.002 per code validated
- $0.01 per barcode rendered

Privacy: the Actor does not fetch any website and keeps nothing beyond your own run's dataset and key-value store.

# Actor input Schema

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

UPC-A, EAN-13, GTIN-14 (or EAN-8) codes, one per line. Spaces and dashes are ignored.

## `render` (type: `string`):

Render a barcode image for each valid code (charged per image).

## `symbology` (type: `string`):

Auto prints the retail symbol scanners expect; Code 128 encodes the digits as-is.

## Actor input object example

```json
{
  "codes": [
    "036000291452",
    "4006381333931",
    "00012345678905"
  ],
  "render": "none",
  "symbology": "auto"
}
```

# Actor output Schema

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

One item per code: validity, GTIN-14 / EAN-13 / UPC-A forms, barcode link

## `barcodes` (type: `string`):

Rendered PNG or SVG files, when render is on

# 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": [
        "036000291452",
        "4006381333931",
        "00012345678905"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mettahometech/gtin-tools").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": [
        "036000291452",
        "4006381333931",
        "00012345678905",
    ] }

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

```

## MCP server setup

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

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/vdpvDZ3UThlc5Jhm7/builds/Ht7H6uLKRlryGvfrq/openapi.json
