Deterministic Barcode & GS1 Generation API
Generate print-ready SVG and PNG barcodes—GS1-128, GS1 DataMatrix, GS1 Digital Link (Sunrise 2027), PDF417, Code 128, Code 39 VIN, ITF-14, EAN-13, and UPC-A—with built-in GS1 AI & GTIN check-digit validation and batching up to 20 barcodes for 1 credit.
curl -X POST https://api.structocr.com/v1/barcode-generate \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"symbology": "gs1-128",
"data": "(01)09506000134352(17)271231(10)LOT42",
"format": "svg",
"options": { "scale": 3, "include_text": true }
}'{
"success": true,
"credits_used": 1,
"data": {
"symbology": "gs1-128",
"format": "svg",
"content_type": "image/svg+xml",
"content": "<svg xmlns=\"http://www.w3.org/2000/svg\" ...>",
"width": 556,
"height": 109,
"validation": {
"valid": true,
"check_digit": "2",
"check_digit_valid": true,
"parsed_ais": {
"01": { "name": "GTIN", "value": "09506000134352", "check_digit_valid": true },
"17": { "name": "EXPIRATION_DATE", "value": "271231", "formatted_date": "2027-12-31" },
"10": { "name": "BATCH_LOT", "value": "LOT42" }
}
}
}
}Pre-Billing GS1 Validation
Catches bad GTIN-14/SSCC-18 check digits, malformed YYMMDD dates, and broken Digital Link URIs before charging a single credit—returning exact fix suggestions.
20 Barcodes per Credit
Send an items[] batch of up to 20 mixed symbologies in one call for 1 credit ($0.0003–$0.0005 per barcode at Pro pack rates).
Zero Cold-Start Deps
Deterministic rendering at the edge with clean SVG vectors and lossless PNG bitmaps—skip fighting native Cairo/font packages in serverless deployments.
Strict Zero Data Retention
Serial numbers, pharma lot codes, VINs, and rendered barcode images are never persisted to disk or database logs.
Supported Barcode Symbologies & Validation Rules
Purpose-built for logistics, retail compliance (GS1 Sunrise 2027), automotive VIN labels, and warehouse ERP pipelines.
| symbology | Standard | Deterministic Validation | Primary Use Cases |
|---|---|---|---|
| gs1-128 | GS1-128 (UCC/EAN-128) | Strict GS1 AI syntax, GTIN-14/SSCC-18 Mod-10 check digits, YYMMDD dates, FNC1 | Pallet labels, logistics cartons, healthcare UDI |
| gs1-datamatrix | GS1 DataMatrix (2D) | Strict GS1 AI syntax & check digits with FNC1 | Pharma serialization, medical devices, compact parts |
| gs1-digital-link | GS1 Digital Link (2D QR / DM) | Sunrise 2027 URI syntax, primary key (/01/, /00/), GTIN check digit & query AIs | Retail packaging ready for GS1 Sunrise 2027 |
| pdf417 | PDF417 (ISO/IEC 15438) | Configurable columns (1–30) and Reed-Solomon eclevel (0–8) | Shipping manifests, boarding passes, QA ID tests |
| code128 | Code 128 | Printable ASCII validation, high-density 1D encoding | Warehouse SKUs, inventory tags, order slips |
| code39 | Code 39 (+ vin_mode) | Optional vin_mode enforces 17-char ISO 3779 VIN & 9th check digit | Automotive door-jamb VIN labels, asset tags |
| itf14 | ITF-14 | 14-digit length & GS1 Mod-10 check digit validation | Corrugated outer-case & carton barcodes |
| ean13 / upca | EAN-13 & UPC-A | 13-digit / 12-digit GS1 check digit validation | Global and North American retail POS SKUs |
StructOCR Barcode API vs. Self-Hosted Libraries
Why teams choose a deterministic managed endpoint instead of maintaining font/canvas binaries and GS1 validation rules across microservices.
| Dimension | StructOCR POST /v1/barcode-generate | Self-Hosted Barcode Library |
|---|---|---|
| Serverless / Edge runtime | Zero native binaries, fonts, or canvas libraries to bundle | Often requires node-canvas, Cairo, libcairo, or fontconfig |
| GS1 AI & Check-Digit Validation | Built-in GS1 AI parser, date validation & actionable fix suggestions | Manual regex & custom check-digit code to maintain |
| Batch throughput | Up to 20 barcodes in 1 API call (1 credit total) | Build your own queue, worker memory limits & error handling |
| Zero Data Retention | Input payloads & rendered barcodes never stored in logs or disk | Depends on self-managed logging & storage policies |
| Pricing model | Pay-as-you-go ($5 for 500 credits = up to 10,000 barcodes), never expires | Ongoing infra maintenance, container cold starts & updates |
Test in Browser First (0 Credits, Zero Upload)
Build sample labels locally before automating with POST /v1/barcode-generate:
GS1-128 Generator →
Visual AI builder for (01) GTIN, (17) Expiry, (10) Lot, (21) Serial, (00) SSCC.
GS1 Digital Link →
Sunrise 2027 URI builder with live 2D QR and GS1 DataMatrix symbols.
PDF417 Generator →
2D stacked PDF417 with custom columns & Reed-Solomon error correction.
VIN Barcode Generator →
Code 39, Data Matrix 2D, and Code 128 automotive VIN labels.
Frequently Asked Questions
Ready to Build with StructOCR?
Get your API key in under a minute. New users receive 200 free credits to test Passport, VIN, License Plate, Container, Receipt, HIN, Driver License, ID Card, Vehicle Registration, Weighbridge Ticket, ATM Cassette and Invoice OCR APIs.
✓ No credit card required · ✓ Instant API key · ✓ Full API access