Skip to main content
v1.0 — Production Ready

Generate QR codes & barcodes with a single API call

Simple REST API for developers. 30+ barcode formats. Multiple output formats. No authentication required. Just send a request and get your code.

31
Barcode formats
<50
ms response time
100
requests/hour free
terminal
$
curl -X POST https://qr-bar.codes/api/qrcode \
-H "Content-Type: application/json" \
-d '{"data": "https://example.com", "format": "png"}'

API Endpoints

Two endpoints. Infinite possibilities.

POST /api/qrcode

Generate QR codes from any text, URL, or data string.

Parameters

data
required string

The content to encode in the QR code

size
optional integer

Size in pixels (50-1000, default: 300)

format
optional string

Output format: svg, png, webp, pdf, eps (default: svg)

POST /api/barcode

Generate barcodes in 31 different formats.

Parameters

type
required string

Barcode format (e.g., CODE_128, EAN_13)

data
required string

The content to encode in the barcode

format
optional string

Output format: svg, png, jpg, html, dynamic-html (default: svg)

Response Format

All endpoints return JSON with base64 encoded data for all formats:

QR Code Formats

svg, eps, png, webp, pdfbase64

Barcode Formats

svg, html, dynamic-html, png, jpgbase64
{
"data": "PHN2ZyB4bWxucz0i...",
"format": "svg"
}

Code Examples

Copy, paste, generate. It's that simple.

cURL — QR Code
curl -X POST https://qr-bar.codes/api/qrcode \
  -H 'Content-Type: application/json' \
  -d '{"data": "https://example.com", "format": "png"}'
JavaScript — QR Code
const response = await fetch('https://qr-bar.codes/api/qrcode', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ data: 'https://example.com', format: 'png' })
});
const { data } = await response.json();
// data is base64 encoded
cURL — Barcode
curl -X POST https://qr-bar.codes/api/barcode \
  -H 'Content-Type: application/json' \
  -d '{"type": "CODE_128", "data": "ABC-12345"}'
PHP — Barcode
$response = Http::post('https://qr-bar.codes/api/barcode', [
    'type' => 'EAN_13',
    'data' => '5901234123457',
    'format' => 'svg'
]);
$svg = base64_decode($response->json('data'));

Supported Barcode Types

31 formats covering retail, logistics, healthcare, and more.

CODE_128 Universal
CODE_128_A Uppercase + control
CODE_128_B Full ASCII
CODE_128_C Numeric pairs
CODE_39 Alphanumeric
CODE_39_CHECKSUM With checksum
CODE_93 Compact
EAN_13 Retail (EU)
EAN_8 Small products
EAN_2 2-digit addon
EAN_5 5-digit addon
UPC_A Retail (US)
UPC_E Small packages
ITF_14 Shipping
INTERLEAVED_2_5 Warehouse
STANDARD_2_5 Industrial
CODABAR Libraries
CODE_11 Telecom
CODE_32 Pharma (IT)
MSI Inventory
MSI_CHECKSUM With checksum
POSTNET USPS mail
PLANET USPS tracking
RMS4CC Royal Mail
KIX PostNL
PHARMA_CODE Pharmaceutical

Rate Limiting

The API allows 1000 requests per hour per IP address. Rate limit headers are included in every response.

# Response Headers
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99