Generate styled QR codes programmatically. Cache-first: each unique QR is generated once and served forever.
Free tier: no auth required (10 req/min per IP).
Premium: pass X-API-Key header or ?api_key= query param (60 req/min).
Get your key at patreon.html after becoming a supporter.
Generate and return an SVG QR code.
curl "/api/qr?data=https://example.com&color=%2384cc16&bg=%23ffffff&mode=gradient&color2=%2322c55e&dotType=extra-rounded&cornerType=dot"
| Param | Type | Default | Tier |
|---|---|---|---|
data | string | repo URL | free |
color | hex | #000000 | free |
bg | hex | #ffffff | free |
mode | single | gradient | single | premium |
color2 | hex | — | premium |
dotType | square, rounded, extra-rounded, dots, classy | square | premium |
cornerType | square, extra-rounded, dot | square | premium |
size | px | 300 | free: ≤300, premium: ≤2000 |
Same as GET but accepts JSON body. Returns { url, cached }.
Add ?dl=1 to download the SVG directly instead of getting JSON.
curl -X POST /api/qr/generate \
-H "Content-Type: application/json" \
-H "X-API-Key: qropt_..." \
-d '{"data":"https://example.com","dotType":"dots"}'
curl -X POST "/api/qr/generate?dl=1" \
-H "Content-Type: application/json" \
-H "X-API-Key: qropt_..." \
-d '{"data":"https://example.com"}' \
-o qr-code.svg
Retrieve a previously generated QR by its cache hash.
Create a new API key (requires Patreon supporter session).
| Free | Tier 1 ($3) | Tier 2 ($10) | Tier 3 ($50) | |
|---|---|---|---|---|
| Rate limit | 10/min | 60/min | 120/min | 300/min |
| Dot types | square only | all | all | all |
| Gradient | — | ✓ | ✓ | ✓ |
| Max size | 300px | 600px | 1000px | 2000px |
| API key | — | — | ✓ (3 keys) | ✓ (10 keys) |