Developer API
QRMaster API Reference
Generate QR codes programmatically from any language. One endpoint, simple JSON, returns PNG or base64.
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_keyEndpoint
/api/generateAccepts a JSON body, validates your key, applies rate limits, and returns a QR code as base64 JSON or a raw PNG.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | The URL or text to encode in the QR code. |
| color | string | No | Foreground hex color. Default: "#000000" |
| background | string | No | Background hex color. Default: "#ffffff" |
| size | number | No | Output size in pixels (100–1000). Default: 300 |
| format | string | No | "base64" (default) or "png" to get raw image bytes. |
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]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: 87When the limit is exceeded, the API returns 429 Too Many Requests with a descriptive error message.
Error Codes
| Status | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameters |
| 401 | Unauthorized — missing or invalid API key |
| 422 | Unprocessable — QR generation failed (e.g. invalid URL) |
| 429 | Too many requests — daily rate limit exceeded |
| 500 | Internal server error |
Error response shape
{ "error": "Human-readable error message." }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.pngJavaScript / 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.