Render Template
Renders a QR code image using a previously saved design template. Pass the content to encode as a query parameter and the template’s design settings are applied automatically. The response is the raw image binary.
POST
/v1/qr/templates/{template_id}/render qr:render Parameters
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
template_id | string | Yes | The unique identifier of the template. |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
data | string | Yes | — | The URL or text to encode in the QR code. |
format | string | No | svg | Output format: svg or png. |
size | integer | No | 10 | Module size multiplier (1–50). |
Request examples
curl "https://xqr.co/api/v1/qr/templates/tpl_abc123/render?data=https%3A%2F%2Fexample.com&format=png&size=20" \ -H "Authorization: Bearer YOUR_API_KEY" \ --output qr.pngconst templateId = "tpl_abc123";const params = new URLSearchParams({ data: "https://example.com", format: "png", size: "20",});
const res = await fetch( `https://xqr.co/api/v1/qr/templates/${templateId}/render?${params}`, { headers: { Authorization: "Bearer YOUR_API_KEY", }, });
const blob = await res.blob();import httpx
template_id = "tpl_abc123"
res = httpx.get( f"https://xqr.co/api/v1/qr/templates/{template_id}/render", headers={"Authorization": "Bearer YOUR_API_KEY"}, params={ "data": "https://example.com", "format": "png", "size": 20, },)
with open("qr.png", "wb") as f: f.write(res.content)Response
200 OK
The response body is the raw image binary with the appropriate content type header.
| Format | Content-Type |
|---|---|
svg | image/svg+xml |
png | image/png |
Was this page helpful?
Thanks for your feedback!