Render

Render a QR code

Styled, optionally logo-bearing QR codes, drawn natively and verified before delivery: every response is decoded and compared to data on the way out. A code that would not scan is a 422 unscannable and nothing is counted - the guarantee is the feature.

A logo forces the highest error-correction level and is composited over the center on a knockout tile (logo_pad). Send it inline as a data: URI (logo) or by URL (logo_url); remote logos face the same target guard and rate caps as screenshot URLs.

QRs are deterministic, so identical requests hit the cache and cache hits count nothing. Each code counts one render.qr, a free utility: it shows in usage and is never charged. Output never carries a badge - a mark inside a scannable symbol would corrupt it.

To place a QR inside a stored template render, use the qr object on POST /v1/image/{id} instead - each entry becomes a {{qr.<name>}} variable holding a data URI.

post/v1/qr

Request

  • Base URL: https://api.ironfang.com/render
  • URL: https://api.ironfang.com/render/v1/qr
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Makes a synchronous render happen, and count, at most once. Any string up to 255 characters, remembered per account. The first request under a key is admitted and rendered as usual; a synchronous result is not kept, so the same request again under the key is a 409 idempotency_key_used and reserves nothing - send a new key to render again. A different request under a used key is a 409 idempotency_conflict. An identical request inside the cache window is still served from cache.

Request body

darkstring

Module color, #rgb or #rrggbb. Must actually be darker than light.

datastring required

The payload - a URL, WiFi string, or any text up to 1KB.

dots'square' | 'circle'

Module style. circle draws separated dots. Finder patterns always render solid - styled finders are how QR generators produce codes that do not scan.

ecc'L' | 'M' | 'Q' | 'H'

Error-correction level. Forced to H when a logo is present - the logo destroys the modules it covers, and that budget has to come from somewhere.

eyes'square' | 'rounded'

Finder-pattern style. Defaults to match dots.

invertboolean

Light modules on a dark ground. Explicit because it narrows the audience: modern phone cameras read inverted codes, many embedded and in-app scanners do not - use it for screens, not print or payments. With the flag set, dark (the module color) must be lighter than light (the ground). Verified against the negative, so the structural guarantee holds.

lightstring

Background color, or transparent. Transparent codes are verified against a white ground - place them on light surfaces.

logostring

Center mark as a base64 data: URI, png or jpeg, up to 1MB decoded. Mutually exclusive with logo_url.

logo_padboolean

Knockout tile behind the logo so it sits on clean ground.

logo_sizenumber

Logo tile as a fraction of the symbol width.

logo_urlstring uri

Center mark by URL. SSRF-guarded and rate-capped like a render target.

margininteger

Quiet zone, in modules.

sizeinteger

Output side in pixels. Output is always square PNG.

Response

The rendered image. png unless format: jpeg was requested.

Changes

No recorded changes to this operation across all 1 revision of this API.