API
One endpoint, styled SVG out
The same renderer the website uses, exposed over HTTP. No API key, no rate-limit tier, no account. Point it at your own deployment of this app.
Endpoint
GETPOST/api/qrGET takes query parameters, POST takes a JSON body with the same keys. Both return an image/svg+xml document, or a JSON object with an error field and status 400 when something is wrong.
Responses are safe to cache indefinitely — the same parameters always produce the same image. CORS is open, so browser-side calls work.
Examples
curl -o qr.svg \
"https://your-domain.example/api/qr?data=https%3A%2F%2Fupfrog.online&size=800&dotType=extra-rounded&foregroundStyle=linear&gradientColorA=%2315803d&gradientColorB=%230369a1"What comes back
Rendered by the endpoint above with a linear gradient and extra-rounded modules.
Parameters
| Name | Type | Default | Notes |
|---|---|---|---|
data | string | required | The content to encode. Up to 2,000 characters. |
size | number | 512 | Edge length in pixels, 64–4000. |
margin | number | 4% of size | Quiet zone in pixels. |
ecc | L | M | Q | H | Q | Error correction level. Use H with a logo. |
shape | square | circle | square | Outline of the whole code. |
dotType | square | dots | rounded | extra-rounded | classy | classy-rounded | square | Module shape. |
cornerSquareType | square | dot | extra-rounded | rounded | dots | classy | square | Corner frame shape. |
cornerDotType | square | dot | extra-rounded | rounded | classy | dots | square | Corner dot shape. |
foregroundStyle | solid | linear | radial | solid | Whether the foreground uses a gradient. |
foreground | colour | #0f172a | Used when foregroundStyle is solid. |
gradientColorA | colour | #15803d | Gradient start colour. |
gradientColorB | colour | #0369a1 | Gradient end colour. |
gradientAngle | number | 45 | Degrees, linear gradients only. |
background | colour | #ffffff | Background colour. |
transparent | boolean | false | Renders without a background fill. |
backgroundRound | number | 0 | Background corner radius, 0–1. |
cornerSquareColor | colour | inherits | Overrides the corner frame colour. |
cornerDotColor | colour | inherits | Overrides the corner dot colour. |
logo | data URL | none | Centre image, as a data: URL. POST only in practice. |
logoSize | number | 0.4 | Fraction of the code covered, 0.1–0.6. |
logoMargin | number | 8 | Clear space around the logo, in pixels. |
hideBackgroundDots | boolean | true | Clears modules beneath the logo. |
Errors
A 400 response carries a JSON body such as {"error":"The `data` parameter is required."}. Unknown values for enum parameters are not rejected — they fall back to the default, so a typo yields a plain code rather than a failed request.
Raster output
The endpoint returns SVG only, which is the right format for print and scales freely. Convert to PNG at the edge with any SVG rasteriser, or use the download buttons in the web generator, which produce PNG, JPG, WEBP and PDF in the browser.