QRdx
HelpGuidesDevelopersReact librarySelf-hosting

Render a barcode image

A static barcode as SVG (default), PNG, JPG, WebP, AVIF, PDF or EPS, with no key.

No key or token needed, and it doesn't use your daily quota: put the URL straight into an <img> tag. The same query always returns the same bytes, so responses are cached for a year. Limit: 300 requests a minute per IP address, like GET /qr.

Formats. EAN-13, EAN-8, UPC-A, UPC-E, ITF-14 and GS1-128 (GTIN and SSCC fields) take the number with or without its check digit: one digit short and it's added, the full length and it's checked. A wrong check digit, a wrong length or a character the format can't hold is a 400 that says what's wrong. Code 128 takes printable ASCII, Code 39 capitals, digits and - . $ / + %, and Data Matrix, PDF417 and Aztec any text up to 1,000 characters.

Sizes. Raster images are scale pixels per module (a linear bar or a 2D cell's half). SVG, PDF and EPS are vectors at one point per module (0.353 mm, about 107% of an EAN-13's nominal size), with bars height millimetres tall.

Values that shouldn't sit in a URL can go in a POST body instead.

GET
/barcode

Query Parameters

format*string

The symbology: ean13 (EAN-13), ean8 (EAN-8), upca (UPC-A), upce (UPC-E), code128 (Code 128), code39 (Code 39), itf14 (ITF-14), gs1-128 (GS1-128), datamatrix (Data Matrix), pdf417 (PDF417), aztec (Aztec)

Value in"ean13""ean8""upca""upce""code128""code39""itf14""gs1-128""datamatrix""pdf417""aztec"
data*string

The number or text to encode. Retail numbers (EAN, UPC, ITF-14, GS1 GTINs and SSCCs) can leave the check digit off and it's added; a wrong one is an error.

Length1 <= length <= 1000
type?string

File type: svg (default), png, jpg, webp, avif, pdf or eps. Raster images are scale pixels per module; SVG, PDF and EPS are vectors at one point per module (0.353 mm).

Default"svg"
Value in"png""jpg""webp""avif""svg""pdf""eps"
fg?string

Bar and text color (default 000000) as hex, such as 000000 (in URLs leave out the # or encode it as %23)

Lengthlength <= 7
bg?string

Background color (default ffffff) as hex, such as 000000 (in URLs leave out the # or encode it as %23)

Lengthlength <= 7
scale?integer

Pixels per module in raster images (1-10, default 4)

Range1 <= value <= 10
height?number

Bar height of linear barcodes in millimetres at the vector size (5-60; default depends on the format, 23 for EAN-13)

Range5 <= value <= 60
quietZone?integer

Blank margin in modules: left and right of linear barcodes (0-20), all round 2D codes (0-10). Defaults to the format's minimum (11 for EAN-13, 10 for Code 128).

Range0 <= value <= 20
text?string

Print the digits or text under linear barcodes (default true)

Value in"0""1""true""false"
rotate?string

Clockwise rotation in degrees: 0 (default), 90, 180 or 270

Value in"0""90""180""270"

Response Body

The image or file. Cache-Control: public, max-age=31536000, immutable; CORS is open to every origin. EPS comes as an attachment.

response?string
Example Request
curl -X GET 'https://api.qrdx.dev/v1/barcode?format=ean13&data=590123412345&type=svg'
Example Response
"<svg width=\"129.333mm\" height=\"55.333mm\" shape-rendering=\"crispEdges\" viewBox=\"0 0 388 166\" xmlns=\"http://www.w3.org/2000/svg\">…</svg>"

Last updated on