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 filename
  • X-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 key
  • 400 validation_error — a field failed validation
  • 400 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 URL
  • 429 quota_exceeded — monthly generation cap reached (response includes upgradeUrl)

Core

FieldTypeDefaultDescription
urlstring (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.
imagefile, required—Source photo the QR is steered to visually resemble.
labelstring, ≤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

FieldTypeDefaultDescription
versioninteger, 1–405QR version (size/capacity).
errorCorrectionL | M | Q | HMReed-Solomon error-correction level. Higher tolerates more damage/occlusion but leaves less room for the image to influence pixels.
scannabilitylow | moderate | high | guaranteed | customhighSets 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

FieldTypeDefaultDescription
dotShapesquare | circle | brushsquareShape of the mark drawn within each module (see dotSizeRatio) — the rest of the module stays a plain filled cell regardless of this setting.
dotSizeRationumber, 0–10.3Fraction 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.
eyeShapesquare | circle | curvedsquareShape of the three finder-pattern "eyes".
alignmentShapethin | thickthickAlignment-pattern stroke weight.

Colors

FieldTypeDefaultDescription
backgroundColorhex color#ffffffComposited 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.
blackhex color#000000Dark-module color.
whitehex color#ffffffLight-module color.
framehex color#ffffffBorder color.
topLeftEyeColorhex color#000000Top-left finder eye color.
topRightEyeColorhex color#000000Top-right finder eye color.
bottomLeftEyeColorhex color#000000Bottom-left finder eye color.
alignmentEyeColorhex color#000000Alignment-pattern color.

Camouflage

FieldTypeDefaultDescription
camobooleantrueBlend QR modules into the photo instead of a flat grid.
camoStrengthweak | mid | strongmidHow aggressively camo blends toward the underlying image.
invertColorbooleanfalseInvert dark/light module colors.

Image framing

FieldTypeDefaultDescription
zoominteger, 0–1000Zoom into the source image before sampling.
panXinteger0Horizontal pan offset (used with zoom).
panYinteger0Vertical pan offset (used with zoom).
objectFitcontain | cover | fillcoverHow a non-square photo maps onto the square QR grid.
imageBrightnessinteger, -255–2550Brightness adjustment applied to the source image.
imageColoringcolored | blackAndWhite | greyscalecoloredColor treatment applied to the source image.
luminanceThresholdinteger, 0–255128Luminance cutoff used when deciding module darkness from the image.
pixelPrioritycontrast | distanceFromCenter | luminance | realQRrealQRStrategy for choosing which QR bits are free to steer toward the image.

Signature

FieldTypeDefaultDescription
signaturestring, ≤40 chars"" (off)Optional text watermark rendered onto the QR.
signaturePositiontopLeft | topRight | bottomLeft | bottomRightbottomRightSignature placement.
signatureOffsetXinteger0Signature horizontal offset in px.
signatureOffsetYinteger0Signature vertical offset in px.
signatureFontFamilystringsystem defaultSystem-resolvable font family name for the signature text.

Output

FieldTypeDefaultDescription
pixPerSqrinteger, 4–10024Pixels per QR module — controls output image resolution.
borderPxinteger, 0–50026Border width in pixels.

Misc

FieldTypeDefaultDescription
verifybooleantrueDecode 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

FieldTypeDefaultDescription
destinationUrlstring (URL)—Repoint the link to a new destination.
labelstring, ≤60 chars, or null—A name for the link, for your own reference in the dashboard. null clears it.
disabledboolean—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).