API reference

QR codes

Get a QR code that opens a short link, ready for print, packaging, or slides. Scans are counted as clicks like any other visit.

Get a QR code

GET/api/v1/links/{id}/qr

QR code query parameters
NameTypeDescription
format"svg" | "png"svg (default) returns image/svg+xml. png returns image/png.
sizeintegerWidth in pixels, 128-2048. Default 512.
# SVG (default), scales to any print size
curl "https://smartlink.sh/api/v1/links/cm1x2y3z4000008l1abcd1234/qr" \
  -H "Authorization: Bearer $SMARTLINK_API_KEY" -o launch.svg

# 1024px PNG
curl "https://smartlink.sh/api/v1/links/cm1x2y3z4000008l1abcd1234/qr?format=png&size=1024" \
  -H "Authorization: Bearer $SMARTLINK_API_KEY" -o launch.png

The response body is the image itself, not JSON. Errors still use the JSON error envelope. The code encodes the link’s shortUrl. It uses medium error correction and a quiet-zone margin, so it scans reliably when printed.