Developer API

QRMaster API Reference

Generate QR codes programmatically from any language. One endpoint, simple JSON, returns PNG or base64.

Base URL: qrmaster.appPro plan required100 requests / day
01

Authentication

All requests must include your API key in the x-api-key header. Generate your key from the QRMaster dashboard (Pro plan required).

x-api-key: qrm_your_api_key
Keep your API key secret. Do not expose it in client-side code or public repositories.
02

Endpoint

POST/api/generate

Accepts a JSON body, validates your key, applies rate limits, and returns a QR code as base64 JSON or a raw PNG.

03

Request Parameters

ParameterTypeRequiredDescription
urlstringYesThe URL or text to encode in the QR code.
colorstringNoForeground hex color. Default: "#000000"
backgroundstringNoBackground hex color. Default: "#ffffff"
sizenumberNoOutput size in pixels (100–1000). Default: 300
formatstringNo"base64" (default) or "png" to get raw image bytes.
04

Response

Base64 Response (default)

{
  "success": true,
  "data": "iVBORw0KGgoAAAANSUhEUgAA...",
  "format": "base64",
  "size": 300
}

Decode data with base64.decode() or use it directly as data:image/png;base64,{data} in an <img> src.

PNG Response (format: "png")

HTTP/1.1 200 OK
Content-Type: image/png
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87

[binary PNG data]
05

Rate Limits

Each API key is limited to 100 requests per day. The limit resets at midnight UTC. Every response includes rate limit headers.

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87

When the limit is exceeded, the API returns 429 Too Many Requests with a descriptive error message.

06

Error Codes

StatusMeaning
400Bad request — missing or invalid parameters
401Unauthorized — missing or invalid API key
422Unprocessable — QR generation failed (e.g. invalid URL)
429Too many requests — daily rate limit exceeded
500Internal server error

Error response shape

{ "error": "Human-readable error message." }
07

Code Examples

cURL — base64 response

curl -X POST https://qrmaster.app/api/generate \
  -H "x-api-key: qrm_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "color": "#0B0D12",
    "background": "#ffffff",
    "size": 400,
    "format": "base64"
  }'

cURL — download PNG directly

curl -X POST https://qrmaster.app/api/generate \
  -H "x-api-key: qrm_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"png"}' \
  --output qr.png

JavaScript / TypeScript

const response = await fetch("https://qrmaster.app/api/generate", {
  method: "POST",
  headers: {
    "x-api-key": "qrm_your_api_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://example.com",
    color: "#0B0D12",
    background: "#ffffff",
    size: 400,
    format: "base64",
  }),
});

const { data } = await response.json();
// data is a base64-encoded PNG string
const img = document.createElement("img");
img.src = `data:image/png;base64,${data}`;

Python

import requests, base64

response = requests.post(
    "https://qrmaster.app/api/generate",
    headers={"x-api-key": "qrm_your_api_key"},
    json={
        "url": "https://example.com",
        "color": "#0B0D12",
        "background": "#ffffff",
        "size": 400,
        "format": "base64",
    },
)

payload = response.json()
img_bytes = base64.b64decode(payload["data"])
with open("qr.png", "wb") as f:
    f.write(img_bytes)

Ready to start building?

Get your API key from the dashboard after upgrading to Pro.