Developers/API/QR Codes

QR Codes API

Generate and manage QR codes for your short links.

POST/api/v1/links/:id/qr

Generate a QR code for a link.

Scope: links:write

Parameters

NameTypeDefaultDescription
formatstring"png""png" or "svg"
sizenumber1024256-2048 pixels
errorCorrectionstring"M""L", "M", "Q", or "H"

Request

curl -X POST https://trimlink.co/api/v1/links/clx123abc/qr \
  -H "Authorization: Bearer tk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "png",
    "size": 1024,
    "errorCorrection": "M"
  }'

Response

201Response
{
  "success": true,
  "data": {
    "id": "qr_abc123",
    "format": "png",
    "data": "iVBORw0KGgoAAAANSUhEUgAA...",
    "size": 1024,
    "downloadCount": 0,
    "scanCount": 0
  }
}
GET/api/v1/links/:id/qr

Get existing QR code for a link.

Scope: links:read

Request

curl https://trimlink.co/api/v1/links/clx123abc/qr \
  -H "Authorization: Bearer tk_live_your_api_key"

Response

200Response
{
  "success": true,
  "data": {
    "id": "qr_abc123",
    "format": "png",
    "data": "iVBORw0KGgoAAAANSUhEUgAA...",
    "size": 1024,
    "downloadCount": 5,
    "scanCount": 42
  }
}
GET/api/v1/qr/:qrCodeId/download

Download QR code as a file.

Scope: links:read

Request

curl https://trimlink.co/api/v1/qr/qr_abc123/download \
  -H "Authorization: Bearer tk_live_your_api_key" \
  -o qrcode.png

Response

Returns the QR code image file with appropriate content-type header (image/png or image/svg+xml).

Error Correction Levels

LevelRecoveryUse Case
L~7%High density, clean environments
M~15%Standard use (default)
Q~25%Industrial, outdoor use
H~30%Logo overlay, damaged codes