Barcode
Generate a barcode image via GET. Output: SVG (default) or PNG. Supports 25+ formats: EAN-13, Code 128, ITF-14, GS1-128, postal codes and more. Example: ?data=4006381333931&type=ean13
Credit cost: 3 credits per call
data*stringThe data to encode in the barcode. Always a string (including all-digit GTINs). Examples by type:
EAN-13 (retail): 4006381333931 (12 digits accepted; check digit computed)
EAN-8 (small pack): 73513535
UPC-A (North America): 012345678905
Code 128 (general): HELLO-WORLD-2026 or INV-2026-00456
Code 39 (uppercase): CODE39-DEMO or SHELF-A12
ITF-14 (carton): 00012345678905
GS1-128 (with AIs): (01)12345678901234(17)260101
Codabar (library): A1234567890B
POSTNET (postal): 902100123
type?stringBarcode format. Default: code128.
Retail: ean13, ean8, ean5, ean2, upca, upce
General: code128, code39, code39ext, code93, code93ext
Logistics: itf, itf14, gs1-128, gs1-databar, gs1-databar-limited, gs1-databar-expanded
Other: codabar, msi, pharmacode, code11, plessey
Postal: postnet, planet, identcode, leitcode
"code128""code128""ean13""ean8""upca""upce""code39""itf""itf14""codabar""gs1-128""postnet""planet""plessey"height?numberBar height in pixels. Default: 80. Typical values: 50 (compact), 80 (standard), 100–120 (tall labels). Example: ?height=100
color?stringBar color as a CSS color string. Default: #000. Examples: ?color=%231e293b (dark slate), ?color=%230f172a (near black), ?color=%237c3aed (purple), ?color=%23dc2626 (red). Use %23 to URL-encode the # character.
show_text?booleanShow human-readable text below the bars. Example: ?show_text=true. Combine with font_size and text_align for print labels.
text_position?stringPosition of the human-readable text label. Default: bottom. Example: ?text_position=top
"bottom""bottom""top"text_align?stringHorizontal alignment of the text label. Default: center. Example: ?text_align=left
"center""center""left""right"font_size?numberFont size of the text label in pixels. Default: 14. Example: ?font_size=12
font_family?stringFont family of the text label. Default: monospace. Examples: ?font_family=monospace, ?font_family=sans-serif, ?font_family=Arial
bar_width?numberWidth multiplier per module (bar). Default: 2. Increase for wider, more scannable barcodes. Example: ?bar_width=3
bar_gap?numberExtra horizontal spacing between bars in pixels. Default: 0. Example: ?bar_gap=1
background?stringBackground fill color. Default: #fff. Use transparent for no background. Example: ?background=%23f8fafc
margin?numberUniform margin around the barcode in pixels. Default: 10. Overridden per side by margin_top/bottom/left/right. Example: ?margin=6
margin_top?numberTop margin in pixels (overrides margin). Example: ?margin_top=4
margin_bottom?numberBottom margin in pixels (overrides margin). Example: ?margin_bottom=4
margin_left?numberLeft margin in pixels (overrides margin). Example: ?margin_left=8
margin_right?numberRight margin in pixels (overrides margin). Example: ?margin_right=8
rotation?numberRotate the barcode by 0, 90, 180 or 270 degrees. Default: 0. Use 90 or 270 for vertical label orientation. Example: ?rotation=90
090180270bearer_bars?booleanAdd horizontal bearer bars above and below the barcode. Required for ITF-14. Default: false. Example: ?bearer_bars=true
unit?stringMeasurement unit for dimensions. Default: px. Use mm, in or cm for print-ready output. Example: ?unit=mm
"px""px""mm""in""cm"aria_label?stringAccessible label added as aria-label on the SVG element. Improves screen reader support. Example: ?aria_label=EAN-13+barcode+for+product+4006381333931
title?stringSVG element for tooltip and accessibility. Example: ?title=Product+Barcode
desc?stringSVG element for extended accessibility description. Example: ?desc=EAN-13+encoding+GTIN+for+Nivea+cream+75ml
format?stringOutput format. Default: svg. Use png to get a raster image. SVG is lossless and scalable; PNG is pixel-based and suitable for email, PDF or messaging. Example: ?format=png
"svg""svg""png"fields?stringComma-separated list of response fields to return, with dot notation for nested fields (e.g. name,location.city).
is_async?booleanRun the request as a background job: the API answers 202 with a job_id to poll on GET /v1/jobs/{id}.
falsesoft_fail?booleanReturn HTTP 200 even when the request fails; the error is in the error field of the body.
falseSuccessful response
response?filebinarycurl -X GET 'https://api.chartquery.com/v1/barcode?data=string'"string"