Barcode Generator avatar

Barcode Generator

Pricing

Pay per event

Go to Apify Store
Barcode Generator

Barcode Generator

Generate EAN-13, Code128, UPC-A, QR codes, and 10+ barcode formats as PNG or SVG images. Batch generation with customizable colors and dimensions.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

9 days ago

Last modified

Categories

Share

Generate EAN-13, Code128, UPC-A, QR codes, and 10+ barcode formats as PNG and SVG images — in bulk. Define a list of barcodes, hit run, and download your images from the key-value store. No external APIs, no proxy costs, instant results.

🏷️ What does it do?

Barcode Generator takes a list of barcode specifications (data, format, size, color) and produces:

  • PNG images — raster images ready for print or embedding in documents
  • SVG images — vector graphics that scale to any resolution without quality loss
  • Both formats — generate PNG + SVG in a single run

Every generated image is saved to the actor's key-value store with a named key (e.g., my-product-ean13.png). The dataset contains a record for each barcode with metadata, KV store key references, and any error messages for failed items.

Supported barcode formats

FormatDescriptionExample data
EAN-13European Article Number, retail standard012345678901 (12 digits)
EAN-8Compact version of EAN0123456 (7 digits)
UPC-AUniversal Product Code, North American retail012345678905 (12 digits)
UPC-ECompact UPC for small packages01234565 (8 digits)
Code128Alphanumeric, variable lengthHello World, ORDER-1234
Code39Uppercase alphanumeric + symbolsHELLO WORLD, ABC-123
ITF-14Shipping carton barcodes0000012345678 (13 digits)
MSIInventory and warehouse1234567
CodabarLibrary books, blood banksA1234567B
PharmacodePharmaceutical packaging1234
QR Code2D matrix code for URLs, text, dataAny text or URL

👤 Who is it for?

E-commerce store owners

Bulk-generate EAN-13 or UPC-A barcodes for product catalogs. Generate 500+ product barcodes in one run and download them all as print-ready PNGs.

Logistics and warehouse teams

Create Code128 or ITF-14 shipping labels programmatically. Integrate with your inventory system via the Apify API to auto-generate barcodes whenever new items are added.

Developers and QA engineers

Generate barcode images for testing receipt parsers, mobile scanning apps, or POS system integrations — without setting up a barcode library in your own project.

Generate SVG barcodes for vector workflows. SVG barcodes can be imported into Adobe Illustrator, Affinity Publisher, or Figma and scaled to any size without pixelation.

No-code automation builders

Use with Zapier, Make (Integromat), or n8n to auto-generate QR codes for customer URLs, loyalty cards, or event tickets.

✅ Why use Barcode Generator?

  • Batch processing — generate hundreds of barcodes in a single run
  • Zero proxy cost — pure computation, runs in seconds at negligible cost
  • PNG + SVG — use raster for print, vector for design workflows
  • Full customization — colors, dimensions, margins, font size per barcode
  • Named output keys — images saved with predictable KV store keys for easy retrieval
  • Error isolation — one invalid barcode doesn't stop the whole batch; errors are reported per item
  • 11 formats — covers retail (EAN/UPC), logistics (Code128/ITF), pharma, and QR

📦 What data does it extract?

Each dataset record contains:

FieldTypeDescription
labelstringThe identifier used as the KV store file key prefix
datastringThe data encoded in the barcode
formatstringBarcode format (EAN13, CODE128, QR, etc.)
outputFormatstringPNG, SVG, or BOTH
widthnumberImage width in pixels
heightnumberImage height in pixels
kvKeystringKV store key for single-format output
kvKeyPngstringKV store key for PNG when outputFormat is BOTH
kvKeySvgstringKV store key for SVG when outputFormat is BOTH
successbooleanWhether generation succeeded
errorstringError message if generation failed

💰 How much does it cost to generate barcodes?

Barcode generation is pure computation — no web requests, no proxy, no external APIs. Costs are minimal:

EventFREEBRONZESILVERGOLDPLATINUMDIAMOND
Actor start (one-time per run)$0.005$0.00475$0.00425$0.00375$0.003$0.0025
Per barcode generated$0.0003$0.00027$0.00024$0.000195$0.00015$0.00012

Example costs (FREE tier):

  • 100 barcodes → ~$0.035
  • 500 barcodes → ~$0.155
  • 1,000 barcodes → ~$0.305

Example costs (DIAMOND tier):

  • 100 barcodes → ~$0.0145
  • 1,000 barcodes → ~$0.1225

Free plan estimate: Apify's free tier ($5/month credit) covers approximately 14,000 barcodes/month.

Pricing is Pay-Per-Event — you only pay for what you generate. Higher Apify subscription tiers get automatic volume discounts (up to 50% off at DIAMOND tier).

🚀 How to generate barcodes

Quick start (3 steps)

  1. Open the actor on Apify Console
  2. Fill in the barcodes list with your data, format, and optional label
  3. Click Start — download your images from the key-value store when done

Step-by-step with the visual editor

  1. In the Barcodes to generate field (JSON editor), add one object per barcode:
    [
    { "data": "012345678901", "format": "EAN13", "outputFormat": "PNG", "label": "my-product" },
    { "data": "https://mystore.com", "format": "QR", "outputFormat": "BOTH", "label": "store-qr" }
    ]
  2. Set Default output format (PNG, SVG, or Both) — applies when individual barcodes don't specify one
  3. Adjust width, height, colors, and margin in the Advanced Options section
  4. Click Start and wait for the run to complete (seconds to minutes depending on batch size)
  5. Go to Key-value store tab in the run detail — download your images by key name

Downloading all images via API

After the run completes, fetch all generated images:

# List all keys in the KV store
curl "https://api.apify.com/v2/key-value-stores/{STORE_ID}/keys" \
-H "Authorization: Bearer YOUR_API_TOKEN"
# Download a specific image
curl "https://api.apify.com/v2/key-value-stores/{STORE_ID}/records/my-product.png" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-o my-product.png

⚙️ Input parameters

Barcodes list (required)

The barcodes array is the core input. Each item supports:

ParameterTypeRequiredDescription
datastring✅ YesThe value to encode (number, text, URL)
formatstringNoBarcode format — defaults to CODE128. Options: EAN13, EAN8, UPC, UPC_E, CODE128, CODE39, ITF14, MSI, PHARMACODE, CODABAR, QR
outputFormatstringNoPNG, SVG, or BOTH — overrides global setting
labelstringNoFile key prefix. Auto-generated if omitted (e.g., barcode-1-EAN13-012345678901)
widthnumberNoOverride default width for this barcode
heightnumberNoOverride default height for this barcode
lineColorstringNoOverride bar/module color for this barcode
backgroundstringNoOverride background color for this barcode
includeTextbooleanNoOverride text display for this barcode

Default settings

ParameterDefaultDescription
outputFormatPNGDefault output format for all barcodes
width300Default image width in pixels
height150Default image height in pixels
lineColor#000000Default bar/module color
background#ffffffDefault background color
includeTexttrueShow human-readable text below barcode
fontSize20Font size for text label (px)
margin10White space margin around barcode (px)
qrErrorCorrectionMQR error correction: L/M/Q/H

Color values

All color fields accept any CSS color string:

  • Hex: #000000, #ff5500
  • Named: black, white, red
  • RGB: rgb(0, 0, 0)
  • Transparent background: transparent

📊 Output examples

Dataset record (EAN-13 → PNG)

{
"label": "my-product",
"data": "012345678901",
"format": "EAN13",
"outputFormat": "PNG",
"width": 300,
"height": 150,
"kvKey": "my-product.png",
"kvKeyPng": null,
"kvKeySvg": null,
"success": true,
"error": null
}

Dataset record (QR → BOTH)

{
"label": "store-qr",
"data": "https://mystore.com",
"format": "QR",
"outputFormat": "BOTH",
"width": 300,
"height": 300,
"kvKey": null,
"kvKeyPng": "store-qr.png",
"kvKeySvg": "store-qr.svg",
"success": true,
"error": null
}

Dataset record (error case)

{
"label": "bad-barcode",
"data": "INVALID@#$",
"format": "EAN13",
"outputFormat": "PNG",
"success": false,
"error": "Invalid data \"INVALID@#$\" for format EAN13: is not a valid input for EAN13"
}

💡 Tips and best practices

Format selection guide

  • Use EAN-13 for retail products sold in Europe, Australia, and most of the world
  • Use UPC-A for retail products sold in North America
  • Use Code128 for shipping labels, inventory, internal tracking — most flexible format
  • Use Code39 for legacy systems (older industrial scanners) — uppercase only
  • Use QR for URLs, contact info, WiFi credentials, app links
  • Use ITF-14 for outer carton/shipping container barcodes

Data format requirements

FormatData requirements
EAN-13Exactly 12 digits (checksum auto-calculated)
EAN-8Exactly 7 digits (checksum auto-calculated)
UPC-AExactly 12 digits
Code128Any ASCII characters, any length
Code39Uppercase A-Z, 0-9, space, - . $ / + %
ITF-14Exactly 13 digits (even total)
QRAny text, URL, JSON, or binary data

SVG for print, PNG for web

SVG files are resolution-independent — perfect for printing at any DPI or importing into design tools. PNG files are better for web embedding, email, or systems that don't support SVG.

Custom colors for branding

Override lineColor and background per barcode to match brand colors. For example, a dark blue barcode on a light blue background:

{
"data": "https://mystore.com",
"format": "QR",
"lineColor": "#1a237e",
"background": "#e3f2fd",
"label": "branded-qr"
}

Note: Ensure sufficient contrast between lineColor and background — scanners need at least 3:1 contrast ratio.

Batch labeling strategy

Use descriptive label values that map to your data source:

[
{ "data": "9780451524935", "format": "EAN13", "label": "isbn-catch-22" },
{ "data": "9780345391803", "format": "EAN13", "label": "isbn-hitchhiker" }
]

This makes it easy to download specific files by name from the KV store.

🔌 Integrations

Zapier — auto-generate QR codes for new orders

  1. Trigger: New order in WooCommerce / Shopify
  2. Action: Run Barcode Generator via Apify HTTP API with the order URL
  3. Action: Get the generated PNG from KV store
  4. Action: Attach to order confirmation email

Make (Integromat) — product catalog barcodes

  1. Schedule: Daily at midnight
  2. Get new products from your database or Google Sheet
  3. HTTP: POST to Apify API with product EAN list
  4. Wait for run completion (webhook or poll)
  5. Download all PNGs from KV store to Google Drive

n8n — warehouse label generation

  1. Webhook: receives SKU + quantity from WMS
  2. Code node: build barcode list JSON (CODE128 per SKU)
  3. HTTP Request: POST to Apify run endpoint
  4. HTTP Request: GET run status until SUCCEEDED
  5. HTTP Request: download each barcode image
  6. Send to label printer via network API

API integration — embed in your backend

Generate barcodes on demand from any backend:

import apify_client
import requests
client = apify_client.ApifyClient("YOUR_API_TOKEN")
# Start a run
run = client.actor("automation-lab/barcode-generator").call(run_input={
"barcodes": [
{"data": "SHIPMENT-2024-001", "format": "CODE128", "outputFormat": "PNG", "label": "ship-001"}
],
"width": 400,
"height": 120
})
# Get the KV store and download the image
kv_store = client.key_value_store(run["defaultKeyValueStoreId"])
record = kv_store.get_record("ship-001.png")
with open("ship-001.png", "wb") as f:
f.write(record["value"])

🧑‍💻 API usage

Node.js

import { ApifyClient } from 'apify-client';
import { writeFileSync } from 'fs';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('automation-lab/barcode-generator').call({
barcodes: [
{ data: '012345678901', format: 'EAN13', outputFormat: 'PNG', label: 'product-ean13' },
{ data: 'https://example.com', format: 'QR', outputFormat: 'BOTH', label: 'site-qr' }
],
width: 300,
height: 150,
lineColor: '#000000',
background: '#ffffff'
});
// Download the generated images
const kvStore = client.keyValueStore(run.defaultKeyValueStoreId);
const pngRecord = await kvStore.getRecord('product-ean13.png');
writeFileSync('product-ean13.png', pngRecord.value);
const svgRecord = await kvStore.getRecord('site-qr.svg');
writeFileSync('site-qr.svg', svgRecord.value);
console.log('Barcodes downloaded!');

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("automation-lab/barcode-generator").call(run_input={
"barcodes": [
{"data": "012345678901", "format": "EAN13", "outputFormat": "PNG", "label": "product-ean13"},
{"data": "https://example.com", "format": "QR", "outputFormat": "BOTH", "label": "site-qr"}
],
"width": 300,
"height": 150,
"lineColor": "#000000",
"background": "#ffffff"
})
# Download generated images
kv_store = client.key_value_store(run["defaultKeyValueStoreId"])
record = kv_store.get_record("product-ean13.png")
with open("product-ean13.png", "wb") as f:
f.write(record["value"])
record_svg = kv_store.get_record("site-qr.svg")
with open("site-qr.svg", "w") as f:
f.write(record_svg["value"])
print("Barcodes downloaded!")

cURL

# Start a run
curl -X POST "https://api.apify.com/v2/acts/automation-lab~barcode-generator/runs" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"barcodes": [
{"data": "012345678901", "format": "EAN13", "outputFormat": "PNG", "label": "product-ean13"},
{"data": "https://example.com", "format": "QR", "outputFormat": "PNG", "label": "site-qr"}
],
"width": 300,
"height": 150
}'
# Wait for run to finish, then download
STORE_ID="YOUR_KV_STORE_ID"
curl "https://api.apify.com/v2/key-value-stores/${STORE_ID}/records/product-ean13.png" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-o product-ean13.png

🤖 MCP — Use with Claude AI

Use Barcode Generator directly in Claude conversations via the Model Context Protocol (MCP).

Claude Code (terminal)

$claude mcp add --transport http apify "https://mcp.apify.com?tools=automation-lab/barcode-generator"

Claude Desktop / Cursor / VS Code

Add to your MCP configuration file (claude_desktop_config.json or .cursor/mcp.json):

{
"mcpServers": {
"apify": {
"type": "http",
"url": "https://mcp.apify.com?tools=automation-lab/barcode-generator",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
}
}
}
}

Example Claude prompts

Once connected, you can ask Claude:

  • "Generate an EAN-13 barcode for the number 012345678901 as a PNG"
  • "Create a QR code for https://mystore.com with blue bars on a light blue background"
  • "Generate Code128 barcodes for these 20 SKUs and save them as SVG files"
  • "Make a batch of barcodes for my product catalog: [paste CSV]"

⚖️ Legality and usage

Barcode generation is fully legal. The barcode formats (EAN, UPC, Code128, QR, etc.) are open standards. You own any barcodes you generate.

Note on EAN/UPC retail use: If you plan to sell products in retail stores, EAN-13 and UPC-A codes should be registered with GS1 (gs1.org) to ensure global uniqueness. Self-generated barcodes are fine for internal inventory, warehouse, or testing use. For production retail listings on Amazon, Walmart, etc., obtain a licensed GS1 prefix.

QR codes have no registration requirement — generate freely for any use.

❓ FAQ

Q: What is the maximum number of barcodes per run? A: There is no hard limit — the actor processes barcodes sequentially. 500 barcodes typically complete in under 30 seconds. For very large batches (10,000+), consider splitting into multiple runs or using the API with parallel calls.

Q: Can I use transparent backgrounds? A: Yes — set background to "transparent" for transparent PNG backgrounds. This is useful when overlaying barcodes on colored labels or product images.

Q: Why did my EAN-13 barcode fail? A: EAN-13 requires exactly 12 numeric digits. The checksum digit (13th) is calculated automatically. Common mistakes: providing 13 digits (include the check digit), letters, or special characters. Use 012345678901 (12 digits), not 0123456789012.

Q: My Code39 barcode shows an error — why? A: Code39 only supports uppercase A-Z, digits 0-9, and the symbols - . $ / + % and space. Convert your data to uppercase and remove unsupported characters before encoding.

Q: Can I retrieve multiple images at once? A: Yes — use the Apify API to list all KV store keys and download them programmatically. See the API usage section above for examples. You can also use the Apify CLI: apify kv get --store-id STORE_ID --key my-barcode.png.

Q: The generated PNG looks blurry when printed — what's wrong? A: For print use, either use SVG (vector, infinitely scalable) or increase the width and height values significantly. For 300 DPI printing at 2 inches wide, set width to 600 pixels. For labels, SVG is almost always the better choice.

Q: How do I download all generated barcodes as a ZIP? A: The actor doesn't produce ZIP files directly. Use the Apify API to iterate over KV store keys and download each file. Or use the Apify CLI's batch download feature.