Developer API

Barcode Embed API

Generate dynamic barcodes on the fly with a simple URL. Zero dependencies, high-performance, and perfectly scalable.

URL Builder

#
#

Generated URL

https://stockpilot.app/api/barcode?data=STOCK-2026
Barcode: STOCK-2026
Live Preview

Endpoint Reference

GEThttps://stockpilot.app/api/barcode

Query Parameters

ParameterTypeDefaultDescription
dataReqstringThe value to encode. Required.
formatstringCODE128Barcode standard. Options: CODE128, EAN13, UPC, EAN8, CODE39, ITF14, MSI, pharmacode.
widthnumber2Width of a single bar (scale factor). Range 1-4.
heightnumber100Height of the barcode in pixels. Range 30-200.
textbooleantrueShow the text value below the bars.
colorhex000000Bar color (6-digit hex without #).
bghexffffffBackground color (6-digit hex without #).
typestringsvgOutput format: 'svg' (vector, crisp) or 'png' (raster).

Integration Examples

HTML
<img src="https://stockpilot.app/api/barcode?data=ITEM-001" alt="Barcode" />
React / Next.js
<img src={`https://stockpilot.app/api/barcode?data=${sku}`} alt="Barcode" />
Markdown
![Barcode](https://stockpilot.app/api/barcode?data=ITEM-001)

Why use this API?

  • Zero client-side dependencies
  • Fast global CDN caching
  • Vector SVG for infinite scaling
  • Works in emails & PDF reports
  • Secure & Private