Qr API
GET /api/qr $0.002 per call
USDC on Base · x402
QR code generator: GET ?data=<text|url> and receive a scannable QR as SVG plus PNG (base64) and a data: URI. Options: size (px, default 512), margin (quiet-zone modules, default 2), ecc (L|M|Q|H, default M), dark/light hex colors. Deterministic, no network, no tracking — encode URLs, wifi, vCards, or payment URIs up to 2,000 chars.
Parameters
| Name | In | Description | |
|---|---|---|---|
data | query | required | Text or URL to encode (required, up to 2,000 chars) |
size | query | PNG width in px (64–2048, default 512) | |
margin | query | Quiet-zone width in modules (0–20, default 2) | |
ecc | query | Error correction: L, M (default), Q, or H — higher survives more damage but holds less data | |
dark | query | Hex color of the modules (default #000000) | |
light | query | Hex background color (default #ffffff) |
Example request
curl "https://api.webbersites.com/api/qr?data=https%3A%2F%2Fx402.webbersites.com"
# first call returns 402 + payment requirements; an x402 client pays and retries automaticallyExample response
{
"data": "https://x402.webbersites.com",
"version": 3,
"ecc": "M",
"width": 512,
"svg": "<svg …>",
"png_base64": "iVBORw0…",
"data_uri": "data:image/png;base64,…"
}MCP tool: get_qr — via npx -y webbersites-x402-mcp (local, key stays on your machine) or the remote endpoint https://api.webbersites.com/mcp.
How payment works
There is no signup and no API key. Call the endpoint; it replies 402 Payment Required with machine-readable payment requirements. Your client signs a USDC transfer authorization (EIP-3009, gasless) and retries with the X-PAYMENT header — @x402/fetch does this automatically. See the overview for a working snippet.