xBarcodexBarcode
xBarcode Engine v1.6.8 Active

Developer API & SDK Reference

Generate SVG, PDF, EPS or matrix JSON for supply chains, e-commerce and logistics. PNG export is available in the browser. MaxiCode matrix output directly integrates both the hexagonal modules and the concentric bullseye finder rings in a unified representation.

API Key & Commercial Access 2,000,000 Requests / Cycle

Request Your API Key & Enterprise Solutions

Standard tiers include 2,000,000 requests per cycle. For API tokens, dedicated commercial SLA plans, or upcoming Offline / On-Premise SDK & WASM engines, simply contact our engineering team directly.

Client Integration

JSON POST / Query GET
curl -X POST https://api.xbarcode.ai/v1/render \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "format": "code_128",
    "content": "SHIP-9400-1092-8371-029",
    "width": 300,
    "height": 100,
    "color": "#000000",
    "bg_color": "#ffffff"
  }' > barcode.svg

API Endpoints

PUBLIC GET
https://xbarcode.ai/api/render?format=...&content=...
No Token Required. Instant rendering for web embeds, prototyping, and public previews.
AUTH POST
https://api.xbarcode.ai/v1/render
Requires Authorization: Bearer <TOKEN>. High-throughput production pipeline backed by 2,000,000 requests/cycle free quota.

Render Parameters

Parameter Type Required Description
format string ✅ Any of the 143 catalog formats and profiles, plus their size presets (e.g. code_128, qr_code, data_matrix)
content string ✅ Raw data or GS1 Element String with AIs to encode
auto_complete_check_digit boolean optional Default false preserves existing behavior. True completes missing data checks when the position is unambiguous. Existing incorrect checks are rejected. Formats without applicable data checks are unchanged; internal checksums remain automatic. Use parenthesized AIs for GS1 completion.
output string optional svg (default), eps, pdf (vector PDF, including MaxiCode), or matrix (logical matrix JSON). Set this in the URL query, for example ?output=pdf. PDF converts CSS pixels to points at 96 px per inch. Use ?output=preview for JSON containing svg, validated display content, and check_positions (zero-based UTF-8 byte offsets). GS1 display content uses parenthesized AIs; Digital Link retains the encoded URI. Formats without reported data checks return the validated input and an empty position list.
width number optional Target width in pixels (or module width multiplier)
height number optional Target height in pixels (for 1D bars)
color string optional Foreground hex color, default #000000
bg_color string optional Background hex color, default #ffffff
rotate number optional 0, 90, 180, or 270 degrees rotation
bearer string optional ITF/1D Bearer bars: top_bottom or full frame

Error Codes

Status Reason Resolution
400 Bad Request Invalid character set or check digit failure for symbology Validate format requirements (e.g. numeric only for EAN-13/UPC)
401 Unauthorized Missing or invalid Authorization header token Pass valid Bearer YOUR_TOKEN
429 Rate Limited Daily quota exceeded for current tier Upgrade API quota or implement backoff retry

Explore Further