تخطي إلى المحتوى
POST AI agent ready /v1/barcode

Barcode API - Free Code128, EAN-13 Generator

Create printable Code128B barcodes from product codes, serial numbers, or arbitrary strings. The API encodes any printable ASCII text and returns a crisp SVG that scales for labels, invoices, and packaging.

Parameters

stringrequired

The value to encode. Must contain printable ASCII characters (space through tilde).

number

Total width of the barcode image in pixels (50-2000).

number

Height of the barcode image in pixels (20-1000).

boolean

Whether to display the encoded value as text below the barcode.

Code examples

curl -X POST https://api.botoi.com/v1/barcode \
  -H "Content-Type: application/json" \
  -d '{"data":"1234567890128","width":200,"height":100,"show_text":true}'

When to use this API

Product label printing

Generate EAN-13 or UPC barcodes from your product database and embed them in label templates. Print directly to thermal or laser printers for retail-ready packaging.

Internal inventory tracking

Encode internal SKU numbers as Code128 barcodes and print adhesive labels for warehouse shelves, bins, and pallets. Staff scan with handheld readers during pick-and-pack.

Invoice and shipping documents

Add a Code128 barcode to PDF invoices or packing slips. Encoding the order ID lets your fulfillment team scan the document to pull up order details instantly.

Frequently asked questions

Which barcode type should I use for retail products?
EAN-13 is standard in most countries outside North America. UPC-A (UPC) is standard in the United States and Canada. If you sell internationally, check which symbology your retailers require.
Can I encode letters and special characters?
Code128 supports the full ASCII character set, including letters, numbers, and symbols. EAN, UPC, ITF-14, and MSI are numeric-only formats.
Does the API validate check digits?
Yes. For EAN-13 and UPC, if you provide the data without a check digit, the API calculates and appends it. If you include an incorrect check digit, the API returns a validation error.
What output format does the API return?
The API returns an SVG image. SVG scales to any size without pixelation, making it ideal for print labels at 300+ DPI as well as on-screen display.
How do I convert the SVG barcode to a PNG for printing?
You can rasterize the SVG in a browser canvas, use a server-side library like sharp or Inkscape, or open the SVG in any image editor and export as PNG at your target DPI.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.