QRdx
HelpGuidesDevelopersReact librarySelf-hosting

Render a QR code image

A QR code image as SVG (default), PNG, WebP or EPS, with no key.

No key or token needed, and it doesn't use your daily quota: put the URL straight into an <img> tag. The same query always returns the same bytes, so responses are cached for a year. Colors are hex without # (or with # encoded as %23). Limit: 300 requests a minute per IP address. More in the Image API guide.

The editor's styles. style takes the whole design as URL-encoded JSON, with the same fields as a saved theme: gradients (linear, radial), frames including custom frame specs, border templates, eye and dot colors, and a logo icon. It also takes the style value of a playground link. item renders a community frame or theme (/community/items); frame and frameText add a built-in frame. Flat parameters you set win over style, and style wins over item. With a frame, size is the code's width and the frame adds to it.

Logos. logoIcon draws one of the editor's quick icons, or a brand logo by its Simple Icons slug (spotify, paypal:white). logoFileId draws an image you uploaded, and needs Authorization: Bearer qrdx_… from the workspace that owns it; that response is private and counts toward the daily quota. QRdx never fetches a logo from an address you send. Logo QR and Image QR art aren't available here.

Caching. Renders with item are cached for 5 minutes (10 at the CDN), since an item can change; renders with logoFileId aren't cached.

WebP is lossless: the same pixels as the PNG in a smaller file, transparency included.

GET
/qr

Query Parameters

data*string

Text or URL to encode

Length1 <= length <= 2048
size?integer

Width and height in pixels (with a frame: the code's width; the frame adds to it)

Range64 <= value <= 2048
Default512
fg?string

Foreground (module) color as hex

Match^#?(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$
Default"#000000"
bg?string

Background color as hex

Match^#?(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$
Default"#ffffff"
eyeColor?string

Color of the three corner eyes (defaults to fg)

Match^#?(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$
dotColor?string

Color of the dot inside each corner eye (defaults to fg)

Match^#?(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$
body?string

Shape of the data modules

Default"square"
Value in"circle""circle-large""square""diamond""circle-mixed""pacman""rounded""small-square""vertical-line""horizontal-line""liquid""liquid-horizontal""liquid-vertical""classy""classy-rounded""leaf""plus""hexagon""star""heart""random-dots""mosaic""octagon"
eye?string

Shape of the corner eye frames

Default"square"
Value in"square""rounded""gear""circle""diya""extra-rounded""message""pointy""leaf""drop""octagon""bevel""squircle""cushion""shield""petal""leaf-reverse"
dot?string

Shape of the dot inside each corner eye

Default"square"
Value in"square""rounded""circle""message""message-reverse""diya""diya-reverse""rounded-triangle""leaf""drop""plus""cross-rounded""hexagon""octagon""flower""heart""squircle""dots""extra-rounded""leaf-reverse""drop-reverse"
level?string

Error correction level: L 7%, M 15%, Q 25%, H 30%

Default"Q"
Value in"L""M""Q""H"
margin?integer

Quiet zone around the code, in modules

Range0 <= value <= 16
Default4
template?string

Decorative frame template

Value in"default""Arrow""StandardBox""SquareBorder""StrikedBox""Halloween"
format?string

Image format

Default"svg"
Value in"svg""png""webp""eps"
style?string

The editor's whole style: URL-encoded JSON with the same fields as a saved theme (gradients, frames including custom frame specs, border templates, eye and dot colors, logoIcon, logoFileId), or the style value of a playground link (1.…). Flat parameters you also set win over it.

Lengthlength <= 8192
item?string

A community theme or frame by id, such as frame:wifi-table-card (from /v1/community/items). style and flat parameters win over it.

Lengthlength <= 100
frame?string

A built-in call-to-action frame around the code

Value in"banner-bottom""banner-top""border""rounded-border""speech-bubble""banner-top-bottom""speech-bubble-top""chat-bubble""circle""polaroid""phone""ticket""badge""envelope""tag""menu-card""sticker""gradient-border""focus"
frameText?string

The frame's label, up to 24 characters (default "Scan me"; empty hides it)

Lengthlength <= 24
logoIcon?string

A logo QRdx draws: a quick icon on a white tile (wifi, location, phone, email, link, file, calendar, whatsapp, instagram), or any brand from Simple Icons by its slug (spotify, paypal, googlemaps), drawn in its brand color. Add :black or :white for those colors (whatsapp:white). Brand logos have no tile; set logoOptions.plate for a plate behind one.

Match^[a-z0-9]{1,64}(?::(?:brand|black|white))?$
logoFileId?string

A logo you uploaded (PNG or JPEG, up to 1 MB) by file id. Needs Authorization: Bearer qrdx_… from the workspace that owns the file; the response is then private and not cached.

Match^[a-z0-9]{20,40}$

Response Body

The image. Cache-Control: public, max-age=31536000, immutable; CORS is open to every origin.

response?string
Example Request
curl -X GET 'https://api.qrdx.dev/v1/qr?data=https%3A%2F%2Fqrdx.dev&format=svg'
Example Response
"<svg height=\"512\" viewBox=\"0 0 512 512\" width=\"512\" xmlns=\"http://www.w3.org/2000/svg\"><rect fill=\"#ffffff\" height=\"512\" width=\"512\" x=\"0\" y=\"0\"/><g fill=\"#000000\">…</g></svg>"

Last updated on