# Barcode Generator (Bulk EAN-13, UPC, Code 128, SVG & PNG) (`toowl/barcode-generator`) Actor

Generate barcodes in bulk: EAN-13, EAN-8, UPC-A/E, ISBN, Code 128, Code 39, ITF-14, GS1-128, Codabar, Data Matrix, PDF417 and Aztec. Auto-detects the type, PNG or vector SVG, custom colours, check digits validated, one ZIP. Pay per barcode.

- **URL**: https://apify.com/toowl/barcode-generator.md
- **Developed by:** [Chalid Ade](https://apify.com/toowl) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 barcode generated

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/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 Generator — bulk EAN-13, UPC, Code 128, SVG & PNG

Paste a list of product numbers, SKUs or serials and get **print-ready barcodes** back: PNG or vector SVG, one ZIP, check digits validated so you don't print 5,000 labels with a typo.

Great for product labels, inventory and asset tags, shipping cartons (ITF-14 / GS1-128), books (ISBN) and warehouse bins.

### What you get

- **Bulk**: one barcode per line, thousands per run
- **Auto-detect**: 13 digits → EAN-13, 12 → UPC-A, 8 → EAN-8, 14 → ITF-14, anything else → Code 128
- **Symbologies**: EAN-13, EAN-8, UPC-A, UPC-E, ISBN, Code 128, Code 39, Code 93, ITF-14, Interleaved 2 of 5, GS1-128, Codabar, plus 2D: Data Matrix, PDF417, Aztec, QR
- **PNG** (scale 1–10 px per module) and/or **SVG** (vector, text included as paths, prints sharp at any size)
- **Classic retail layout** for EAN/UPC (first digit outside the bars), optional human-readable text
- **Custom colours**, transparent background, adjustable bar height and quiet zone
- **Validation**: wrong length or check digit gets a clear error row (and isn't charged)
- **One ZIP** with all files + a dataset row per barcode

Every symbology here was decoded back in our tests with the [QR & Barcode Reader](https://apify.com/toowl/qr-barcode-reader?fpr=toowl) engine.

### Input

```json
{
  "codes": ["5901234123457", "036000291452", "SKU-2026-00042"],
  "type": "auto",
  "format": "both",
  "scale": 4,
  "heightMm": 15,
  "includeText": true
}
```

Mix types in one run through the API: `{ "text": "HELLO-42", "type": "datamatrix", "name": "bin-42" }`.

GS1-128 values use application identifiers in brackets: `(01)09501101530003(17)250101`.

### Output

```json
{
  "text": "5901234123457",
  "type": "ean13",
  "name": "5901234123457",
  "pngUrl": "https://api.apify.com/v2/key-value-stores/…/records/0001-5901234123457.png",
  "svgUrl": "https://api.apify.com/v2/key-value-stores/…/records/0001-5901234123457.svg"
}
```

Failed values get `{ "input": "…", "error": "Incorrect EAN-13 check digit provided" }`.

### Pricing

Pay per event: one `barcode-generated` per barcode. Invalid values are free. Cap spending with "Max cost per run".

### Free browser version

Need a handful, or a printable label sheet? [toowl.my.id/en/barcode](https://toowl.my.id/en/barcode/) makes them in your browser for free.

### Engine

[bwip-js](https://github.com/metafloor/bwip-js) (MIT), a JavaScript port of Barcode Writer in Pure PostScript.

### Call it from your code

```bash
curl -X POST "https://api.apify.com/v2/acts/toowl~barcode-generator/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"codes":["5901234123457","ABC-12345"],"type":"auto","format":"png"}'
```

The same call works from Python (`apify-client`), JavaScript, Make, Zapier and n8n (Apify app/node or a plain HTTP request).

### Use it from AI agents (MCP)

Add this Actor as a tool to Claude, Cursor, VS Code or any MCP client through Apify's MCP server:

```
https://mcp.apify.com/?actors=toowl/barcode-generator
```

The agent can then pass file URLs and read the results itself.

### More toowl file APIs

Speech to text & subtitles, AI vocal remover, text to speech, AI object remover, PDF to Markdown, PDF to Word & Excel, HTML/URL to PDF, OCR, Office to PDF, PDF compressor, PDF merge/split, PDF password protect, PDF to image, image to PDF, bulk watermark, image converter and compressor, background remover, AI upscaler, image to SVG, QR code and barcode generators, QR/barcode reader, favicon generator, video compressor, frame extractor and audio converter. All pay per file, all batch-friendly: [toowl.my.id/en/api](https://toowl.my.id/en/api/).

Questions or a format that fails? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

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

One barcode per line: product numbers, SKUs, serials, ISBNs… Via the API you can also pass objects {"text": "…", "type": "code39", "name": "file-name"}.

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

Symbology. Auto picks EAN-13 for 13 digits, UPC-A for 12, EAN-8 for 8, ITF-14 for 14 and Code 128 for anything else.

## `format` (type: `string`):

PNG for labels and documents, SVG for print and design tools.

## `scale` (type: `integer`):

Pixels per bar module in the PNG. 3 is good for screens, 5+ for printing.

## `heightMm` (type: `integer`):

Height of linear barcodes. Ignored for 2D codes (Data Matrix, PDF417, Aztec, QR).

## `includeText` (type: `boolean`):

Human-readable text below linear barcodes.

## `foreground` (type: `string`):

6-digit hex colour of the bars, e.g. #000000.

## `background` (type: `string`):

6-digit hex colour behind the bars, e.g. #ffffff.

## `transparent` (type: `boolean`):

No background (overrides the background colour).

## `padding` (type: `integer`):

Empty space around the barcode (quiet zone).

## `zip` (type: `boolean`):

Also save every file in barcodes.zip (when there is more than one value).

## Actor input object example

```json
{
  "codes": [
    "5901234123457",
    "036000291452",
    "SKU-2026-00042"
  ],
  "type": "auto",
  "format": "png",
  "scale": 3,
  "heightMm": 15,
  "includeText": true,
  "foreground": "#000000",
  "background": "#ffffff",
  "transparent": false,
  "padding": 10,
  "zip": true
}
```

# Actor output Schema

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

One row per value with links to the PNG and/or SVG.

## `zip` (type: `string`):

Every generated file in one ZIP (when more than one value).

## `summary` (type: `string`):

Counts of barcodes generated and failed, plus the ZIP link.

# 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": [
        "5901234123457",
        "036000291452",
        "SKU-2026-00042"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("toowl/barcode-generator").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": [
        "5901234123457",
        "036000291452",
        "SKU-2026-00042",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("toowl/barcode-generator").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": [
    "5901234123457",
    "036000291452",
    "SKU-2026-00042"
  ]
}' |
apify call toowl/barcode-generator --silent --output-dataset

```

## MCP server setup

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

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/GiJhG7bYxFhjaXvye/builds/PvgfEUrbjF7AH5hxe/openapi.json
