v1 REST Developer Platform
Developer API Platform
Embed ultra-fast, branded vector QR code generation directly into your POS, CRM, ecommerce platform, or SaaS backend.
Live API Console & Code Generator
Get Your API Key →Interactive API Tester
Configure parameters & execute live requests
#4f46e5
#9333ea
curl -X POST https://qrgen.app/api/v1/qr \
-H "Authorization: Bearer qrapi_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"data": "https://yourbrand.com/promo",
"format": "svg",
"size": 1000,
"design": {
"bodyStyle": "square",
"foregroundColor": "#4f46e5",
"gradientType": "linear",
"gradientColor2": "#9333ea"
}
}'Authentication
Bearer Token via Authorization Header
All API requests must include your API key in the standard HTTP Authorization header:
Authorization: Bearer qrapi_live_9a87bf23d8e9...JavaScript & TypeScript Quickstart
Client-side & Server-side integrations for Next.js, Node.js, React, and browser runtimes
Vanilla JavaScript / Browser FetchES6+
// Generate branded vector QR code
async function getBrandedQR(url, style = 'rounded-pointed') {
const res = await fetch('https://qrgen.app/api/v1/qr', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.QRGEN_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: url,
format: 'svg',
size: 1000,
design: {
bodyStyle: style,
foregroundColor: '#4f46e5',
gradientType: 'linear',
gradientColor2: '#9333ea'
}
})
});
const { svg, safety } = await res.json();
return { svg, score: safety?.score };
}TypeScript SDK UtilityType-Safe
export interface QRResponse {
id: string;
format: 'svg' | 'png';
size: number;
data: string;
svg: string;
safety: {
score: number;
status: 'OPTIMAL' | 'ACCEPTABLE' | 'RISKY';
warnings: string[];
};
}
export async function createQRCode(
data: string,
apiKey: string
): Promise<QRResponse> {
const res = await fetch('https://qrgen.app/api/v1/qr', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ data, format: 'svg' }),
});
if (!res.ok) throw new Error(`Failed: ${res.status}`);
return res.json();
}API Endpoint Reference
| Method | Endpoint Route | Description |
|---|---|---|
| POST | /api/v1/qr | Generate high-resolution styled vector SVG or binary PNG QR codes programmatically. |
| GET | /api/v1/qr | List all generated QR codes for your workspace. |
| POST | /api/v1/dynamic | Create a dynamic tracking QR with short code, smart routing rules, and analytics. |
| GET | /api/v1/dynamic/:id | Get dynamic QR details and real-time scan count. |
| PATCH | /api/v1/dynamic/:id | Update destination URL, smart rules, or active/paused status. |
| GET | /api/v1/qr/:id/analytics | Retrieve scan timeline, geo distribution, OS, device, and browser metrics. |
| POST | /api/v1/qr/bulk | Batch generate up to 200 styled QR codes at once. |
| POST | /api/v1/qr/transparent | Generate transparent QR code composite overlaid onto background images. |
Standard Error Format
All API errors return consistent JSON structures with structured error codes:
{
"error": {
"code": "INVALID_PARAMETER",
"field": "size",
"message": "The size must be between 100 and 5000.",
"request_id": "req_82JH2"
}
}