Skip to content

QR Branding API

The most customizable QR code API available. Generate stunning, branded, ISO 18004-compliant QR codes with 37 module shapes, 118 templates, AI-powered design, and 5 output formats.

Subscribe on RapidAPI: rapidapi.com/quartzondev/api/qr-branding. Plans and quotas are listed on the RapidAPI page.


Quick Start

1. Generate a Custom QR Code

curl -X POST "https://qr-branding.p.rapidapi.com/api/qr/generate" \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: qr-branding.p.rapidapi.com" \
  -d '{
    "content": "https://example.com",
    "primaryColor": "#1a1a2e",
    "backgroundColor": "#FFFFFF",
    "moduleShape": "circle",
    "fileFormat": "png",
    "outputWidth": 512,
    "eccLevel": "H"
  }'

Response:

{
  "success": true,
  "qrBase64": "iVBORw0KGgoAAAANSUhEUg...",
  "format": "png",
  "contentType": "image/png",
  "sizeBytes": 15234
}

2. Generate from a Template

curl -X POST "https://qr-branding.p.rapidapi.com/api/qr/templates/cyber-neon" \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: qr-branding.p.rapidapi.com" \
  -d '{
    "content": "https://mywebsite.com",
    "outputWidth": 600
  }'

3. AI-Powered QR Code

curl -X POST "https://qr-branding.p.rapidapi.com/api/qr/ai/generate" \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: qr-branding.p.rapidapi.com" \
  -d '{
    "prompt": "A luxurious gold and black QR code with rounded modules and a subtle glow effect, suitable for a premium brand",
    "content": "https://premium-brand.com",
    "llmProvider": "openai",
    "llmApiKey": "sk-your-openai-key",
    "creativity": 0.7,
    "strictScannability": true,
    "stylePreset": "luxury"
  }'

Response:

{
  "success": true,
  "qrBase64": "iVBORw0KGgoAAAANSUhEUg...",
  "format": "png",
  "contentType": "image/png",
  "sizeBytes": 28456,
  "generatedConfig": { },
  "aiExplanation": "I designed a premium QR code with...",
  "llmProviderUsed": "openai",
  "llmModelUsed": "gpt-6-luna"
}

Code Examples

Python

import requests

url = "https://qr-branding.p.rapidapi.com/api/qr/generate"
headers = {
    "Content-Type": "application/json",
    "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
    "X-RapidAPI-Host": "qr-branding.p.rapidapi.com"
}
payload = {
    "content": "https://example.com",
    "primaryColor": "#FF6B35",
    "moduleShape": "star",
    "eccLevel": "H",
    "outputWidth": 800,
    "fileFormat": "png"
}

response = requests.post(url, json=payload, headers=headers)
data = response.json()

if data["success"]:
    import base64
    img_bytes = base64.b64decode(data["qrBase64"])
    with open("my_qr.png", "wb") as f:
        f.write(img_bytes)
    print(f"QR saved! Size: {data['sizeBytes']} bytes")

JavaScript (Node.js)

const response = await fetch(
  "https://qr-branding.p.rapidapi.com/api/qr/generate",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
      "X-RapidAPI-Host": "qr-branding.p.rapidapi.com",
    },
    body: JSON.stringify({
      content: "https://example.com",
      primaryColor: "#0066FF",
      moduleShape: "hexagon",
      eccLevel: "H",
      outputWidth: 600,
      fileFormat: "png",
    }),
  }
);

const data = await response.json();

if (data.success) {
  const buffer = Buffer.from(data.qrBase64, "base64");
  require("fs").writeFileSync("qr_code.png", buffer);
  console.log(`QR generated: ${data.sizeBytes} bytes`);
}

Features Overview

CategoryDetails
Module Shapes37: square, circle, diamond, star, heart, hexagon, leaf, cross, dot, mosaic, clipped, edgecut, pointed, pill, rounded, japanese, octagon, shield, arrow, drop + custom SVG
Templates118 pre-designed across 28 categories
AI Providers9 LLM providers plus any OpenAI-compatible endpoint (bring your own key), or Managed AI with no key
Output FormatsPNG, JPEG, SVG, PDF, WebP
Max Resolution4,096 × 4,096 pixels
GradientsLinear, radial, sweep with unlimited color stops
Visual EffectsShadow, glow/neon, emboss/3D, noise, blur, edge fade, color filters
Logo SupportURL or Base64, circle/square/rounded shapes, shadow, custom sizing
Text OverlaysCircular text, center stripe, CTA banners
FramesRectangle, speech bubble, badge, shield, circle
Error CorrectionL (7%), M (15%), Q (25%), H (30%) — ISO 18004
Content HelpersWiFi, vCard, Geolocation string generators
Background ImagesURL/Base64, blend modes, fit modes, blur
Connected ModulesFluid, sharp, round connections for artistic designs

Template Categories (28)

Technology, Corporate, Social, Luxury, Nature, Artistic, Marketing, Events, Music, Fun, Background, Culture, Industry, Restaurant, Retail, Education, Travel, Automotive, Healthcare, Social Media, Art & Design, Business, Food & Drink, Finance, Health, Legal, Non-Profit, Real Estate.

Use GET /api/qr/templates?category=luxury to filter by category.


AI Providers & Models

ProviderModels
OpenAIgpt-6-astra, gpt-6.1-sol, gpt-6-luna, gpt-6-sol, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-4.1-mini
Anthropicclaude-fable-5-1, claude-opus-5-5, claude-sonnet-5-5, claude-haiku-4-5
Googlegemini-3.1-pro-preview, gemini-3.8-flash, gemini-3.5-flash-lite, gemini-3.5-flash
Mistralmistral-large-latest, mistral-medium-latest, mistral-small-latest
Coherecommand-a-plus-05-2026, command-a-03-2025, command-a-reasoning-08-2025, command-r7b-12-2024
Groqopenai/gpt-oss-120b, openai/gpt-oss-20b, llama-3.3-70b-versatile
xAIgrok-4.7, grok-4.3, grok-4.20-0309-non-reasoning
DeepSeekdeepseek-v4-pro, deepseek-flash
Qwenqwen3.8-max, qwen3.7-plus, qwen3.8-flash
LocalAny OpenAI-compatible endpoint (Ollama, LM Studio, vLLM); set llmProvider: "local" and pass localEndpoint

Any model ID your provider offers works; this list shows recommended ones.

Note: on /api/qr/ai/generate you provide your own API key for the chosen LLM provider and the provider bills you directly; QR Branding adds no markup. On /api/qr/ai/generate-managed no LLM key is needed: we run the models, and those calls count towards the separate Managed AI quota of your plan.


Endpoints

POST /api/qr/generate — Generate Custom QR

Generate a fully customizable QR code with 100+ parameters including module shapes, gradients, effects, logos, text overlays, frames, and more. Supports JSON body or multipart/form-data for logo file upload.

Request Body:

{
  "content": "https://example.com",
  "eccLevel": "H",
  "pixelsPerModule": 20,
  "outputWidth": 512,
  "fileFormat": "png",
  "quality": 90,
  "responseType": "base64",
  "backgroundColor": "#FFFFFF",
  "transparentBackground": false,
  "primaryColor": "#000000",
  "secondaryColor": null,
  "foregroundStyle": "solid",
  "gradientType": "linear",
  "gradientDirection": "vertical",
  "gradientColors": ["#FF0000", "#0000FF"],
  "gradientStops": [0.0, 1.0],
  "gradientAngle": 0,
  "qrShape": "square",
  "moduleShape": "square",
  "moduleScale": 0.85,
  "moduleRotation": 0,
  "moduleStyle": "solid",
  "modulePattern": "standard",
  "connectedStyle": "none",
  "finderOuterShape": "square",
  "finderInnerShape": "square",
  "finderOuterColor": "#000000",
  "finderInnerColor": "#000000",
  "finderStyle": "standard",
  "logoUrl": "https://example.com/logo.png",
  "logoShape": "circle",
  "logoSizePercent": 18,
  "logoBorderWidth": 2,
  "logoBorderColor": "#FFFFFF",
  "logoShadow": true,
  "logoBackground": "solid",
  "ctaText": "SCAN ME"
}

Response 200:

{
  "success": true,
  "qrBase64": "iVBORw0KGgoAAAANSUhEUg...",
  "format": "png",
  "contentType": "image/png",
  "sizeBytes": 15234
}

Response 400:

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Validation failed with 1 error.",
    "details": [
      {
        "field": "moduleShape",
        "code": "INVALID_MODULE_SHAPE",
        "message": "Invalid module shape 'triangle'. Valid shapes: square, circle, diamond, star, heart, hexagon, leaf, cross, dot, mosaic, clipped, edgecut, pointed, pill, rounded, japanese, octagon, shield, arrow, drop."
      }
    ]
  }
}

POST /api/qr/ai/generate — Generate AI QR

Describe your ideal QR code in natural language and let AI design it for you. Supports 9 LLM providers plus any OpenAI-compatible endpoint (local); any model ID your provider offers is accepted. Here you provide your own LLM API key; if you prefer not to use one, call POST /api/qr/ai/generate-managed (below).

Request Body:

{
  "prompt": "A modern tech-style QR code with hexagonal modules, a blue-to-purple gradient, subtle glow effect, and rounded finder patterns",
  "content": "https://myapp.com",
  "llmProvider": "openai",
  "llmApiKey": "sk-your-api-key-here",
  "llmModel": "gpt-6-luna",
  "creativity": 0.7,
  "strictScannability": true,
  "stylePreset": "tech",
  "fileFormat": "png",
  "outputWidth": 800,
  "logoUrl": "https://example.com/logo.png",
  "ctaText": "Download App"
}

Response 200:

{
  "success": true,
  "qrBase64": "iVBORw0KGgoAAAANSUhEUg...",
  "format": "png",
  "contentType": "image/png",
  "sizeBytes": 28456,
  "generatedConfig": {
    "content": "https://myapp.com",
    "moduleShape": "hexagon",
    "primaryColor": "#4A90D9",
    "gradientColors": ["#4A90D9", "#7B2FF7"],
    "gradientType": "linear",
    "gradientDirection": "vertical",
    "finderOuterShape": "roundedsquare",
    "finderInnerShape": "circle",
    "eccLevel": "H"
  },
  "aiExplanation": "I designed a tech-inspired QR code with hexagonal modules...",
  "llmProviderUsed": "openai",
  "llmModelUsed": "gpt-6-luna"
}

POST /api/qr/ai/generate-managed — Managed AI (no LLM key)

Same request shape as /api/qr/ai/generate, but llmProvider, llmApiKey and llmModel are ignored: no LLM key is needed. The engine uses its own models with a fallback chain (Groq → Gemini → OpenAI). Calls count towards the Managed AI quota of your plan.

{
  "prompt": "A luxurious gold and black QR with rounded modules and a subtle glow effect",
  "content": "https://premium-brand.com",
  "creativity": 0.7,
  "strictScannability": true,
  "stylePreset": "luxury",
  "fileFormat": "png",
  "outputWidth": 800
}

The response has the same shape as /api/qr/ai/generate, plus the field "managed": true.


GET /api/qr/ai/providers — Get AI Providers

List all supported LLM providers and their available models for AI-powered QR generation.

Response 200:

{
  "success": true,
  "count": 10,
  "providers": [
    {
      "id": "openai",
      "name": "OpenAI",
      "defaultModel": "gpt-6-luna",
      "availableModels": ["gpt-6-astra", "gpt-6.1-sol", "gpt-6-luna", "gpt-6-sol", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-4.1-mini"]
    },
    {
      "id": "anthropic",
      "name": "Anthropic",
      "defaultModel": "claude-sonnet-5-5",
      "availableModels": ["claude-fable-5-1", "claude-opus-5-5", "claude-sonnet-5-5", "claude-haiku-4-5"]
    }
  ]
}

GET /api/qr/templates — List Templates

Browse 118 professionally designed QR code templates across 28 categories.

Query Parameters:

ParameterTypeRequiredDescription
categorystringNoFilter by category (e.g., luxury, corporate, social)

Response 200:

{
  "success": true,
  "count": 118,
  "categories": [
    "Technology", "Corporate", "Social", "Luxury", "Nature",
    "Artistic", "Marketing", "Events", "Music", "Fun"
  ],
  "templates": [
    {
      "id": "cyber-neon",
      "name": "Cyber Neon",
      "category": "Technology",
      "description": "Futuristic glowing neon style with diamond modules and vibrant cyan-pink gradient"
    },
    {
      "id": "professional-blue",
      "name": "Professional Blue",
      "category": "Corporate",
      "description": "Clean corporate style with blue gradient, ideal for business"
    }
  ]
}

POST /api/qr/templates/{templateId} — Generate from Template

Generate a QR code using a pre-designed template. The template's visual design is preserved; you can optionally override output settings.

Path Parameters:

ParameterTypeRequiredDescription
templateIdstringYesTemplate ID from the List Templates endpoint (e.g., cyber-neon)

Request Body:

{
  "content": "https://mywebsite.com",
  "fileFormat": "png",
  "responseType": "base64",
  "outputWidth": 600,
  "logoUrl": "https://example.com/logo.png",
  "ctaText": "Visit Us"
}

Response 200:

{
  "success": true,
  "qrBase64": "iVBORw0KGgoAAAANSUhEUg...",
  "format": "png",
  "contentType": "image/png",
  "sizeBytes": 22100
}

POST /api/qr/content/wifi — Generate WiFi String

Generate a WiFi connection string for QR encoding. Users who scan the QR code will be prompted to connect to the network automatically.

Request Body:

{
  "ssid": "MyNetwork",
  "password": "MyP@ssw0rd!",
  "encryption": "WPA",
  "hidden": false
}

Response 200:

{
  "success": true,
  "text": "WIFI:T:WPA;S:MyNetwork;P:MyP@ssw0rd!;H:false;;"
}

POST /api/qr/content/vcard — Generate vCard String

Generate a vCard contact string for QR encoding. When scanned, the QR code will prompt users to save the contact to their phone.

Request Body:

{
  "firstName": "John",
  "lastName": "Doe",
  "phone": "+1-555-123-4567",
  "email": "john.doe@example.com",
  "org": "Acme Corp",
  "url": "https://johndoe.com"
}

Response 200:

{
  "success": true,
  "text": "BEGIN:VCARD\nVERSION:3.0\nN:Doe;John\nFN:John Doe\nTEL:+1-555-123-4567\nEMAIL:john.doe@example.com\nORG:Acme Corp\nURL:https://johndoe.com\nEND:VCARD"
}

POST /api/qr/content/geo — Generate Geolocation String

Generate a geolocation URI for QR encoding. When scanned, the QR code will open the location in the user's default maps app.

Request Body:

{
  "lat": 40.7128,
  "lng": -74.0060
}

Response 200:

{
  "success": true,
  "text": "geo:40.7128,-74.006"
}

Error Handling

All errors follow a consistent format:

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Validation failed with 2 errors.",
    "details": [
      {
        "field": "primaryColor",
        "code": "INVALID_COLOR_FORMAT",
        "message": "Invalid color format. Use hex (#RRGGBB or #RRGGBBAA).",
        "value": "not-a-color"
      }
    ]
  }
}

Error Codes

Validation (400) VALIDATION_ERROR · INVALID_JSON · MISSING_REQUIRED_FIELD · INVALID_FIELD_VALUE · INVALID_COLOR_FORMAT · INVALID_FILE_FORMAT · CONTENT_TOO_LONG · FILE_TOO_LARGE · INVALID_URL · INVALID_ECC_LEVEL · INVALID_MODULE_SHAPE · INVALID_GRADIENT_TYPE · INVALID_RESPONSE_TYPE · VALUE_OUT_OF_RANGE · MULTIPART_CONFIG_MISSING

Authentication (401) UNAUTHORIZED · INVALID_API_KEY · MISSING_API_KEY

Not Found (404) RESOURCE_NOT_FOUND · TEMPLATE_NOT_FOUND

AI/LLM Errors (400/500) INVALID_LLM_PROVIDER · INVALID_LLM_MODEL · LLM_API_KEY_INVALID · AI_GENERATION_FAILED · AI_CONFIG_INVALID · AI_REQUEST_TIMEOUT

Output budget (422) OUTPUT_TOO_COMPLEX — the design would produce an SVG or PDF over 20 MB or a canvas over 5120 px per side. Export as PNG, shorten the content or use simpler module shapes

Capacity (503) SERVER_BUSY · AI_QUOTA_EXCEEDED (managed AI is out of quota on every provider; try again later)

Server Errors (500) INTERNAL_ERROR · QR_GENERATION_FAILED · LOGO_LOAD_FAILED · BACKGROUND_LOAD_FAILED