Dev Utilities
QR Codes
Generate customizable QR codes as PNG or SVG.
POST
$0.01/call/v1/tools/qrUsage
const res = await fetch('https://api.yepapi.com/v1/tools/qr', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ data: 'https://yepapi.com', size: 400 }),
});
const { data } = await res.json();
console.log(data.url); // CDN URL to the generated QR codecurl -X POST https://api.yepapi.com/v1/tools/qr \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"data": "https://yepapi.com", "size": 400}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
data | string | Yes | Content to encode in the QR code | — |
size | number | No | Size in pixels | 300 |
format | string | No | png or svg | "png" |
color | string | No | Foreground color (hex) | "#000000" |
background | string | No | Background color (hex) | "#FFFFFF" |
Response
{
"ok": true,
"data": {
"url": "https://cdn.yepapi.com/qr/abc123.png",
"format": "png",
"size": 400,
"expiresAt": "2025-04-30T00:00:00Z"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data | object | Response payload |
data.url | string | CDN URL to the generated QR code image |
data.format | string | Image format of the QR code (png or svg) |
data.size | number | Size of the generated QR code in pixels |
data.expiresAt | string | ISO 8601 timestamp when the CDN-hosted image expires |