How to generate QR codes in code

Generate a QR code for any payload — links, WiFi, contacts and more — in one request. Examples in curl, JavaScript, and Python.

curl (SVG)

curl "https://qr.wrapper-agency.com/api/v1/qr?type=url&data=https://example.com&format=svg" \
  -o qrcode.svg

JavaScript (fetch — JSON with SVG + PNG)

const res = await fetch(
  "https://qr.wrapper-agency.com/api/v1/qr?type=url&data=https://example.com&format=json"
);
const { svg, dataURL } = await res.json();
// svg     -> inline SVG markup
// dataURL -> data:image/png;base64,... (drop into an <img src>)

Python (requests — WiFi QR)

import requests
r = requests.get(
    "https://qr.wrapper-agency.com/api/v1/qr",
    params={"type": "wifi", "ssid": "MyWiFi", "password": "secret",
            "encryption": "WPA", "format": "png"},
)
open("wifi.png", "wb").write(r.content)

Customizing the output

Add size (pixels), margin (quiet-zone), dark and light (hex colors), and ecLevel (error correction: L, M, Q, H). Higher error correction survives smudges and logos but makes a denser code.

Batch & high-res

For many codes at once or large print-ready PNGs, use the paid POST /api/v1/pro/qr endpoint, which accepts an items array and is metered with x402 micro-payments.

See the full API reference. QR codes are rendered on the fly and never stored.