QR Code Generation API

Generate static QR codes via API for integration into your applications.

Generation API

Generate static QR codes via API: send a string and an optional design object — get an SVG in milliseconds.

Design & Branding

Apply brand colors, module shapes, frames and logos — all through the design object.

Endpoints

/v1/generate

Body: required `data`, optional `design`. HTTP 200 returns SVG in `data.qr_code`.

POST https://api.webqr.io/v1/generate

POST with JSON body: required string field data and optional design object (same shape as in the cabinet builder). Response is HTTP 200 with SVG in data.qr_code. WebQR does not store your payloads — keep files, databases, and ids on your side.

/v1/usage

Read-only: period counters; `data.items` is empty. Does not use generation quota.

GET https://api.webqr.io/v1/usage

GET /v1/usage returns billing-period counters; data.items is always empty. Does not increment used_count.

The API is stateless: there is no server-side library of your QR codes. Store SVG output and any labels in your own application.

Production security

Treat the API key like a password for your WebQR account quota.

  • Keep the secret on the server; clients talk to your HTTPS, not to WebQR with the key.
  • Restrict each key to your server IPs (or fixed CDN egress).
  • Optionally require HMAC signing per key in the cabinet.

Authenticate every request with the X-API-Key header. Keys are created in the cabinet.

Request examples (JSON body)

Plain modules on a solid background

JSON body

{
    "data": "https://webqr.io/",
    "design": {
        "size": 1024,
        "backgroundColor": "#FFFFFF",
        "color": "#000000",
        "transparent": false,
        "styleType": "a7k2m9",
        "eyeType": "r2s4t6",
        "eyeInnerType": "h7i9j1",
        "roundedCorners": true,
        "cornerRadius": 20,
        "showColorGradient": false
    }
}

Response

HTTP 200 returns JSON with success, the SVG string in data.qr_code, your content echo, a normalized design snapshot, and a usage object with quota explanations.

Colored canvas with shaped modules

JSON body

{
    "data": "https://webqr.io/",
    "design": {
        "size": 1024,
        "backgroundColor": "#0E2A47",
        "color": "#F8FAFC",
        "borderColor": "#58B4FF",
        "centerColor": "#58B4FF",
        "transparent": false,
        "styleType": "m4k6l8",
        "eyeType": "x4y6z8",
        "eyeInnerType": "n9o1p3",
        "roundedCorners": true,
        "cornerRadius": 20,
        "showColorGradient": false
    }
}

Diagonal gradient on modules

JSON body

{
    "data": "https://webqr.io/",
    "design": {
        "size": 1024,
        "backgroundColor": "#FFFFFF",
        "color": "#1e3a5f",
        "borderColor": "#2563EB",
        "centerColor": "#7C3AED",
        "transparent": false,
        "styleType": "a7k2m9",
        "eyeType": "r2s4t6",
        "eyeInnerType": "h7i9j1",
        "roundedCorners": true,
        "cornerRadius": 20,
        "showColorGradient": true,
        "fromColor": "#2563EB",
        "toColor": "#7C3AED",
        "styleColorGradient": "diagonal"
    }
}

Example request

curl -X POST https://api.webqr.io/v1/generate \
  -H "Content-Type: application/json" \\n  -H "X-API-Key: wq_xxxxxxxxxx_your_secret" \\n  -d @payload.json

Mirror any example JSON into payload.json or inline the -d body, but execute curl only from trusted infrastructure — browsers and mobile binaries must never see the raw secret.

Design

WebQR ships with a full visual QR builder in your account. Tune colors, module shapes, frames and logos in the UI—the same knobs map straight to the JSON you POST—so assembling the final generate request stays predictable.

Send Content-Type: application/json. The root object has data (required) and design (optional). Keys such as markerOutColor normalize to borderColor; invalid payloads return HTTP 422.

The thumbnails here match the Design step in the builder: copy the label under a tile into design.styleType, design.eyeType or design.eyeInnerType.

Icons are the same as in the design flow. Each tile shows the canonical code for the matching API field.

Module codes (design.styleType)

a7k2m9
b3n5p1
c8q4r6
d1s7t9
e6u2v4
f9w5x7
g2y8z0
h4a6b8
i0c2d4
j6e8f0
k2g4h6
l8i0j2
m4k6l8
n0o2p4
p6q8r0
q1r3s5
s1r3s5

Outer eye shapes (design.eyeType)

r2s4t6
u8v0w2
x4y6z8
a1b3c5
d7e9f1
g3h5i7
j9k1l3
m5n7o9
p1q3r5
s7t9u1
v3w5x7
y9z1a3
b5c7d9
e1f3g5

Inner eye shapes (design.eyeInnerType)

h7i9j1
k3l5m7
n9o1p3
q5r7s9
t1u3v5
w7x9y1
z3a5b7
c9d1e3
f5g7h9
i1j3k5
l7m9n1
o3p5q7
r9s1t3
u5v7w9
x1y3z5

Frames (design.frameType)

no_frames = QR only. thick_rounded = thick rounded border with no caption. Other frames may use a caption strip; optional textUnderQr overrides it; otherwise the server applies default wording.

no_frames label_bottom badge_bottom pill_bottom banner_top shopping_bag bar_bottom bar_top badge_top pill_top wide_bottom wide_top thick_rounded

Legacy frame codes still accepted (remapped as follows):

ribbon_bottom → no_frames flag_top → no_frames text_bottom → thick_rounded text_top → thick_rounded

Gradient directions

Use these strings for styleColorGradient or eyeGradientStyle.

horizontal vertical diagonal inverse_diagonal radial

Frequently asked questions

How many API requests do I get per month?

Included successful generations per calendar month by plan: 200 (Starter), 5000 (Premium), 25000 (Business), 100000 (Business Plus). If you need more, please contact us.

Can I use the API and the main page generator?

Yes! You can generate QR codes with the API as well as manually in the main page generator.

Can I use the API on the free plan?

Yes. Starter includes Static QR API access with 200 included successful generations per calendar month; Premium 5000; Business 25000; Business Plus 100000 (allowances reset monthly). No separate API-only subscription; optional paid overage may apply.

What comes back after a successful request? Does WebQR archive every QR for you?

The API returns JSON with the SVG in data.qr_code, the same content and design you sent (for traceability), and a usage object for quota bookkeeping. This flow is stateless: WebQR does not auto-save every call into your QR library or return a persisted id—you keep the SVG and any ids where you integrate. Anything you intentionally save via the WebQR generator or dashboard stays there under normal cabinet rules.

Need more requests?

Please contact us if you need more requests per day for individual or commercial use.