QRCGen API Documentation

Public API for generating ultra-lightweight SVG QR codes. Hosted on Cloudflare Workers with global edge caching.

Base URL: https://qr.qrcgen.com

Quick Start

https://qr.qrcgen.com/qr.svg?data=https://example.com

This returns a 302 redirect to a canonical, edge-cached SVG URL. The same input always produces the same URL — perfect for sharing and embedding.

Endpoints

GET /qr.svg — Share Link (redirect)

Best for sharing. Returns a 302 redirect to an immutable, edge-cached canonical URL.

ParamRequiredDefaultDescription
datayesURL or text to encode (max 4,096 chars)
pnosq250Size preset: sq125, sq200, sq250, sq300
eccnoMError correction: L, M, Q, H
qno4Quiet zone in modules (0–16)

Example:

https://qr.qrcgen.com/qr.svg?data=https://example.com&p=sq300&ecc=H
  → 302 → /qr/sq300/a1b2c3...f0.svg

The canonical URL is deterministic: same parameters always produce the same hash. Once cached, responses are served instantly from the nearest Cloudflare edge location.

GET /qr.inline — Direct SVG (for embedding)

Returns SVG directly as a 200 response. No redirect. Ideal for <img> tags, Markdown, or anywhere you need the image immediately.

Same parameters as /qr.svg.

Example:

<img src="https://qr.qrcgen.com/qr.inline?data=https://example.com" alt="QR code" />

Edge-cached by full URL (24h TTL). X-QR-Cache: HIT|MISS header for diagnostics.

GET /qr/<preset>/<hash>.svg — Canonical URL

This is where share links resolve to. You don’t call this directly — use /qr.svg to get the redirect.

Response headers:

Content-Type: image/svg+xml; charset=utf-8
Cache-Control: public, max-age=31536000, immutable
ETag: "<hash>"
X-QR-Cache: HIT|MISS

Size Presets

PresetDimensionsUse case
sq125125 × 125 pxInline icons, small badges
sq200200 × 200 pxCards, compact layouts
sq250250 × 250 pxDefault — good for most uses
sq300300 × 300 pxPrint, hero sections

All presets produce square SVGs. The SVG viewBox uses module units; width and height are in pixels from the preset.

Error Correction Levels

LevelRecoveryBest for
L~7%Clean digital display, maximum data density
M~15%Default — balanced for screen and print
Q~25%Printed materials that may get worn
H~30%Harsh environments, small print sizes

Higher ECC means more redundancy, which makes the QR code denser (more modules) but more resilient to damage.

SVG Output

Every QR code is a single-line, optimized SVG:

Embed Snippets

HTML

<img src="https://qr.qrcgen.com/qr.inline?data=YOUR_URL" alt="QR code" />

HTML (object)

<object data="https://qr.qrcgen.com/qr.inline?data=YOUR_URL"
        type="image/svg+xml" aria-label="QR code"></object>

Markdown

![QR](https://qr.qrcgen.com/qr.inline?data=YOUR_URL)

React

export function QR() {
  return <img src="https://qr.qrcgen.com/qr.inline?data=YOUR_URL"
              alt="QR code" loading="lazy" />;
}

Vue

<template>
  <img :src="src" alt="QR code" loading="lazy" />
</template>
<script setup>
const src = "https://qr.qrcgen.com/qr.inline?data=YOUR_URL";
</script>

Caching

The QRCGen extension warms the cache automatically when you generate a QR code, so share links load instantly for recipients.

Rate Limits

No authentication required. No API keys. Generous limits for normal use.

Privacy