QRdx
HelpGuidesDevelopersReact librarySelf-hosting

Render a QR code image

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

No 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.

GET
/qr

Query Parameters

data*string

Text or URL to encode

Length1 <= length <= 2048
size?integer

Width and height in pixels

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""eps"

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