YepAPI
Dev Utilities

QR Codes

Generate customizable QR codes as PNG or SVG.

POST/v1/tools/qr
$0.01/call

Usage

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 code
curl -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

ParameterTypeRequiredDescriptionDefault
datastringYesContent to encode in the QR code
sizenumberNoSize in pixels300
formatstringNopng or svg"png"
colorstringNoForeground color (hex)"#000000"
backgroundstringNoBackground 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

FieldTypeDescription
okbooleanWhether the request succeeded
dataobjectResponse payload
data.urlstringCDN URL to the generated QR code image
data.formatstringImage format of the QR code (png or svg)
data.sizenumberSize of the generated QR code in pixels
data.expiresAtstringISO 8601 timestamp when the CDN-hosted image expires

On this page