QR Code¶
Generate QR codes from structured input.
apicrate-generate-qr¶
Generate a QR code from text, URL, WiFi credentials, vCard, email, SMS, or geographic coordinates. Returns a base64 data URI by default, or a pre-signed S3 download URL for PNG/SVG formats.
Credit cost: 2 credits per call.
Parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
QR type: |
|
string |
preset=text |
Text to encode |
|
string |
preset=url |
URL to encode |
|
string |
preset=wifi |
WiFi network name |
|
string |
no |
WiFi password (default empty) |
|
string |
preset=vcard |
Contact full name |
|
string |
preset=email |
Recipient email address |
|
string |
preset=sms |
Phone number |
|
float |
preset=geo |
Latitude (-90 to 90) |
|
float |
preset=geo |
Longitude (-180 to 180) |
|
string |
no |
Output: |
|
int |
no |
Image size 100–2000 px (default 400) |
|
string |
no |
Foreground hex color (default |
|
string |
no |
Background hex color (default |
|
string |
no |
|
|
int |
no |
Quiet zone 0–20 modules (default 4) |
Example – Text QR¶
Request:
{
"name": "apicrate-generate-qr",
"arguments": {
"preset": "text",
"text": "Hello from ApiCrate!"
}
}
Response:
{
"preset": "text",
"format": "base64",
"data_uri": "data:image/png;base64,iVBORw0KGgo..."
}
Example – WiFi QR¶
Request:
{
"name": "apicrate-generate-qr",
"arguments": {
"preset": "wifi",
"ssid": "GuestNetwork",
"password": "welcome2025",
"format": "png"
}
}
Response:
{
"preset": "wifi",
"format": "png",
"url": "https://s3.example.com/qr/abc123.png?X-Amz-...",
"expires": 1744819200
}
Errors¶
Unknown preset – only
text,url,wifi,vcard,email,sms, andgeoare supported.Missing required parameter – each preset requires specific fields (e.g.,
ssidfor wifi,namefor vcard).S3 unavailable – when using
pngorsvgformat and S3 is down. Useformat=base64as fallback.