1QR API Open the generator →

1QR Developer API

Generate QR codes from a single REST call — returns a crisp, scalable SVG. Free tier: 100 requests / month.

1 · Get an API key

  1. Open the generator and click Sign in (Google or Apple).
  2. Open your account and hit + New key — it's copied to your clipboard.
  3. Keep it secret; it identifies and meters your account. You can revoke it any time.

2 · Base URL & auth

https://1qr.codes/api

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

3 · Generate a QR code

GET/api/v1/qr

Returns an image/svg+xml QR code. Add format=json to get the SVG wrapped in a JSON envelope with usage info instead.

Parameters

NameDefaultDescription
key requiredYour API key (or send the X-Api-Key header).
data requiredThe text/URL/payload to encode. URL-encode it.
size512Pixel width/height of the square SVG (64–2000).
eccMError correction: L, M, Q, or H (higher = more robust).
color#000000Foreground colour (hex or CSS name).
bg#ffffffBackground colour, or transparent.
margin4Quiet-zone width in modules (0–16).
formatsvgsvg returns the image; json returns { svg, used, remaining, … }.

Styling (optional)

Everything you can style in the app is available on the API:

NameDefaultDescription
dotsquareBody module shape: square, dots, rounded, classy, classy-rounded, extra-rounded.
eyeframesquareCorner-eye frame: square, rounded, dot.
eyeballsquareCorner-eye centre: square, rounded, dot.
eyecolor · eyeballcolorbody colourSeparate colours for the eye frame and centre.
gradForeground gradient: linear or radial. Pair with grad1, grad2 (colours) and gradrot (degrees).
bggradBackground gradient (linear/radial) with bg1, bg2, bggradrot.
logoAn 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.

Embed it directly

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

curl "https://1qr.codes/api/v1/qr?data=hello%20world&size=600&ecc=H" \
  -H "X-Api-Key: YOUR_KEY" -o qr.svg

JavaScript (fetch)

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
QR
Live preview

Once you have a key, this becomes a one-line embed — no SDK, no library.

4 · Rate limits

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

5 · Errors

StatusMeaning
401Missing or invalid API key.
402Monthly free-tier limit reached.
422Payload too large to encode as a QR code.

Errors are JSON: { "error": "…" }.

6 · Other endpoints

GET/api/stats

Public counter of every code generated with 1QR: { "total": 12345 }.