Dokaz API › Docs › Barcode API

Barcode generator API: Code 128, EAN-13 and UPC-A as SVG

Shipping labels, inventory tags, retail packaging and tickets all need a barcode that scans the first time. Put the data in the URL and get back an SVG: vector, so it prints crisp at any size, and small enough to inline in an HTML label template.

Code 128 chooses its code sets for you (B for text, C for runs of digits, which halves their width) and appends the mod-103 check character. Add text=1 to print the data under the bars.

Request

curl "https://api.dokaz.net/v1/barcode?data=DOKAZ-2026-0042&type=code128&text=1"

curl "https://api.dokaz.net/v1/barcode?data=DOKAZ-2026-0042&type=code128&scale=3&height=120&margin=12" -o label.svg

The response is image/svg+xml with a one-year cache header, so the URL can go straight into an <img> tag. x-barcode-text says exactly what was encoded.

Try it live — this runs against the free tier from your browser.

Pricing

100 calls a day are free with no key. Need more? Starter is $9/month for 10,000 calls across every product, key issued instantly.

Questions

Which characters can Code 128 hold?

Printable ASCII: letters, digits, space and punctuation, up to 80 characters. Control characters and GS1-128 application identifiers are not offered.

Can I get a PNG?

Not from this endpoint: it returns SVG, which any browser, label printer driver or design tool can rasterise at the resolution it needs.

How do I size it for print?

scale is the width of one module in pixels (1 to 10), height is the bar height (10 to 1000 px), margin is the quiet zone in modules (0 to 50, default 10). Keep at least 10 modules of margin for reliable scanning.

Related