QRFreeQR

API Documentation

Generate QR codes programmatically. Free tier: 100 calls/day. Upgrade to Pro for 10,000/day.

Endpoint

POST https://freeqr.tools/api/v1/generate

Request Body

FieldTypeRequiredDescription
typestringYesQR code type (see types below)
dataobjectYesType-specific data fields
optionsobjectNoCustomization (size, colors, error correction)

Options

OptionTypeDefaultDescription
sizenumber300Image size in pixels (100-1000)
fgColorstring#000000Foreground color (hex)
bgColorstring#ffffffBackground color (hex)
errorCorrectionLevelstringML, M, Q, or H (higher = more resilient)

Response

{
  "qr": "data:image/png;base64,iVBORw0KGgo...",
  "type": "url",
  "content": "https://example.com",
  "size": 400
}

The qr field is a base64 PNG data URL you can use directly as an image src.

Rate Limits

PlanDaily LimitPrice
Free100 calls/day$0
Pro10,000 calls/day$12/mo

Code Examples

cURL

curl -X POST https://freeqr.tools/api/v1/generate \
  -H "Content-Type: application/json" \
  -d '{
    "type": "url",
    "data": { "url": "https://example.com" },
    "options": { "size": 400, "fgColor": "#000000" }
  }'

JavaScript

const res = await fetch("https://freeqr.tools/api/v1/generate", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    type: "wifi",
    data: { ssid: "MyNetwork", password: "s3cret", encryption: "WPA" },
    options: { size: 300 },
  }),
});
const { qr } = await res.json();
// qr is a base64 PNG data URL: "data:image/png;base64,..."
document.getElementById("img").src = qr;

Python

import requests
import base64

res = requests.post("https://freeqr.tools/api/v1/generate", json={
    "type": "vcard",
    "data": {
        "name": "Jane Doe",
        "phone": "+1234567890",
        "email": "jane@example.com",
        "company": "Acme Inc"
    }
})
qr_data_url = res.json()["qr"]
# Save as PNG
header, data = qr_data_url.split(",", 1)
with open("contact.png", "wb") as f:
    f.write(base64.b64decode(data))

QR Code Types

TypeData FieldsDescription
urlurlWebsite URL
texttextPlain text
wifissid, password, encryptionWiFi auto-connect
vcardname, phone, email, company, urlContact card
emailto, subject, bodyPre-filled email
smsphone, messagePre-filled SMS
phonephonePhone call
whatsappphone, messageWhatsApp chat
locationlatitude, longitudeMap location

Error Handling

// 400 Bad Request
{ "error": "Missing 'type' field.", "validTypes": [...] }

// 422 Generation Error
{ "error": "QR generation failed: ..." }

// 429 Rate Limited
{ "error": "Rate limit exceeded...", "limit": 100, "remaining": 0 }

// CORS: All origins allowed
Want API access + no ads? Pro coming soon.