Endpoint
Authentication
| Header | Required | Value |
|---|---|---|
X-API-Key | Yes | Your API key (bun_...) |
Content-Type | Yes | application/json |
Overview
Generate QR codes from any text or URL in PNG or SVG format. Control the output size, error correction level, and foreground/background colors. PNG responses include a base64-encoded image ready to embed directly in your application; SVG responses include the raw SVG string.Use cases
- Display QR codes during mobile app onboarding to link devices
- Generate payment links or promo URLs for print and digital campaigns
- Embed product catalog entries with scannable links
- Issue event tickets with encoded check-in data
Request body
| Field | Type | Required | Description |
|---|---|---|---|
data | string | Yes | The text or URL to encode (max 4296 characters) |
format | string | No | Output format: "png" or "svg". Default: "png" |
size | integer | No | Image width in pixels for PNG output (100–1000). Default: 300 |
error_correction | string | No | Error correction level: "L", "M", "Q", or "H". Default: "M" |
dark | string | No | Hex color for dark modules. Default: "#000000" |
light | string | No | Hex color for light modules. Default: "#ffffff" |
Example
Response
200 OK — PNG format
| Field | Type | Description |
|---|---|---|
format | string | "png" |
data | string | Original input data (echoed) |
qr_base64 | string | Base64-encoded PNG image |
mime_type | string | "image/png" |
size | integer | Actual image width in pixels |
error_correction | string | Error correction level used |
200 OK — SVG format
| Field | Type | Description |
|---|---|---|
format | string | "svg" |
data | string | Original input data (echoed) |
qr | string | Raw SVG string |
error_correction | string | Error correction level used |

