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/generateAuthentication:
X-Api-Key: nq_live_your_api_keyRequired permission in Dashboard > API Keys:
Generate QR Code(qr:generate)
Request Body
| Field | Type | Default | Description |
|---|---|---|---|
data | string | required | Content to encode (max 4096 chars) |
width | int | 300 | Width in pixels (50–2000) |
height | int | 300 | Height in pixels (50–2000) |
margin | int | 0 | Margin around QR code |
errorCorrectionLevel | string | "M" | Error correction: L, M, Q, H |
includeSvgRoot | bool | true | Include the <svg> root element |
transparentBackground | bool | false | Transparent background |
bodyStyle | string | "square" | Module style from options |
bodyShape | string | — | Shape: Circle, Heart, Diamond, Hexagon, Star, RoundedSquare |
bodyBrush | Brush | — | Body color/gradient |
outerEyeStyle | string | "square" | Outer eye pattern |
outerEyeBrush | Brush | — | Outer eye color |
innerEyeStyle | string | "square" | Inner eye pattern |
innerEyeBrush | Brush | — | Inner eye color |
backgroundBrush | Brush | — | Background color |
transparentBackground | bool | false | Transparent background |
logo | Logo | — | Center logo |
template | string | — | Template 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
| Field | Type | Default | Description |
|---|---|---|---|
source | string | required | Logo SVG content or data URI |
width | int | auto | Logo width |
height | int | auto | Logo height |
padding | int | 0 | Padding around logo |
removeBackgroundBehind | bool | false | Clear modules behind logo |
cornerRadius | int | 0 | Round 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 Foundwith an empty body. - If
templateAccessLevelispremium, the account must have the required plan access for that QR option.