GET /api/v1/barcode
Generate a barcode image (PNG, SVG, or PDF).
Returns just the barcode — no label page, and no human-readable caption unless includetext=true.
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
text | yes | — | The data to encode (max 7089 chars) |
type | yes | — | code128, qr, microqr, datamatrix, upca, upce, ean13, ean8, code39, itf14 |
format | no | png | png, svg (true vector), or pdf |
includetext | no | false | Render the human-readable text under the barcode |
scale | no | 3 | PNG pixel density; for SVG it scales the coordinate grid but output remains resolution-independent |
height | no | 15 | Bar height in mm for 1D types, 1–100 (ignored for 2D) |
rotate | no | N | N (none), R (90° clockwise), L (90° counter-clockwise), I (180°) |
Examples
High-resolution PNG for print:
/api/v1/barcode?text=SKU-12345&type=code128&scale=8&includetext=trueScalable SVG Data Matrix:
/api/v1/barcode?text=PART-9876&type=datamatrix&format=svgUPC-A with the standard human-readable digits:
/api/v1/barcode?text=012345678905&type=upca&includetext=trueResponse
The image bytes with Content-Type: image/png, image/svg+xml, or application/pdf. Responses include Cache-Control: public, max-age=86400 and an ETag — identical requests are cacheable. CORS is enabled (Access-Control-Allow-Origin: *), so requests work from any origin.