QR Code API

Generate QR codes via a simple GET request. All parameters are passed as URL query strings.

Endpoint
GET /api/qr?data=<content>
Parameters
ParameterRequiredDefaultDescription
dataYesThe content to encode in the QR code (URL, text, etc.)
versionNoautoQR version (1–40). Controls symbol size. 'auto' picks the smallest version that fits the data.
ecNoautoError correction level: 'L' (7%), 'M' (15%), 'Q' (25%), 'H' (30%). 'auto' defaults to 'M'.
maskNoautoData mask pattern (0–7). 'auto' lets the encoder choose the optimal mask.
darkNo#000000Hex color for dark modules (use %23 for # in URLs, e.g. %23000000).
lightNo#ffffffHex color for light modules (use %23 for # in URLs, e.g. %23ffffff).
marginNo2Quiet zone size in modules (0–32).
scaleNo8Pixels per module (1–128). Determines output resolution.
formatNopngOutput image format: 'png', 'svg', 'jpeg', or 'webp'.
downloadNofalseSet to 'true' to trigger a file download. When 'false' the image is displayed inline in the browser.
invertNofalseSet to 'true' to swap the dark and light colors, creating a light-on-dark QR code.
Examples

Basic — preview in browser

/api/qr?data=https://example.com

Download as PNG

/api/qr?data=https://example.com&download=true

SVG output

/api/qr?data=Hello%20World&format=svg

Custom colors & high error correction

/api/qr?data=https://example.com&dark=%231e3a5f&light=%23f0f4f8&ec=H

Specific version & scale

/api/qr?data=Test&version=5&scale=16&margin=4

WiFi QR (pre-encoded data string)

/api/qr?data=WIFI:T:WPA;S:MyNetwork;P:secret123;;
Notes
  • Colors use hex format. In URLs, encode # as %23 (e.g. dark=%23ff0000).
  • When download=false (the default), the image is served inline so browsers display it directly.
  • When download=true, the Content-Disposition header triggers a file download.
  • Responses include Cache-Control: public, max-age=86400 for efficient caching.