Barcode Generator Api
Pricing
Pay per event
Barcode Generator Api
The barcode generator API Actor offers a robust web service for creating various types of barcodes programmatically using Apify's platform
5.0 (1)
Pricing
Pay per event
0
2
1
Last modified
13 hours ago
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.
Features
- Multiple Barcode Standards: Support for QR codes, Code 128, Code 39, EAN-13, EAN-8, UPC-A, Code 93, Code 11, MSI, and Data Matrix codes
- Multiple Output Formats: Generate barcodes as PNG images, SVG vectors, or PDF documents
- Customizable Appearance: Control colors, sizes, text inclusion, and rotation
- Batch Processing: Generate multiple barcodes simultaneously in a single request
- Data Validation: Built-in validation for different barcode types
- Cloud Storage: Automatic delivery and archiving of generated barcodes
Input Parameters
The API accepts an array of barcode configurations with the following parameters:
{"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 Descriptions
- data (required): The data to encode in the barcode
- type (required): Barcode type to generate
qrcode: QR Codecode128: Code 128 (default)code39: Code 39ean13: EAN-13ean8: EAN-8upca: UPC-Acode93: Code 93code11: Code 11msi: MSIdatamatrix: Data Matrix
- format (optional): Output format -
png,svg, orpdf(default:png) - width (optional): Barcode width in pixels (default: 300)
- height (optional): Barcode height in pixels (default: 100)
- scale (optional): Scale factor for barcode density (default: 3)
- foregroundColor (optional): Barcode color in hex format (default:
#000000) - backgroundColor (optional): Background color in hex format (default:
#FFFFFF) - includeText (optional): Include human-readable text below barcode (default:
true) - textSize (optional): Font size for text below barcode (default: 12)
- rotate (optional): Rotation angle -
N(0°),R(90°),L(270°),I(180°) (default:N)
Output
The API returns detailed results for each barcode generation request:
Dataset Output
For each barcode request, the following data is returned:
{"id": "unique-identifier","data": "encoded-data","type": "barcode-type","format": "output-format","fileName": "generated-filename","fileKey": "apify-storage-key","width": 300,"height": 100,"foregroundColor": "#000000","backgroundColor": "#FFFFFF","includeText": true,"textSize": 12,"rotate": "N","generatedAt": "2024-01-01T00:00:00.000Z","success": true,"error": null}
Summary Output
{"barcodesGenerated": 15,"formatsGenerated": {"png": 8,"svg": 6,"pdf": 1}}
Usage Examples
Generate a QR Code
{"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"}]}
Generate Product Barcodes in Batch
{"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-123","type": "code128","format": "png","width": 250,"height": 80,"scale": 2,"foregroundColor": "#0066cc","backgroundColor": "#f0f0f0","includeText": true,"textSize": 10,"rotate": "N"}]}
Use Cases
- E-commerce: Generate product barcodes for inventory management
- Retail: Create price tags and shelf labels with barcodes
- Logistics: Generate shipping labels and tracking barcodes
- Marketing: Create QR codes for promotional campaigns
- Mobile Apps: Generate QR codes for app downloads and sharing
- Events: Create admission tickets and passes with barcodes
- Manufacturing: Generate barcode labels for parts and components
- Healthcare: Create patient ID and medication barcodes
Data Validation
The API includes built-in validation for different barcode types:
- EAN-13: Requires 12-13 numeric digits
- EAN-8: Requires 7-8 numeric digits
- UPC-A: Requires 11-12 numeric digits
- Code 39: Supports alphanumeric characters and symbols:
-$./+% - Code 128: Recommended maximum 80 characters for optimal readability
- QR Code: Maximum 2953 characters
- Data Matrix: Maximum 3116 characters
Error Handling
The API provides comprehensive error handling with detailed error messages for:
- Invalid barcode data formats
- Unsupported barcode types
- Generation failures
- File storage issues
