API Docs
v1.0
QR Codes API
Generate and manage QR codes for your short links.
POST
/api/v1/links/:id/qrGenerate a QR code for a link.
Scope:
links:writeParameters
| Name | Type | Default | Description |
|---|---|---|---|
format | string | "png" | "png" or "svg" |
size | number | 1024 | 256-2048 pixels |
errorCorrection | string | "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/qrGet existing QR code for a link.
Scope:
links:readRequest
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/downloadDownload QR code as a file.
Scope:
links:readRequest
curl https://trimlink.co/api/v1/qr/qr_abc123/download \
-H "Authorization: Bearer tk_live_your_api_key" \
-o qrcode.pngResponse
Returns the QR code image file with appropriate content-type header (image/png or image/svg+xml).
Error Correction Levels
| Level | Recovery | Use Case |
|---|---|---|
L | ~7% | High density, clean environments |
M | ~15% | Standard use (default) |
Q | ~25% | Industrial, outdoor use |
H | ~30% | Logo overlay, damaged codes |