Barcode Encoder
API key v1Render Code 128, Code 39, EAN, UPC, ITF-14 and Codabar barcodes as PNG, SVG or JPEG.
Encodes a value as a 1D barcode and returns the image bytes directly, so the URL can be used as an <img src> from your own backend, or a JSON envelope with a temporary hosted link when resp=json is set. Check digits are verified for EAN and UPC values and computed when you send the number without one.
https://api.zactonz.com/barcode/
Parameters
| Name | Type | Description |
|---|---|---|
contentrequired |
string |
The value to encode. Each symbology has its own alphabet and length, listed under the |
type |
enum |
code128code39code93ean13ean8upcaupceitf14codabar |
format |
enum |
pngsvgjpg |
scale |
integer |
Width of the narrowest bar in pixels, 1 to 10. Default
2 |
height |
integer |
Bar height in pixels, 20 to 300. Default
60 |
color |
string |
Bar colour as six hex digits. Default
000000 |
bgcolor |
string |
Background colour as six hex digits. Default
ffffff |
resp |
enum |
imagejson |
Send parameters in the query string.
Response
OK
| Field | Type | Description |
|---|---|---|
status |
integer |
|
data |
object | The result. |
data.barcode |
string | Temporary link to the rendered image. |
data.type |
string | Symbology used. |
data.content |
string | Value encoded. |
data.format |
string | Image format. |
data.width |
integer | Pixel width, null for SVG. |
data.height |
integer | Pixel height, null for SVG. |
data.expires_in |
integer | Seconds the link stays valid. |
Status codes
The outcome is reported in the JSON status field. See Errors & status codes for the general rules.
400 |
Bad request |
|
401 |
Unauthorized | The Authorization header is missing or the key is not recognised. |
403 |
Forbidden | The key is not licensed for this product. |
429 |
Too many requests | The per-minute rate or the plan quota is exhausted. Retry after the seconds given in |
Notes
Images are returned with Cache-Control: public, max-age=86400. Hosted links from resp=json stay valid for 24 hours.