QR Code API

Every QR code style on FreeQRGen has an image URL. Change the destination parameter and you get a new code in the same style — no API key, no signup, no SDK.

Design your style
Example QR code generated by the API

Quick start

  1. Open the builder and design your QR code style.
  2. Copy the URL template or a code snippet for your language.
  3. Replace destination with each link you want to encode. The URL returns the image directly.
https://freeqrgen.app/api/qr?destination=https%3A%2F%2Fexample.com&dot=rounded&dc=1d1d1f&cst=extra-rounded&csc=1d1d1f&cdt=dot&cdc=1d1d1f&bg=ffffff&cr=0.08&sz=600&format=png

Reference

GET https://freeqrgen.app/api/qr

All parameters are query-string values. Anything invalid falls back to its default.

ParameterValuesDefaultDescription
destinationAny text, up to 2000 charactersrequiredWhat the QR code contains — usually a URL. URL-encode it.
formatpng, svgpngImage type. Use PNG for email; SVG for web and print.
sz64–2048300Width and height in pixels.
dotrounded, square, dots, classy, classy-rounded, extra-roundedroundedShape of the data dots.
dcHex color without #000000Dot color.
cstsquare, dot, extra-roundedsquareShape of the three large corner squares.
cscHex color000000Corner square color.
cdtdot, squaredotShape of the dot inside each corner square.
cdcHex color000000Corner dot color.
bgHex colorffffffBackground color.
tp1offTransparent background (overrides bg).
cr0–0.50.08Outer corner rounding, as a fraction of the size.
dgt, dgs, dge, dgrlinear | radial, hex, hex, 0–360offDot gradient: type, start color, end color, rotation in degrees.
bgt, bgs, bge, bgrlinear | radial, hex, hex, 0–360offBackground gradient, same format as the dot gradient.

Examples

HTML

<img
  src="https://freeqrgen.app/api/qr?destination=https%3A%2F%2Fexample.com&amp;dot=rounded&amp;dc=1d1d1f&amp;cst=extra-rounded&amp;csc=1d1d1f&amp;cdt=dot&amp;cdc=1d1d1f&amp;bg=ffffff&amp;cr=0.08&amp;sz=600&amp;format=png"
  width="600" height="600"
  alt="QR code"
/>

JavaScript

const params = new URLSearchParams({
  destination: "https://example.com",
  dot: "rounded",
  dc: "1d1d1f",
  cst: "extra-rounded",
  csc: "1d1d1f",
  cdt: "dot",
  cdc: "1d1d1f",
  bg: "ffffff",
  cr: "0.08",
  sz: "600",
  format: "png",
});
const qrUrl = `https://freeqrgen.app/api/qr?${params}`;

// Use it as an image source…
document.querySelector("img").src = qrUrl;

// …or download it
const image = await fetch(qrUrl).then((res) => res.blob());

Python

import requests

res = requests.get(
    "https://freeqrgen.app/api/qr",
    params={
        "destination": "https://example.com",
    "dot": "rounded",
    "dc": "1d1d1f",
    "cst": "extra-rounded",
    "csc": "1d1d1f",
    "cdt": "dot",
    "cdc": "1d1d1f",
    "bg": "ffffff",
    "cr": "0.08",
    "sz": "600",
    "format": "png",
    },
)
res.raise_for_status()

with open("qr-code.png", "wb") as f:
    f.write(res.content)

cURL

curl -G "https://freeqrgen.app/api/qr" \
  --data-urlencode "destination=https://example.com" \
  -d dot=rounded \
  -d dc=1d1d1f \
  -d cst=extra-rounded \
  -d csc=1d1d1f \
  -d cdt=dot \
  -d cdc=1d1d1f \
  -d bg=ffffff \
  -d cr=0.08 \
  -d sz=600 \
  -d format=png \
  -o qr-code.png

Other QR types

destination can be any QR payload, URL-encoded: mailto:hi@example.com, tel:+15551234567, or WIFI:T:WPA;S:Network;P:password;;.

How it behaves

Cached forever

The same URL always returns the same image, so responses are cached by the CDN for a year. Thousands of loads of one image are served instantly.

Rate limits

Up to 600 new images per minute per IP address. Over the limit you get a 429 with a Retry-After header and a neutral placeholder image, so embeds don't break.

Responses

200 with image/png or image/svg+xml. 400 with a plain-text message if destination is missing, too long, or format is invalid. CORS is open, so you can fetch from the browser.

Privacy

Content is used only to draw the image and isn't stored. Logos aren't supported. See the privacy policy for details.