API Reference
Get an API key from your dashboard after signing up. Every request needs Authorization: Bearer <key>.
POST /api/v1/qr
multipart/form-data. Only url and image are required — everything else below is optional and falls back to a sensible default.
curl --fail-with-body -X POST https://qqqr.io/api/v1/qr \
-H "Authorization: Bearer qre_..." \
-F "url=https://example.com" \
-F "image=@/Users/you/Desktop/photo.jpg" \
-F "eyeShape=curved" \
-F "camoStrength=strong" \
-o /Users/you/Desktop/qr-$(date +%s).png
The API only ever returns bytes — it has no say over what your client does with them, including the output filename. curl -o silently overwrites an existing file of the same name, so the example above varies the filename per call rather than always writing qr.png. For a more meaningful name than a timestamp, use the response's own X-Qr-Short-Id header — every generation gets a unique one.
--fail-with-body matters: plain curl -o writes whatever bytes come back to the output file regardless of HTTP status — so a failed request (quota exceeded, bad key, validation error) silently produces a file named qr-....png that's actually the JSON error body, not an image, with no indication anything went wrong until you try to open it. --fail-with-body (curl 7.76+) still writes that body to the file on failure, but also exits non-zero and prints curl: (22) The requested URL returned error: ... to stderr, so the failure is immediately visible instead of discovered later as "the PNG won't open."
Response
200: raw image/png bytes — pipe straight to a file, no JSON to unwrap. Metadata rides along as headers:
X-Qr-Short-Id / X-Qr-Link-Id — the dynamic link created for this QR; unique per generation, safe to use as a filenameX-Qr-Redirect-Url — the URL actually encoded in the QR (what the QR resolves through)X-Qr-Scanned / X-Qr-Matches / X-Qr-Decoded-Text — present when verify is true (the default)
Errors return JSON with a code field:
401 invalid_api_key — missing or revoked key400 validation_error — a field failed validation400 invalid_image — the image field couldn't be decoded as an image (checked against real file content, not the upload's declared MIME type)400 url_too_long — the destination URL is too long to fit the chosen version/errorCorrection combination; raise version, lower errorCorrection, or shorten the URL429 quota_exceeded — monthly generation cap reached (response includes upgradeUrl)
Core
| Field | Type | Default | Description |
|---|
url | string (URL), required | — | Destination. The QR does not encode this directly — it encodes a repointable redirect link that resolves to this URL, so you can change the destination later without regenerating the image. |
image | file, required | — | Source photo the QR is steered to visually resemble. |
label | string, ≤60 chars | — | A title for the link, for your own reference in the dashboard. Can be changed later via PATCH /v1/links/{id}. |
QR spec
| Field | Type | Default | Description |
|---|
version | integer, 1–40 | 5 | QR version (size/capacity). |
errorCorrection | L | M | Q | H | M | Reed-Solomon error-correction level. Higher tolerates more damage/occlusion but leaves less room for the image to influence pixels. |
scannability | low | moderate | high | guaranteed | custom | high | Sets errorCorrection, dotSizeRatio, and camoStrength together as a tuned trade-off between scan reliability and visual likeness to your photo. Any of those three fields you also set explicitly overrides the preset's value for that field — the preset only fills in what you didn't set. "custom" disables the preset entirely. |
Shape & style
| Field | Type | Default | Description |
|---|
dotShape | square | circle | brush | square | Shape of the mark drawn within each module (see dotSizeRatio) — the rest of the module stays a plain filled cell regardless of this setting. |
dotSizeRatio | number, 0–1 | 0.3 | Fraction of each module covered by its dot mark, for all dot shapes — the only part of a module that's ever guaranteed legible; everything outside it is the raw, unconstrained photo. Lower shows more of the photo but is more fragile under real-world scanning conditions (lighting, wear, distance); higher forces more pure QR contrast and is more robust, at the cost of photo fidelity. Also set by scannability unless overridden here. |
eyeShape | square | circle | curved | square | Shape of the three finder-pattern "eyes". |
alignmentShape | thin | thick | thick | Alignment-pattern stroke weight. |
Colors
| Field | Type | Default | Description |
|---|
backgroundColor | hex color | #ffffff | Composited underneath transparent pixels in your source image before rendering, so a logo/photo with a transparent background doesn't leave gaps or stray colors in the QR — set this to match your print/card background. |
black | hex color | #000000 | Dark-module color. |
white | hex color | #ffffff | Light-module color. |
frame | hex color | #ffffff | Border color. |
topLeftEyeColor | hex color | #000000 | Top-left finder eye color. |
topRightEyeColor | hex color | #000000 | Top-right finder eye color. |
bottomLeftEyeColor | hex color | #000000 | Bottom-left finder eye color. |
alignmentEyeColor | hex color | #000000 | Alignment-pattern color. |
Camouflage
| Field | Type | Default | Description |
|---|
camo | boolean | true | Blend QR modules into the photo instead of a flat grid. |
camoStrength | weak | mid | strong | mid | How aggressively camo blends toward the underlying image. |
invertColor | boolean | false | Invert dark/light module colors. |
Image framing
| Field | Type | Default | Description |
|---|
zoom | integer, 0–100 | 0 | Zoom into the source image before sampling. |
panX | integer | 0 | Horizontal pan offset (used with zoom). |
panY | integer | 0 | Vertical pan offset (used with zoom). |
objectFit | contain | cover | fill | cover | How a non-square photo maps onto the square QR grid. |
imageBrightness | integer, -255–255 | 0 | Brightness adjustment applied to the source image. |
imageColoring | colored | blackAndWhite | greyscale | colored | Color treatment applied to the source image. |
luminanceThreshold | integer, 0–255 | 128 | Luminance cutoff used when deciding module darkness from the image. |
pixelPriority | contrast | distanceFromCenter | luminance | realQR | realQR | Strategy for choosing which QR bits are free to steer toward the image. |
Signature
| Field | Type | Default | Description |
|---|
signature | string, ≤40 chars | "" (off) | Optional text watermark rendered onto the QR. |
signaturePosition | topLeft | topRight | bottomLeft | bottomRight | bottomRight | Signature placement. |
signatureOffsetX | integer | 0 | Signature horizontal offset in px. |
signatureOffsetY | integer | 0 | Signature vertical offset in px. |
signatureFontFamily | string | system default | System-resolvable font family name for the signature text. |
Output
| Field | Type | Default | Description |
|---|
pixPerSqr | integer, 4–100 | 24 | Pixels per QR module — controls output image resolution. |
borderPx | integer, 0–500 | 26 | Border width in pixels. |
Misc
| Field | Type | Default | Description |
|---|
verify | boolean | true | Decode the rendered PNG with an independent scanner before responding, and report the result via response headers. Set false to skip and save latency. |
PATCH /api/v1/links/:id
Update an existing dynamic link — repoint its destination without regenerating the artwork (the printed QR keeps working, it just resolves somewhere new), rename it, or pause/resume it. Free: none of this counts against your generation quota. Send any combination of the three body fields below; at least one is required.
curl -X PATCH https://qqqr.io/api/v1/links/<id> \
-H "Authorization: Bearer qre_..." \
-H "Content-Type: application/json" \
-d '{"destinationUrl": "https://example.com/new-page"}'
Body
| Field | Type | Default | Description |
|---|
destinationUrl | string (URL) | — | Repoint the link to a new destination. |
label | string, ≤60 chars, or null | — | A name for the link, for your own reference in the dashboard. null clears it. |
disabled | boolean | — | Pause (true) or resume (false) the link. A paused link's redirect returns 404 to scanners instead of resolving — never set automatically by billing/quota state, only by this call. |
<id> is the value from X-Qr-Link-Id on the original generate response (or find it in your dashboard). Returns the updated link as JSON ({ id, shortId, destinationUrl, label, disabled, updatedAt }), or an error: 400 validation_error (bad body or malformed id), 404 not_found (id doesn't exist or belongs to a different account).
GET /r/:shortId
This is what every generated QR actually encodes (see url above) — you won't typically call it directly, but it's worth understanding since it's what your end users' scans hit. Documented here for completeness, not authenticated (anyone who scans the code reaches it).
- Active link →
302 redirect to the current destinationUrl. Always 302, never 301 — a permanent redirect would invite long-term caching of the destination, which would defeat repointing. - Unknown or paused (
disabled) link → 404, styled HTML page ("This QR code is no longer active"). - Rate limited to 40 requests/minute per IP →
429, styled HTML page. Generous enough for legitimate rapid scanning/testing from one device; blocks scripted abuse or short-id enumeration. - Increments the link's scan counter on every successful redirect (visible in your dashboard).