本文へスキップ

QR Branding API

最もカスタマイズ性の高いQRコードAPI。 37種類のモジュール形状、118個のテンプレート、AIによるデザイン、5つの出力形式で、ISO 18004に準拠した印象的なブランドQRコードを生成できます。

RapidAPIで購読: rapidapi.com/quartzondev/api/qr-branding。プランとクォータはRapidAPIのページに掲載されています。


クイックスタート

1. カスタムQRコードを生成する

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"
  }'

レスポンス:

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

2. テンプレートから生成する

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によるQRコード

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"
  }'

レスポンス:

{
  "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"
}

コード例

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`);
}

機能の概要

カテゴリー詳細
モジュールの形状37種類: square、circle、diamond、star、heart、hexagon、leaf、cross、dot、mosaic、clipped、edgecut、pointed、pill、rounded、japanese、octagon、shield、arrow、drop + カスタムSVG
テンプレート28カテゴリーにわたる118個の既製テンプレート
AIプロバイダー9つのLLMプロバイダーと、OpenAI互換の任意のエンドポイント(自分のキーを使用)、またはキー不要のマネージドAI
出力形式PNG、JPEG、SVG、PDF、WebP
最大解像度4,096 × 4,096ピクセル
グラデーション線形、放射状、スイープ(カラーストップ数は無制限)
ビジュアルエフェクト影、グロー/ネオン、エンボス/3D、ノイズ、ぼかし、エッジフェード、カラーフィルター
ロゴ対応URLまたはBase64、circle/square/roundedの形状、影、サイズの自由な調整
テキストオーバーレイ円形テキスト、中央の帯、CTAバナー
フレーム長方形、吹き出し、バッジ、盾、円
誤り訂正L(7%)、M(15%)、Q(25%)、H(30%)— ISO 18004
コンテンツヘルパーWiFi、vCard、位置情報の文字列生成
背景画像URL/Base64、ブレンドモード、フィットモード、ぼかし
連結モジュールアーティスティックなデザイン向けのfluid、sharp、roundの連結

テンプレートのカテゴリー(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。

カテゴリーで絞り込むには GET /api/qr/templates?category=luxury を使います。


AIプロバイダーとモデル

プロバイダーモデル
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
LocalOpenAI互換の任意のエンドポイント(Ollama、LM Studio、vLLM)。llmProvider: "local" を指定し、localEndpoint を渡します

プロバイダーが提供しているモデル ID はどれでも使えます。この一覧は推奨モデルです。

注: /api/qr/ai/generate では、選択したLLMプロバイダーのAPIキーをご自身で用意し、費用はプロバイダーから直接請求されます。QR Brandingが上乗せすることはありません。/api/qr/ai/generate-managed ではLLMキーは不要です。モデルは当社が実行し、これらの呼び出しはプランとは別枠のマネージドAIクォータに計上されます。


エンドポイント

POST /api/qr/generate — カスタムQRを生成

モジュールの形状、グラデーション、エフェクト、ロゴ、テキストオーバーレイ、フレームなど、100以上のパラメータで自由にカスタマイズできるQRコードを生成します。JSONボディ、またはロゴファイルをアップロードするためのmultipart/form-dataに対応しています。

リクエストボディ:

{
  "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"
}

レスポンス 200:

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

レスポンス 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 — AIでQRを生成

理想のQRコードを自然な言葉で説明すれば、AIがデザインします。9つのLLMプロバイダーとOpenAI互換の任意のエンドポイント(local)に対応し、プロバイダーが提供する任意のモデルIDを指定できます。このエンドポイントではLLMのAPIキーをご自身で用意します。キーを使いたくない場合は POST /api/qr/ai/generate-managed(下記)を使ってください。

リクエストボディ:

{
  "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"
}

レスポンス 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 — マネージドAI(LLMキー不要)

リクエスト形式は /api/qr/ai/generate と同じですが、llmProvider、llmApiKey、llmModel は無視されます。LLMキーは不要です。エンジンは独自のモデルをフォールバックチェーン(Groq → Gemini → OpenAI)で使用します。呼び出しはプランのマネージドAIクォータに計上されます。

{
  "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
}

レスポンスの形式は /api/qr/ai/generate と同じで、さらに "managed": true フィールドが含まれます。


GET /api/qr/ai/providers — AIプロバイダーを取得

AIによるQR生成に対応しているすべてのLLMプロバイダーと、利用可能なモデルを一覧表示します。

レスポンス 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 — テンプレートを一覧表示

28カテゴリーにわたる、プロがデザインした118個のQRコードテンプレートを閲覧できます。

クエリパラメータ:

パラメータ型必須説明
categorystringいいえカテゴリーで絞り込む(例: luxury、corporate、social)

レスポンス 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} — テンプレートから生成

既製のテンプレートを使ってQRコードを生成します。テンプレートのビジュアルデザインは維持され、必要に応じて出力設定を上書きできます。

パスパラメータ:

パラメータ型必須説明
templateIdstringはいテンプレート一覧エンドポイントで取得したテンプレートID(例: cyber-neon)

リクエストボディ:

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

レスポンス 200:

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

POST /api/qr/content/wifi — WiFi文字列を生成

QRにエンコードするためのWiFi接続文字列を生成します。QRコードをスキャンしたユーザーには、ネットワークへの接続が自動的に提案されます。

リクエストボディ:

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

レスポンス 200:

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

POST /api/qr/content/vcard — vCard文字列を生成

QRにエンコードするためのvCard連絡先文字列を生成します。スキャンすると、連絡先をスマートフォンに保存するよう促されます。

リクエストボディ:

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

レスポンス 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 — 位置情報の文字列を生成

QRにエンコードするための位置情報URIを生成します。スキャンすると、ユーザーのデフォルトの地図アプリでその場所が開きます。

リクエストボディ:

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

レスポンス 200:

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

エラー処理

すべてのエラーは一貫した形式に従います。

{
  "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"
      }
    ]
  }
}

エラーコード

検証(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

認証(401) UNAUTHORIZED · INVALID_API_KEY · MISSING_API_KEY

見つからない(404) RESOURCE_NOT_FOUND · TEMPLATE_NOT_FOUND

AI/LLMのエラー(400/500) INVALID_LLM_PROVIDER · INVALID_LLM_MODEL · LLM_API_KEY_INVALID · AI_GENERATION_FAILED · AI_CONFIG_INVALID · AI_REQUEST_TIMEOUT

出力上限(422) OUTPUT_TOO_COMPLEX — このデザインでは 20 MB を超える SVG / PDF、または 1 辺 5120 px を超えるキャンバスが必要になります。PNG で書き出すか、内容を短くするか、よりシンプルなモジュール形状を使ってください

キャパシティ(503) SERVER_BUSY · AI_QUOTA_EXCEEDED (マネージド AI がすべてのプロバイダーでクォータ切れです。時間をおいて再試行してください)

サーバーエラー(500) INTERNAL_ERROR · QR_GENERATION_FAILED · LOGO_LOAD_FAILED · BACKGROUND_LOAD_FAILED