# Bulk Barcode Generator: EAN, UPC, Code 128 to PNG or SVG (`scrapemint/bulk-barcode-generator`) Actor

Generate hundreds of retail and logistics barcodes in one run: EAN-13, UPC-A, Code 128, ITF-14, Code 39, and ISBN as PNG or SVG with direct download links. Check digits validated before rendering, wrong numbers flagged free. Runs fully offline. Pay per barcode, first 2 free.

- **URL**: https://apify.com/scrapemint/bulk-barcode-generator.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** E-commerce, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## 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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## Bulk Barcode Generator: EAN, UPC, Code 128 to PNG or SVG

Paste a list of product numbers, get a print-ready barcode image per line. Barcode web tools make you export one at a time or pay a subscription for batch mode; label software costs $100 and up. Here you pay per barcode.

### Supported types

| Type | Use |
| --- | --- |
| **EAN-13** | Retail products worldwide |
| **UPC-A** | Retail products in North America |
| **Code 128** | Logistics, internal SKUs, any text |
| **ITF-14** | Shipping cartons and outer cases |
| **Code 39** | Legacy warehouse and industrial systems |
| **ISBN** | Books (with the EAN-13 bookland rendering) |

### Check digits are validated, not just drawn

For EAN-13, UPC-A, and ITF-14 the actor verifies the GTIN check digit before rendering:

- Give it the number **without** the check digit and the correct one is computed and appended.
- Give it a number with a **wrong** check digit and you get a free note row telling you what the digit should have been, instead of a barcode that scans as the wrong product.

Catching a bad number before you print 5,000 labels is part of the product.

### What you get

One dataset row per barcode:

| Field | Description |
| --- | --- |
| `value` | Your input |
| `encodedText` | What was actually encoded (check digit appended if you omitted it) |
| `barcodeType`, `format` | Type and PNG/SVG |
| `imageUrl` | Direct download link to the image |
| `fileName` | File name in the run's storage |

All images are also visible in the run's key-value store in the Apify console.

### Typical uses

- **Ecommerce sellers**: EAN/UPC images for product packaging and marketplace listings.
- **Warehouses**: Code 128 labels for bins, shelves, and SKUs.
- **Distributors**: ITF-14 carton codes for outer cases.
- **Publishers and print shops**: ISBN barcodes for book covers, batch label orders.

### Pricing

You pay per barcode generated (`barcode`). The first 2 of every run are free. Invalid numbers cost nothing.

500 barcodes cost $1. No subscription, no watermark.

### Input example

```json
{
    "items": ["5901234123457", "590123412345", "4006381333931"],
    "barcodeType": "ean13",
    "format": "png",
    "scale": 3,
    "barHeight": 12,
    "showText": true
}
````

The second line has 12 digits: its check digit is computed automatically.

### Notes

- Runs fully offline. Your product numbers never touch an external service.
- One barcode type per run; run the actor once per type if you need several.
- PNG suits label printers directly; SVG scales to any size without blur.

# Actor input Schema

## `items` (type: `array`):

The numbers or text to encode, one barcode per line. GTIN types (EAN-13, UPC-A, ITF-14) accept the number with or without its check digit; when omitted, the check digit is computed for you.

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

Applied to all lines in the run. EAN-13 and UPC-A for retail products, ITF-14 for shipping cartons, Code 128 for logistics and internal SKUs, Code 39 for legacy systems, ISBN for books.

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

PNG for label printers and documents, SVG for infinite-resolution vector use.

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

Pixel width of the narrowest bar (PNG). 2-3 suits most label printers.

## `barHeight` (type: `integer`):

Height of the bars in millimeters.

## `showText` (type: `boolean`):

Include the human-readable digits below the barcode.

## Actor input object example

```json
{
  "items": [
    "5901234123457",
    "4006381333931",
    "9780306406157"
  ],
  "barcodeType": "ean13",
  "format": "png",
  "scale": 3,
  "barHeight": 12,
  "showText": true
}
```

# 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 = {
    "items": [
        "5901234123457",
        "4006381333931",
        "9780306406157"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/bulk-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 = { "items": [
        "5901234123457",
        "4006381333931",
        "9780306406157",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/bulk-barcode-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "items": [
    "5901234123457",
    "4006381333931",
    "9780306406157"
  ]
}' |
apify call scrapemint/bulk-barcode-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapemint/bulk-barcode-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Bulk Barcode Generator: EAN, UPC, Code 128 to PNG or SVG",
        "description": "Generate hundreds of retail and logistics barcodes in one run: EAN-13, UPC-A, Code 128, ITF-14, Code 39, and ISBN as PNG or SVG with direct download links. Check digits validated before rendering, wrong numbers flagged free. Runs fully offline. Pay per barcode, first 2 free.",
        "version": "0.1",
        "x-build-id": "AdfLpf7WYRfOD46aU"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapemint~bulk-barcode-generator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapemint-bulk-barcode-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapemint~bulk-barcode-generator/runs": {
            "post": {
                "operationId": "runs-sync-scrapemint-bulk-barcode-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapemint~bulk-barcode-generator/run-sync": {
            "post": {
                "operationId": "run-sync-scrapemint-bulk-barcode-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "items"
                ],
                "properties": {
                    "items": {
                        "title": "Barcode values (one per line)",
                        "type": "array",
                        "description": "The numbers or text to encode, one barcode per line. GTIN types (EAN-13, UPC-A, ITF-14) accept the number with or without its check digit; when omitted, the check digit is computed for you.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "barcodeType": {
                        "title": "Barcode type",
                        "enum": [
                            "ean13",
                            "upca",
                            "code128",
                            "itf14",
                            "code39",
                            "isbn"
                        ],
                        "type": "string",
                        "description": "Applied to all lines in the run. EAN-13 and UPC-A for retail products, ITF-14 for shipping cartons, Code 128 for logistics and internal SKUs, Code 39 for legacy systems, ISBN for books.",
                        "default": "ean13"
                    },
                    "format": {
                        "title": "Image format",
                        "enum": [
                            "png",
                            "svg"
                        ],
                        "type": "string",
                        "description": "PNG for label printers and documents, SVG for infinite-resolution vector use.",
                        "default": "png"
                    },
                    "scale": {
                        "title": "Scale",
                        "minimum": 1,
                        "maximum": 8,
                        "type": "integer",
                        "description": "Pixel width of the narrowest bar (PNG). 2-3 suits most label printers.",
                        "default": 3
                    },
                    "barHeight": {
                        "title": "Bar height (mm)",
                        "minimum": 5,
                        "maximum": 40,
                        "type": "integer",
                        "description": "Height of the bars in millimeters.",
                        "default": 12
                    },
                    "showText": {
                        "title": "Print the number under the bars",
                        "type": "boolean",
                        "description": "Include the human-readable digits below the barcode.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
