QR Code Generation
Generate customisable QR codes for your biolinks or any URL.
Overview
The API provides two ways to generate QR codes:
- Biolink QR codes - Generate QR codes for your existing biolinks
- Custom URL QR codes - Generate QR codes for any URL
Biolink QR Codes
Get QR code data for an existing biolink:
cURL
curl --request GET \
--url 'https://api.lthn.ai/api/v1/bio/1/qr' \
--header 'Authorization: Bearer YOUR_API_KEY'
Response:
{
"data": {
"svg": "<svg>...</svg>",
"url": "https://example.com/mypage"
}
}
Custom URL QR Codes
Generate a QR code for any URL:
cURL
curl --request POST \
--url 'https://api.lthn.ai/api/v1/qr/generate' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com",
"format": "svg",
"size": 300
}'
Customisation Options
Available customisation parameters:
| Parameter | Type | Description |
|---|---|---|
format |
string | Output format: svg or png |
size |
integer | Size in pixels (100-2000) |
color |
string | Foreground colour (hex) |
background |
string | Background colour (hex) |
Download Formats
Download QR codes directly as image files:
cURL
curl --request GET \
--url 'https://api.lthn.ai/api/v1/bio/1/qr/download?format=png&size=500' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--output qrcode.png
The response is binary image data with appropriate Content-Type header.