Skip to content

POST /api/qr/generate

Generate a QR code from an explicit configuration. This is the main rendering endpoint — both the builder UI and the AI endpoint funnel into this.

Request

Content-Type: application/json or multipart/form-data (for binary logo / background uploads).

Body shape: a QrConfig object.

Minimal example:

curl -X POST https://api.qr-branding.com/api/qr/generate \
  -H "X-RapidAPI-Proxy-Secret: <secret>" \
  -F 'config={"content":"https://yourbrand.com","logoSizePercent":18,"eccLevel":"H"}' \
  -F "logoFile=@./brand-mark.png"

The config field is a JSON-encoded string. logoFile and backgroundFile are binary parts (PNG / JPG / GIF / BMP / WebP up to 10 MB).

Response (base64 mode — default)

{
  "success": true,
  "qrBase64": "iVBORw0KGgoAAAANSUhEUgAA…",
  "format": "png",
  "contentType": "image/png",
  "sizeBytes": 38291
}

Response (binary mode)

{ "responseType": "binary" }

Returns the raw file bytes with the appropriate Content-Type and Content-Disposition: attachment; filename="qrcode.png".

Validation

The engine runs the full scan guarantee pipeline. Common rejection reasons:

CodeMeaningFix
CONTENT_TOO_LONGEncoded string > 4296 charsShorten / use a URL shortener
LOW_CONTRASTforeground vs background < 4:1Pick a darker fg or lighter bg
LOGO_TOO_LARGElogoSizePercent > 25 with ECC < HRaise to H or shrink the logo
INVALID_HEXColor string not #RGB, #RRGGBB, #RRGGBBAAFix the color
INVALID_LLM_MODELOnly on AI endpointSee AI mode

See also