Generate QR codes from a single REST call — returns a crisp, scalable SVG. Free tier: 100 requests / month.
Authenticate with your key on every request, either as a query param or a header:
# query parameter
?key=1qr_live_xxxxxxxxxxxxxxxx
# or request header
X-Api-Key: 1qr_live_xxxxxxxxxxxxxxxx
Returns an image/svg+xml QR code. Add format=json to get the SVG wrapped in a JSON envelope with usage info instead.
| Name | Default | Description |
|---|---|---|
key required | — | Your API key (or send the X-Api-Key header). |
data required | — | The text/URL/payload to encode. URL-encode it. |
size | 512 | Pixel width/height of the square SVG (64–2000). |
ecc | M | Error correction: L, M, Q, or H (higher = more robust). |
color | #000000 | Foreground colour (hex or CSS name). |
bg | #ffffff | Background colour, or transparent. |
margin | 4 | Quiet-zone width in modules (0–16). |
format | svg | svg returns the image; json returns { svg, used, remaining, … }. |
Everything you can style in the app is available on the API:
| Name | Default | Description |
|---|---|---|
dot | square | Body module shape: square, dots, rounded, classy, classy-rounded, extra-rounded. |
eyeframe | square | Corner-eye frame: square, rounded, dot. |
eyeball | square | Corner-eye centre: square, rounded, dot. |
eyecolor · eyeballcolor | body colour | Separate colours for the eye frame and centre. |
grad | — | Foreground gradient: linear or radial. Pair with grad1, grad2 (colours) and gradrot (degrees). |
bggrad | — | Background gradient (linear/radial) with bg1, bg2, bggradrot. |
logo | — | An https image URL (or data URI) to drop in the centre. Tune with logosize (0.1–0.5) and logomargin (modules). Use ecc=H with a logo so it still scans. |
A fully-styled QR in one line — gradient body, rounded eyes, dot centres:
<img src="https://1qr.codes/api/v1/qr?key=YOUR_KEY&data=https://example.com
&dot=rounded&eyeframe=rounded&eyeball=dot
&grad=linear&grad1=%236c5ce7&grad2=%2300cec9&gradrot=45">
curl "https://1qr.codes/api/v1/qr?data=hello%20world&size=600&ecc=H" \
-H "X-Api-Key: YOUR_KEY" -o qr.svg
const r = await fetch("https://1qr.codes/api/v1/qr?format=json&data=" +
encodeURIComponent("https://example.com"), { headers: { "X-Api-Key": "YOUR_KEY" } });
const { svg, remaining } = await r.json();
document.querySelector("#out").innerHTML = svg; // ready-to-render SVG
Once you have a key, this becomes a one-line embed — no SDK, no library.
The free tier allows 100 generations per calendar month per account. Every response includes an X-QR-Remaining header. When you run out, the API returns 402 until the month resets (paid tiers are coming).
| Status | Meaning |
|---|---|
401 | Missing or invalid API key. |
402 | Monthly free-tier limit reached. |
422 | Payload too large to encode as a QR code. |
Errors are JSON: { "error": "…" }.
Public counter of every code generated with 1QR: { "total": 12345 }.