CodePrints
Free Public API

Free API Documentation

Generate QR codes and barcodes instantly via a simple GET request. No API key. No sign-up.

No API key required No sign-up Returns image directly PNG · SVG · JPG

Introduction

100% Free — No API key needed. Just make a GET request with your data and get an image back. Works in any browser, <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://www.codeprints.site/api/v1
Rate Limits
EndpointLimitWindow
/api/v1/get_qr120 requestsper minute, per IP
/api/v1/get_barcode120 requestsper minute, per IP
Exceeding the limit returns HTTP 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.

Success (200)
Content-Type: image/png
Content-Type: image/svg+xml
Content-Type: image/jpeg
Body = raw image bytes
Error (4xx)
{
  "error": "Missing required parameter: data"
}

QR Code API

GET https://www.codeprints.site/api/v1/get_qr

Returns a QR code image directly. Supports PNG and SVG output with full color customization.

Parameters
ParameterTypeDefaultDescription
data required string The text or URL to encode in the QR code. Max 2048 chars.
size optional integer300 Output size in pixels. Range: 100–1000.
format optional stringpng png or svg. SVG is vector and infinitely scalable.
margin optional integer1 Quiet zone (white border) around QR. Range: 0–10.
fg optional string000000 Foreground (module) color as 6-digit hex. With or without #.
bg optional stringffffff Background color as 6-digit hex. With or without #.
Examples

Minimal — just encode some data:

https://www.codeprints.site/api/v1/get_qr?data=Hello+World

URL QR code, large, SVG:

https://www.codeprints.site/api/v1/get_qr?data=https://example.com&size=500&format=svg

Custom indigo color, 400px:

https://www.codeprints.site/api/v1/get_qr?data=12345&fg=6366f1&bg=eef2ff&size=400

WhatsApp deep-link:

https://www.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

GET https://www.codeprints.site/api/v1/get_barcode

Returns a barcode image directly. Supports PNG, SVG, and JPG output across 14 standard barcode formats.

Parameters
ParameterTypeDefaultDescription
data required string The value to encode. Max 255 chars. Must be valid for the chosen barcode type.
type optional stringC128 Barcode format. See the Barcode Types table. Default is Code 128 which accepts any alphanumeric input.
format optional stringpng png, svg, or jpg.
width optional integer2 Bar width multiplier. Range: 1–5. Higher = wider bars.
height optional integer80 Bar height in pixels. Range: 30–300.
fg optional string000000 Bar color as 6-digit hex. With or without #.
Supported Barcode Types
C128
Code 128
Any alphanumeric — best default
C128A
Code 128 A
Uppercase + control chars
C128B
Code 128 B
Full ASCII
C128C
Code 128 C
Even-length digits only
C39
Code 39
Uppercase + digits + symbols
C39+
Code 39 Ext.
Full ASCII via Code 39
EAN13
EAN-13
Exactly 12 digits
EAN8
EAN-8
Exactly 7 digits
UPCA
UPC-A
Exactly 11 digits
UPCE
UPC-E
6-digit compact UPC
I25
ITF-25
Even-length digits
MSI
MSI/Plessey
Digits only
CODABAR
Codabar
Digits + - $ : / . +
PDF417
PDF 417
High-density 2D
When in doubt use type=C128 — it encodes any text or number and is the most widely scanned format.
Examples

Basic Code 128 barcode:

https://www.codeprints.site/api/v1/get_barcode?data=12345

EAN-13 product barcode, tall, SVG:

https://www.codeprints.site/api/v1/get_barcode?data=590123412345&type=EAN13&height=120&format=svg

Wide Code 39, custom color:

https://www.codeprints.site/api/v1/get_barcode?data=HELLO&type=C39&width=3&height=100&fg=6366f1

Large JPG for print:

https://www.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://www.codeprints.site/api/v1/get_qr?data=Hello+World&size=300"
     alt="QR Code" width="300" height="300">

<!-- Barcode -->
<img src="https://www.codeprints.site/api/v1/get_barcode?data=12345&height=80"
     alt="Barcode">
cURL
# Download QR code as PNG
curl -o qr.png "https://www.codeprints.site/api/v1/get_qr?data=Hello+World&size=300"

# Download barcode as SVG
curl -o barcode.svg "https://www.codeprints.site/api/v1/get_barcode?data=12345&type=C128&format=svg&height=100"

# View in browser (pipe to open)
curl -s "https://www.codeprints.site/api/v1/get_qr?data=https://example.com" | open -f -a Preview
JavaScript (fetch)
// ── QR Code ──────────────────────────────
const qrUrl = `https://www.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://www.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://www.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://www.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://www.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://www.codeprints.site/api/v1/get_barcode', params=params)
with open('barcode.png', 'wb') as f:
    f.write(r.content)
Error Reference
HTTP CodeMeaningCommon Cause
200 OKSuccessImage returned directly.
400 Bad RequestMissing parameterdata parameter was not provided.
422 UnprocessableValidation errorData too long, invalid format, or incompatible barcode type (e.g. letters in EAN-13).
429 Too Many RequestsRate limitedExceeded 120 req/min. Wait 60 s.
500 Server ErrorGeneration failedRare — 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