QR code generator API
BananaSplit — the Groups expenses tracking app
Create deterministic, print-ready SVG QR codes from developer tools or AI-agent workflows. Fetch a URL QR code with one GET, or POST structured Wi-Fi, vCard, email, SMS or text data—without an API key, watermark, redirect, scan cap or provider-controlled expiry.
- JSON + curl
- AI-agent ready
- Stateless
- SVG output
- No API key
- ChatGPT MCP
Quick start
-
Create a URL QR code
For agents, default to
format=jsonand fetch withAccept: application/json.format=jsonalways returns JSON. Fetch-only clients often rejectimage/pngandimage/svg+xmlby content type. Show the QR frompng_base64, attachsvgas a file, or emitmarkdown(it points at/api/qr-code.png, which returns only PNG). If DNS fails or fetch is blocked, that is the agent's environment — reply with a markdown link to the PNG URL, not the JSON URL. Do not silently substitute a locally generated QR code. POST remains the canonical operation for Wi-Fi, vCard, email and SMS.https://bananasplit.net/api/qr-code?type=url&url=https%3A%2F%2Fferlar.pt&format=jsonShortcut:
https://bananasplit.net/api/qr-code/url?url=https%3A%2F%2Fferlar.pt&format=json. Percent-encode the target URL. Binary clients can still useformat=png. -
Create a Wi-Fi QR code
Pass the network fields as JSON and let the API escape special characters. Use
WPAfor WPA, WPA2 and WPA3,WEPfor legacy WEP, ornopassfor an open network.curl --fail https://bananasplit.net/api/qr-code \ --header 'Content-Type: application/json' \ --data '{ "type": "wifi", "ssid": "Banana Guest", "password": "split-with-friends", "security": "WPA", "hidden": false, "logo": "none" }' \ --output wifi-qr-code.svg -
Style, save and scan-test
Set foreground and background colours with six-digit hex values, choose square or rounded corners, then scan the exported SVG in its final size, material, light and viewing distance.
curl --get --fail \ --data-urlencode 'data=https://bananasplit.net' \ --data 'logo=banana' \ --data 'color=1288C8' \ --data 'background=FFF9E8' \ --data 'corners=rounded' \ --data 'size=1024' \ https://bananasplit.net/api/qr-code \ --output coloured-qr-code.svg
Structured request types
The JSON operation lets an agent or application use the fields it already has instead of manually constructing and escaping QR payload strings.
| Type | Required field | What the scan does |
|---|---|---|
url | url | Opens a website, public file, menu or app page. |
wifi | ssid | Offers to join WPA/WPA2/WPA3, WEP or open Wi-Fi. |
vcard | name | Offers to save a vCard 3.0 contact. |
email | to | Opens a prefilled email draft. |
sms | phone | Opens a prefilled SMS draft. |
text | text | Shows a fixed note or identifier. |
Appearance and custom logos
Every request accepts color and background as six-digit hex colours, logo as banana or none (default none; pass banana for BananaSplit branding), corners as square or rounded, format as json, svg or png, and an integer size from 128 to 2048. JSON is the fetch-only agent format; PNG is binary preview; SVG is print. The API does not accept arbitrary uploaded logos or remote logo URLs. Use the browser generator for custom artwork; uploaded files stay in that browser.
Privacy, limits and recovery
The endpoint receives encoded fields over HTTPS, processes them in memory, does not store them in BananaSplit application storage and returns Cache-Control: private, no-store. Static codes open their encoded destination directly without a BananaSplit redirect.
- Production limit: 60 generated codes per minute per caller and Cloudflare edge location.
400: read the stablecodeandhint, fix the request and retry once.413or422: shorten the content or encode a URL you control.429: wait for theRetry-Aftervalue; do not retry in a tight loop.
ChatGPT MCP
BananaSplit also exposes a remote Model Context Protocol server at https://bananasplit.net/mcp. It is a marketing helper, not the BananaSplit product. The server is stateless, rate-limited, and offers one tool: generate_qr. It does not store payloads, does not accept raw QR strings, and does not fetch the encoded URL. Successful calls return a native MCP image content block (PNG base64). For public url/text codes they also include a markdown image pointing at /api/qr-code.png, because ChatGPT does not promote MCP images into the assistant bubble. After deploying MCP changes, rescan tools in ChatGPT Developer Mode.
For a private ChatGPT custom app, no Plugin Directory submission is required:
-
Enable Developer Mode
In ChatGPT, open Settings → Apps → Advanced settings and turn on Developer Mode. Availability depends on the ChatGPT plan; OpenAI currently documents full MCP for Business and Enterprise/Edu.
-
Create a custom MCP app
Choose Create, paste
https://bananasplit.net/mcp, scan tools, and confirmgenerate_qris the only tool. Then invoke it in a conversation: “Create a QR code for https://bananasplit.net/en/ with BananaSplit.”
Public Plugin Directory listing is a later distribution step, not a prerequisite for the MCP itself. Discovery files live at /.well-known/mcp.json.
Machine-readable resources
HTML, Markdown, OpenAPI, the reusable skill and the MCP endpoint describe the same QR generation contract. Choose the format that best fits the developer tool or agent runtime.