Barcode Generator Api avatar
Barcode Generator Api

Pricing

Pay per event

Go to Apify Store
Barcode Generator Api

Barcode Generator Api

The barcode generator API Actor offers a robust web service for creating various types of barcodes programmatically using Apify's platform

Pricing

Pay per event

Rating

5.0

(1)

Developer

Craftheon Labs

Craftheon Labs

Maintained by Community

Actor stats

0

Bookmarked

4

Total users

3

Monthly active users

21 days ago

Last modified

Share

A powerful and flexible web service for creating various types of barcodes programmatically

Generate high-quality barcodes in multiple formats with customizable appearance and batch processing capabilities.

✨ Key Features

🏷️ Multiple Barcode Standards

  • QR Codes
  • Code 128, Code 39, Code 93, Code 11
  • EAN-13, EAN-8, UPC-A
  • MSI and Data Matrix codes

🎨 Multiple Output Formats

  • PNG - High-quality raster images
  • SVG - Scalable vector graphics
  • PDF - Document format for printing

⚙️ Customizable Appearance

  • Custom colors (foreground & background)
  • Adjustable dimensions and scale
  • Optional text inclusion with custom font size
  • Rotation support (0°, 90°, 180°, 270°)

🚀 Advanced Capabilities

  • Batch Processing - Generate multiple barcodes simultaneously
  • Data Validation - Built-in validation for different barcode types
  • Cloud Storage - Automatic delivery and archiving
  • Error Handling - Comprehensive error reporting

📝 Input Configuration

The API accepts an array of barcode configurations with the following structure:

Input Schema

{
"barcodes": [
{
"data": "string",
"type": "qrcode|code128|code39|ean13|ean8|upca|code93|code11|msi|datamatrix",
"format": "png|svg|pdf",
"width": "number",
"height": "number",
"scale": "number",
"foregroundColor": "string",
"backgroundColor": "string",
"includeText": "boolean",
"textSize": "number",
"rotate": "N|R|L|I"
}
]
}

Parameter Reference

ParameterTypeRequiredDefaultDescription
datastring-The data to encode in the barcode
typestring-Barcode type (see supported types below)
formatstringpngOutput format: png, svg, pdf
widthnumber300Barcode width in pixels
heightnumber100Barcode height in pixels
scalenumber3Scale factor for barcode density
foregroundColorstring#000000Barcode color in hex format
backgroundColorstring#FFFFFFBackground color in hex format
includeTextbooleantrueInclude human-readable text
textSizenumber12Font size for text below barcode
rotatestringNRotation: N(0°), R(90°), L(270°), I(180°)

Supported Barcode Types

TypeDescriptionUse Case
qrcodeQR CodeURLs, contact info, marketing
code128Code 128Product labeling, inventory
code39Code 39Industrial applications
ean13EAN-13Retail products (12-13 digits)
ean8EAN-8Small products (7-8 digits)
upcaUPC-ANorth American retail (11-12 digits)
code93Code 93High-density industrial
code11Code 11Telecommunications
msiMSIInventory management
datamatrixData MatrixSmall item labeling

📤 Output Format

The API returns detailed results for each barcode generation request:

Dataset Output

Each barcode generation returns a comprehensive record:

{
"id": "d0b3df2f-f48d-4d29-8e47-3f4cd778abb8",
"data": "https://example.com",
"type": "qrcode",
"format": "png",
"fileName": "qrd0b3df.png",
"fileKey": "qrd0b3df.png",
"width": 300,
"height": 300,
"foregroundColor": "#000000",
"backgroundColor": "#FFFFFF",
"includeText": false,
"textSize": 12,
"rotate": "N",
"generatedAt": "2025-11-05T02:31:40.819Z",
"success": true,
"error": null
}

Analytics Summary

Generation statistics are stored in the key-value store:

{
"barcodesGenerated": 25,
"formatsGenerated": {
"png": 15,
"svg": 8,
"pdf": 2
}
}

🎯 Usage Examples

Example 1: Simple QR Code

Generate a QR code for a website URL:

{
"barcodes": [
{
"data": "https://example.com",
"type": "qrcode",
"format": "png",
"width": 300,
"height": 300,
"scale": 4,
"foregroundColor": "#000000",
"backgroundColor": "#FFFFFF",
"includeText": false,
"textSize": 12,
"rotate": "N"
}
]
}

Example 2: Product Barcodes (Batch)

Generate multiple product barcodes with different formats:

{
"barcodes": [
{
"data": "123456789012",
"type": "ean13",
"format": "svg",
"width": 300,
"height": 150,
"scale": 3,
"foregroundColor": "#000000",
"backgroundColor": "#FFFFFF",
"includeText": true,
"textSize": 14,
"rotate": "N"
},
{
"data": "PRODUCT-ABC-123",
"type": "code128",
"format": "png",
"width": 250,
"height": 80,
"scale": 2,
"foregroundColor": "#0066cc",
"backgroundColor": "#f0f0f0",
"includeText": true,
"textSize": 10,
"rotate": "N"
},
{
"data": "WIFI:T:WPA;S:MyNetwork;P:password123;;",
"type": "qrcode",
"format": "pdf",
"width": 400,
"height": 400,
"scale": 5,
"foregroundColor": "#1a1a1a",
"backgroundColor": "#ffffff",
"includeText": false,
"textSize": 12,
"rotate": "N"
}
]
}

Example 3: Custom Styled Barcode

Create a branded barcode with custom colors:

{
"barcodes": [
{
"data": "BRAND-2024-001",
"type": "code128",
"format": "png",
"width": 280,
"height": 90,
"scale": 2,
"foregroundColor": "#ff6b35",
"backgroundColor": "#f8f9fa",
"includeText": true,
"textSize": 12,
"rotate": "N"
}
]
}

🏢 Industry Use Cases

🛒 E-commerce & Retail

  • Product barcode generation for inventory management
  • Price tags and shelf labels with scannable codes
  • QR codes for product information and reviews

📦 Logistics & Shipping

  • Shipping label barcodes for package tracking
  • Warehouse inventory management systems
  • Route optimization with scannable location codes

📱 Marketing & Mobile

  • QR codes for promotional campaigns and discounts
  • App download links and social media sharing
  • Event check-ins and ticket validation

🏭 Manufacturing

  • Part identification and tracking
  • Quality control labels
  • Supply chain management

🏥 Healthcare

  • Patient identification wristbands
  • Medication labeling and tracking
  • Medical equipment inventory

🎫 Events & Entertainment

  • Admission tickets and passes
  • Venue access control
  • Merchandise pricing

✅ Data Validation Rules

The API includes comprehensive validation for different barcode types:

Numeric Barcodes

TypeRequired FormatMax LengthExample
EAN-1312-13 numeric digits13123456789012
EAN-87-8 numeric digits812345678
UPC-A11-12 numeric digits1212345678901

Alphanumeric Barcodes

TypeSupported CharactersRecommended MaxExample
Code 39A-Z, 0-9, space, and -$./+%20ABC-123
Code 128Full ASCII 128 character set80Product#12345
Code 93Full ASCII 128 character set30PART-XYZ-001
Code 110-9 and dash -15123-456
MSINumeric only15123456789

2D Barcodes

TypeMax CapacityBest For
QR Code2,953 charactersURLs, contact info
Data Matrix3,116 charactersSmall items, industrial

⚠️ Error Handling

The API provides comprehensive error handling with detailed error messages:

Common Error Types

Error CategoryExamplesSolutions
Invalid DataEAN-13 requires 12-13 numeric digitsEnsure correct data format
Unsupported TypeBarcode type 'invalid' not supportedUse supported barcode types
Generation FailedFailed to generate barcodeCheck data and parameters
File StorageFailed to save file to storageRetry or check storage limits

Error Response Format

{
"id": "uuid-here",
"data": "your-input-data",
"type": "qrcode",
"format": "png",
"fileName": null,
"fileKey": null,
"width": 300,
"height": 300,
"foregroundColor": "#000000",
"backgroundColor": "#FFFFFF",
"includeText": false,
"textSize": 12,
"rotate": "N",
"generatedAt": "2025-11-05T02:31:40.819Z",
"success": false,
"error": "EAN-13 requires 12-13 numeric digits, got: 'ABC123'"
}

🚀 Getting Started

  1. Prepare your input data according to the schema above
  2. Choose your barcode types based on your use case
  3. Configure appearance settings (optional)
  4. Submit your request to the API
  5. Retrieve generated barcodes from the dataset and storage

The API handles all the complexity of barcode generation, validation, and storage, allowing you to focus on your application logic.