NiceQR.me Docs

QR Generation

Generate custom QR codes with the public endpoint that uses API Keys.

Endpoint

This is currently the only public API endpoint documented for external API-key clients.

POST /v1/qr/generate

Authentication:

X-Api-Key: nq_live_your_api_key

Required permission in Dashboard > API Keys:

  • Generate QR Code (qr:generate)

Request Body

FieldTypeDefaultDescription
datastringrequiredContent to encode (max 4096 chars)
widthint300Width in pixels (50–2000)
heightint300Height in pixels (50–2000)
marginint0Margin around QR code
errorCorrectionLevelstring"M"Error correction: L, M, Q, H
includeSvgRootbooltrueInclude the <svg> root element
transparentBackgroundboolfalseTransparent background
bodyStylestring"square"Module style from options
bodyShapestringShape: Circle, Heart, Diamond, Hexagon, Star, RoundedSquare
bodyBrushBrushBody color/gradient
outerEyeStylestring"square"Outer eye pattern
outerEyeBrushBrushOuter eye color
innerEyeStylestring"square"Inner eye pattern
innerEyeBrushBrushInner eye color
backgroundBrushBrushBackground color
transparentBackgroundboolfalseTransparent background
logoLogoCenter logo
templatestringTemplate name

Brush Object

The backend expects PascalCase values for type.

Solid color:

{ "type": "Solid", "color": "#000000" }

Linear gradient:

{
  "type": "LinearGradient",
  "startColor": "#06b6d4",
  "endColor": "#a855f7",
  "rotation": 45.0
}

Radial gradient:

{
  "type": "RadialGradient",
  "centerColor": "#06b6d4",
  "edgeColor": "#0e7490"
}

Logo Object

FieldTypeDefaultDescription
sourcestringrequiredLogo SVG content or data URI
widthintautoLogo width
heightintautoLogo height
paddingint0Padding around logo
removeBackgroundBehindboolfalseClear modules behind logo
cornerRadiusint0Round corners of logo area

Example

curl -X POST https://api.niceqr.me/v1/qr/generate \
  -H "X-Api-Key: nq_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "data": "https://niceqr.me",
    "width": 400,
    "height": 400,
    "errorCorrectionLevel": "H",
    "bodyStyle": "rounded",
    "bodyShape": "Circle",
    "bodyBrush": {
      "type": "LinearGradient",
      "startColor": "#06b6d4",
      "endColor": "#a855f7",
      "rotation": 135
    },
    "outerEyeStyle": "rounded",
    "outerEyeBrush": { "type": "Solid", "color": "#06b6d4" },
    "backgroundBrush": { "type": "Solid", "color": "#ffffff" }
  }'

Response

{
  "success": true,
  "data": {
    "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" ...>...</svg>"
  }
}

Notes

  • The endpoint returns SVG inside the standard response envelope.
  • Missing, invalid, revoked, expired, or suspended API keys intentionally return 404 Not Found with an empty body.
  • If templateAccessLevel is premium, the account must have the required plan access for that QR option.

On this page