Barcode Generator

/api/barcode 1 credit(s) per call

Generate 1D barcodes in popular symbologies including Code 128, EAN-13, UPC-A, and more.

Overview

The Barcode Generator API creates PNG 1D barcodes in popular symbologies including Code 128, Code 39, EAN-13, and UPC-A.

Endpoint

POST /api/barcode
GET /api/barcode/generate?text=...&format=code128&width=400&height=150

Request Parameters

Parameter Type Required Description
text string Yes The data to encode
format string No Barcode symbology (default: code128). See supported formats below.
width int No Image width in pixels (default: 256, max: 2000)
height int No Image height in pixels (default: 96, max: 1000)
includeText bool No Show human-readable text below the barcode (default: true)

Supported Formats

code128 Code 128
code39 Code 39
code93 Code 93
ean13 EAN-13
ean8 EAN-8
upca UPC-A
upce UPC-E
codabar Codabar
itf14 ITF-14
interleaved2of5 Interleaved 2 of 5
standard2of5 Standard 2 of 5
msi MSI Plessey
pharmacode Pharmacode
postnet PostNet

Example

Generate a Code 128 barcode:

curl -X POST https://simplewebapis.com/api/barcode \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: swa_your_key" \
  -d '{"text": "Hello World", "format": "code128", "width": 400, "height": 150}'

The response is a PNG image (Content-Type: image/png).

Try it out

Use the Playground to test this API live.