Back to home

Barcode API reference

Generate barcode images with an HTTP GET request. The public endpoint accepts URL-encoded parameters and returns the image directly.

Version 2

The authenticated API lives at /api/v2. Sign in to manage your API key. Your site administrator connects your user account to a provider account. Its balance covers billable requests.

curl "https://YOUR-DOMAIN/api/v2/balance" -H "Authorization: Bearer $BARCODE_API_KEY"

Use jurisdictions, revisions and elements to discover the input fields. POST form-encoded fields to barcode. When saving a result, read the X-Barcode-ID header and use that ID with export, linear or validate. The Accept header selects the output format.

Download the v2 OpenAPI contract

Generate an image

GET /api/barcode
text
Required. Content to encode, up to 500 characters.
type
Defaults to code128. Examples include qrcode, ean13, datamatrix and pdf417.
format
png (default) or svg.
scale
Integer from 1 to 20. Defaults to 3.
height
Height in millimetres for linear barcodes, from 5 to 100. Defaults to 10.
includetext
Set to false to hide the human-readable text.
curl "https://YOUR-DOMAIN/api/barcode?type=qrcode&text=Hello&format=svg" -o hello.svg
Open example SVG

Errors

Errors return JSON with error and message fields. Missing text, oversized text and unsupported types return HTTP 400. Rendering failures return HTTP 500.