Get Link QR Code
Generates and returns a QR code image that encodes the short URL of the specified link. The response is binary image data (not JSON), so this endpoint does not use the standard response envelope.
GET
/v1/links/{link_id}/qr qr:render Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
link_id | string (UUID) | Yes | The unique identifier of the link. |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | svg | Output format: svg or png. |
size | integer | 10 | Module size multiplier (1 – 50). For PNG, this controls the pixel size of each QR module. |
template_id | string (UUID) | — | Apply a saved QR template (colors, logo, dot style). |
Request Examples
# Download as SVG (default)curl https://xqr.co/api/v1/links/d47f2e1a-8c3b-4a5d-9e6f-1234567890ab/qr \ -H "Authorization: Bearer xqr_pk_a1b2c3d4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -o qr-code.svg
# Download as PNG with custom size and templatecurl "https://xqr.co/api/v1/links/d47f2e1a-8c3b-4a5d-9e6f-1234567890ab/qr?format=png&size=20&template_id=b12c3d4e-5f6a-7b8c-9d0e-f12345678901" \ -H "Authorization: Bearer xqr_pk_a1b2c3d4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -o qr-code.pngconst linkId = "d47f2e1a-8c3b-4a5d-9e6f-1234567890ab";const params = new URLSearchParams({ format: "png", size: "20" });
const response = await fetch( `https://xqr.co/api/v1/links/${linkId}/qr?${params}`, { headers: { Authorization: "Bearer xqr_pk_a1b2c3d4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", }, },);
const blob = await response.blob();// Use blob.arrayBuffer() to save, or URL.createObjectURL(blob) for displayconsole.log(`Content-Type: ${response.headers.get("content-type")}`);console.log(`Size: ${blob.size} bytes`);import httpx
link_id = "d47f2e1a-8c3b-4a5d-9e6f-1234567890ab"
response = httpx.get( f"https://xqr.co/api/v1/links/{link_id}/qr", headers={ "Authorization": "Bearer xqr_pk_a1b2c3d4.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", }, params={"format": "png", "size": 20},)
with open("qr-code.png", "wb") as f: f.write(response.content)
print(f"Content-Type: {response.headers['content-type']}")print(f"Size: {len(response.content)} bytes")Response
200 OK
The QR code image as binary data with the appropriate Content-Type header.
| Format | Content-Type | Description |
|---|---|---|
svg | image/svg+xml | Scalable vector graphic. |
png | image/png | Raster image at the requested module size. |
Response headers:
Content-Type: image/svg+xmlContent-Disposition: inline; filename="d47f2e1a-qr.svg"X-Request-Id: req_6f70890123456789X-RateLimit-Limit: 600X-RateLimit-Remaining: 593X-RateLimit-Reset: 1742572800Error Responses
Errors are still returned as JSON:
{ "error": { "code": "not_found", "message": "Link not found." }, "meta": { "request_id": "req_6f70890123456789" }}Was this page helpful?
Thanks for your feedback!