URL QR code
cURL
# SVG output
curl "https://bananasplit.net/api/qr-code?type=url&url=https://example.com&format=svg" \
-o qr.svg
# JSON with both formats
curl "https://bananasplit.net/api/qr-code?type=url&url=https://example.com&format=json"
# Custom colors
curl "https://bananasplit.net/api/qr-code?type=url&url=https://example.com&color=7b260f&background=ffe66f&format=svg"
JavaScript
const response = await fetch(
'https://bananasplit.net/api/qr-code?' + new URLSearchParams({
type: 'url',
url: 'https://example.com',
format: 'json'
})
);
const { svg, png } = await response.json();
Python
import requests
response = requests.get('https://bananasplit.net/api/qr-code', params={
'type': 'url',
'url': 'https://example.com',
'format': 'svg'
})
svg_content = response.text
Wi-Fi QR code
curl -X POST "https://bananasplit.net/api/qr-code" \
-H "Content-Type: application/json" \
-d '{
"type": "wifi",
"ssid": "MyNetwork",
"password": "secret123",
"encryption": "WPA",
"format": "svg"
}'
Contact card
curl -X POST "https://bananasplit.net/api/qr-code" \
-H "Content-Type: application/json" \
-d '{
"type": "vcard",
"firstName": "Ana",
"lastName": "Silva",
"phone": "+351912345678",
"email": "ana@example.com",
"organization": "Acme Inc",
"format": "svg"
}'
Email QR code
curl -X POST "https://bananasplit.net/api/qr-code" \
-H "Content-Type: application/json" \
-d '{
"type": "email",
"email": "hello@example.com",
"subject": "Hello",
"body": "I found you via QR code",
"format": "svg"
}'
SMS QR code
curl -X POST "https://bananasplit.net/api/qr-code" \
-H "Content-Type: application/json" \
-d '{
"type": "sms",
"phone": "+351912345678",
"message": "Hello from QR",
"format": "svg"
}'
Custom styling
BananaSplit brand colors
curl "https://bananasplit.net/api/qr-code?type=url&url=https://bananasplit.net&color=7b260f&background=ffe66f&corners=rounded&format=svg"
With banana logo
curl "https://bananasplit.net/api/qr-code?type=url&url=https://bananasplit.net&logo=banana&format=svg"
Large print-ready
curl "https://bananasplit.net/api/qr-code?type=url&url=https://example.com&size=2048&format=png" \
-o qr-print.png
Using with agents
AI agents can generate QR codes inline:Generate a QR code for https://bananasplit.net using the QR Code API
Error handling
const response = await fetch('https://bananasplit.net/api/qr-code?type=url&url=invalid');
if (!response.ok) {
const error = await response.json();
console.error(error.code, error.hint);
// INVALID_URL, "URL must start with http:// or https://"
}
Rate limit handling
const response = await fetch('https://bananasplit.net/api/qr-code?...');
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After');
await new Promise(r => setTimeout(r, retryAfter * 1000));
// retry
}