Free API Documentation
Generate QR codes and barcodes instantly via a simple GET request. No API key. No sign-up.
Introduction
<img> tag, cURL, JavaScript, Python, or any HTTP client.
The Free API provides two endpoints: QR code generation and barcode generation. Both return the image directly as binary — not wrapped in JSON — so you can use the URL anywhere an image source is accepted.
Base URL
https://codeprints.site/api/v1
Rate Limits
| Endpoint | Limit | Window |
|---|---|---|
/api/v1/get_qr | 120 requests | per minute, per IP |
/api/v1/get_barcode | 120 requests | per minute, per IP |
429 Too Many Requests. Wait 60 seconds before retrying.
Need higher limits? Register for an API key (60 req/min authenticated).
Response Format
On success the API returns the raw image bytes with the appropriate Content-Type header.
On error it returns JSON with an error key.
Content-Type: image/svg+xml
Content-Type: image/jpeg
{
"error": "Missing required parameter: data"
}
QR Code API
Returns a QR code image directly. Supports PNG and SVG output with full color customization.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
data required |
string | — | The text or URL to encode in the QR code. Max 2048 chars. |
size optional |
integer | 300 |
Output size in pixels. Range: 100–1000. |
format optional |
string | png |
png or svg. SVG is vector and infinitely scalable. |
margin optional |
integer | 1 |
Quiet zone (white border) around QR. Range: 0–10. |
fg optional |
string | 000000 |
Foreground (module) color as 6-digit hex. With or without #. |
bg optional |
string | ffffff |
Background color as 6-digit hex. With or without #. |
Examples
Minimal — just encode some data:
https://codeprints.site/api/v1/get_qr?data=Hello+World
URL QR code, large, SVG:
https://codeprints.site/api/v1/get_qr?data=https://example.com&size=500&format=svg
Custom indigo color, 400px:
https://codeprints.site/api/v1/get_qr?data=12345&fg=6366f1&bg=eef2ff&size=400
WhatsApp deep-link:
https://codeprints.site/api/v1/get_qr?data=https://wa.me/447911123456&size=300
Try It — QR Code
Generated URL:
Use this URL directly in an <img src="..."> tag.
Barcode API
Returns a barcode image directly. Supports PNG, SVG, and JPG output across 14 standard barcode formats.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
data required |
string | — | The value to encode. Max 255 chars. Must be valid for the chosen barcode type. |
type optional |
string | C128 |
Barcode format. See the Barcode Types table. Default is Code 128 which accepts any alphanumeric input. |
format optional |
string | png |
png, svg, or jpg. |
width optional |
integer | 2 |
Bar width multiplier. Range: 1–5. Higher = wider bars. |
height optional |
integer | 80 |
Bar height in pixels. Range: 30–300. |
fg optional |
string | 000000 |
Bar color as 6-digit hex. With or without #. |
Supported Barcode Types
C128C128AC128BC128CC39C39+EAN13EAN8UPCAUPCEI25MSICODABARPDF417type=C128 — it encodes any text or number and is the most widely scanned format.
Examples
Basic Code 128 barcode:
https://codeprints.site/api/v1/get_barcode?data=12345
EAN-13 product barcode, tall, SVG:
https://codeprints.site/api/v1/get_barcode?data=590123412345&type=EAN13&height=120&format=svg
Wide Code 39, custom color:
https://codeprints.site/api/v1/get_barcode?data=HELLO&type=C39&width=3&height=100&fg=6366f1
Large JPG for print:
https://codeprints.site/api/v1/get_barcode?data=987654321&format=jpg&width=4&height=200
Try It — Barcode
Generated URL:
Use this URL directly in an <img src="..."> tag.
Integration Guides
HTML <img> tag
<!-- QR code --> <img src="https://codeprints.site/api/v1/get_qr?data=Hello+World&size=300" alt="QR Code" width="300" height="300"> <!-- Barcode --> <img src="https://codeprints.site/api/v1/get_barcode?data=12345&height=80" alt="Barcode">
cURL
# Download QR code as PNG curl -o qr.png "https://codeprints.site/api/v1/get_qr?data=Hello+World&size=300" # Download barcode as SVG curl -o barcode.svg "https://codeprints.site/api/v1/get_barcode?data=12345&type=C128&format=svg&height=100" # View in browser (pipe to open) curl -s "https://codeprints.site/api/v1/get_qr?data=https://example.com" | open -f -a Preview
JavaScript (fetch)
// ── QR Code ────────────────────────────── const qrUrl = `https://codeprints.site/api/v1/get_qr?data=${encodeURIComponent('Hello World')}&size=300`; document.getElementById('myImg').src = qrUrl; // ── Barcode (blob → object URL) ─────────── async function loadBarcode(data) { const url = `https://codeprints.site/api/v1/get_barcode?data=${encodeURIComponent(data)}&type=C128&height=80`; const res = await fetch(url); const blob = await res.blob(); const img = document.getElementById('bcImg'); img.src = URL.createObjectURL(blob); } loadBarcode('12345');
PHP
// ── Save QR code to file ────────────────── $data = urlencode('Hello World'); $url = "https://codeprints.site/api/v1/get_qr?data={$data}&size=300"; $image = file_get_contents($url); file_put_contents('qr.png', $image); // ── Serve inline to browser ─────────────── header('Content-Type: image/png'); $bc = urlencode('12345'); echo file_get_contents("https://codeprints.site/api/v1/get_barcode?data={$bc}&type=EAN13&height=100");
Python (requests)
import requests # ── Download QR code ────────────────────── params = {'data': 'Hello World', 'size': 300, 'format': 'png'} r = requests.get('https://codeprints.site/api/v1/get_qr', params=params) with open('qr.png', 'wb') as f: f.write(r.content) # ── Download barcode ────────────────────── params = {'data': '12345', 'type': 'C128', 'height': 80} r = requests.get('https://codeprints.site/api/v1/get_barcode', params=params) with open('barcode.png', 'wb') as f: f.write(r.content)
Error Reference
| HTTP Code | Meaning | Common Cause |
|---|---|---|
200 OK | Success | Image returned directly. |
400 Bad Request | Missing parameter | data parameter was not provided. |
422 Unprocessable | Validation error | Data too long, invalid format, or incompatible barcode type (e.g. letters in EAN-13). |
429 Too Many Requests | Rate limited | Exceeded 120 req/min. Wait 60 s. |
500 Server Error | Generation failed | Rare — report to support. |
// Error response body (JSON) { "error": "Cannot encode this data with the selected barcode type: ..." }
Need higher limits?
Register for a free account to get an API key with the full authenticated API — detailed JSON responses, error correction control, and more.
Get API Key Free Full API Docs