Barcode
barcodeEncode data into scannable SVG or PNG 1D codes in 25+ formats for product labels, packaging, and print-ready output.
Instructions
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. Credit cost: 3 credits per call.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"data": "<data>"
},
"name": "barcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The data to encode in the barcode. Examples by type: | |
| desc | No | SVG <desc> element for extended accessibility description. Example: ?desc=EAN-13+encoding+GTIN+for+Nivea+cream+75ml | |
| type | No | Barcode format. Default: code128. Allowed values: code128, code39, code39ext, code93, code93ext, ean13, ean8, ean5, ean2, upca, upce, itf, itf14, codabar, msi, pharmacode, code11, gs1-128, gs1-databar, gs1-databar-limited, gs1-databar-expanded, identcode, leitcode, postnet, planet, plessey. Default: "code128". | |
| unit | No | Measurement unit for dimensions. Default: px. Use mm, in or cm for print-ready output. Example: ?unit=mm Allowed values: px, mm, in, cm. Default: "px". | |
| color | No | Bar 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. | |
| share | No | Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding. Default: false. | |
| title | No | SVG <title> element for tooltip and accessibility. Example: ?title=Product+Barcode | |
| fields | No | Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost. | |
| format | No | Output 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 Allowed values: svg, png. Default: "svg". | |
| height | No | Bar height in pixels. Default: 80. Typical values: 50 (compact), 80 (standard), 100–120 (tall labels). Example: ?height=100 | |
| margin | No | Uniform margin around the barcode in pixels. Default: 10. Overridden per side by margin_top/bottom/left/right. Example: ?margin=6 | |
| bar_gap | No | Extra horizontal spacing between bars in pixels. Default: 0. Example: ?bar_gap=1 | |
| rotation | No | Rotate the barcode by 0, 90, 180 or 270 degrees. Default: 0. Use 90 or 270 for vertical label orientation. Example: ?rotation=90 | |
| bar_width | No | Width multiplier per module (bar). Default: 2. Increase for wider, more scannable barcodes. Example: ?bar_width=3 | |
| font_size | No | Font size of the text label in pixels. Default: 14. Example: ?font_size=12 | |
| show_text | No | Show human-readable text below the bars. Example: ?show_text=true. Combine with font_size and text_align for print labels. | |
| aria_label | No | Accessible label added as aria-label on the SVG element. Improves screen reader support. Example: ?aria_label=EAN-13+barcode+for+product+4006381333931 | |
| background | No | Background fill color. Default: #fff. Use transparent for no background. Example: ?background=%23f8fafc | |
| margin_top | No | Top margin in pixels (overrides margin). Example: ?margin_top=4 | |
| text_align | No | Horizontal alignment of the text label. Default: center. Example: ?text_align=left Allowed values: center, left, right. Default: "center". | |
| bearer_bars | No | Add horizontal bearer bars above and below the barcode. Required for ITF-14. Default: false. Example: ?bearer_bars=true | |
| font_family | No | Font family of the text label. Default: monospace. Examples: ?font_family=monospace, ?font_family=sans-serif, ?font_family=Arial | |
| margin_left | No | Left margin in pixels (overrides margin). Example: ?margin_left=8 | |
| margin_right | No | Right margin in pixels (overrides margin). Example: ?margin_right=8 | |
| margin_bottom | No | Bottom margin in pixels (overrides margin). Example: ?margin_bottom=4 | |
| text_position | No | Position of the human-readable text label. Default: bottom. Example: ?text_position=top Allowed values: bottom, top. Default: "bottom". |