Skip to content

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

ParameterTypeRequiredDescription
link_idstring (UUID)YesThe unique identifier of the link.

Query Parameters

ParameterTypeDefaultDescription
formatstringsvgOutput format: svg or png.
sizeinteger10Module size multiplier (1 – 50). For PNG, this controls the pixel size of each QR module.
template_idstring (UUID)Apply a saved QR template (colors, logo, dot style).

Request Examples

Terminal window
# 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 template
curl "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.png

Response

200 OK

The QR code image as binary data with the appropriate Content-Type header.

FormatContent-TypeDescription
svgimage/svg+xmlScalable vector graphic.
pngimage/pngRaster image at the requested module size.

Response headers:

Content-Type: image/svg+xml
Content-Disposition: inline; filename="d47f2e1a-qr.svg"
X-Request-Id: req_6f70890123456789
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 593
X-RateLimit-Reset: 1742572800

Error Responses

Errors are still returned as JSON:

{
"error": {
"code": "not_found",
"message": "Link not found."
},
"meta": {
"request_id": "req_6f70890123456789"
}
}

Was this page helpful?