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
Pricing
Pay per event
Rating
5.0
(1)
Developer

Craftheon Labs
Actor stats
0
Bookmarked
4
Total users
3
Monthly active users
21 days ago
Last modified
Categories
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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| data | string | ✅ | - | The data to encode in the barcode |
| type | string | ✅ | - | Barcode type (see supported types below) |
| format | string | ❌ | png | Output format: png, svg, pdf |
| width | number | ❌ | 300 | Barcode width in pixels |
| height | number | ❌ | 100 | Barcode height in pixels |
| scale | number | ❌ | 3 | Scale factor for barcode density |
| foregroundColor | string | ❌ | #000000 | Barcode color in hex format |
| backgroundColor | string | ❌ | #FFFFFF | Background color in hex format |
| includeText | boolean | ❌ | true | Include human-readable text |
| textSize | number | ❌ | 12 | Font size for text below barcode |
| rotate | string | ❌ | N | Rotation: N(0°), R(90°), L(270°), I(180°) |
Supported Barcode Types
| Type | Description | Use Case |
|---|---|---|
qrcode | QR Code | URLs, contact info, marketing |
code128 | Code 128 | Product labeling, inventory |
code39 | Code 39 | Industrial applications |
ean13 | EAN-13 | Retail products (12-13 digits) |
ean8 | EAN-8 | Small products (7-8 digits) |
upca | UPC-A | North American retail (11-12 digits) |
code93 | Code 93 | High-density industrial |
code11 | Code 11 | Telecommunications |
msi | MSI | Inventory management |
datamatrix | Data Matrix | Small 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
| Type | Required Format | Max Length | Example |
|---|---|---|---|
| EAN-13 | 12-13 numeric digits | 13 | 123456789012 |
| EAN-8 | 7-8 numeric digits | 8 | 12345678 |
| UPC-A | 11-12 numeric digits | 12 | 12345678901 |
Alphanumeric Barcodes
| Type | Supported Characters | Recommended Max | Example |
|---|---|---|---|
| Code 39 | A-Z, 0-9, space, and -$./+% | 20 | ABC-123 |
| Code 128 | Full ASCII 128 character set | 80 | Product#12345 |
| Code 93 | Full ASCII 128 character set | 30 | PART-XYZ-001 |
| Code 11 | 0-9 and dash - | 15 | 123-456 |
| MSI | Numeric only | 15 | 123456789 |
2D Barcodes
| Type | Max Capacity | Best For |
|---|---|---|
| QR Code | 2,953 characters | URLs, contact info |
| Data Matrix | 3,116 characters | Small items, industrial |
⚠️ Error Handling
The API provides comprehensive error handling with detailed error messages:
Common Error Types
| Error Category | Examples | Solutions |
|---|---|---|
| Invalid Data | EAN-13 requires 12-13 numeric digits | Ensure correct data format |
| Unsupported Type | Barcode type 'invalid' not supported | Use supported barcode types |
| Generation Failed | Failed to generate barcode | Check data and parameters |
| File Storage | Failed to save file to storage | Retry 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
- Prepare your input data according to the schema above
- Choose your barcode types based on your use case
- Configure appearance settings (optional)
- Submit your request to the API
- 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.


