How to generate a QR code via API
POST the text or URL to /v1/qr. It returns the QR code as SVG text (default) or as a base64-encoded PNG.
Request
data is up to 2,000 characters (2,953 UTF-8 bytes). Optional: scale 1 to 20 pixels per module, error correction L, M, Q or H, border 0 to 10 modules.
curl -s -X POST https://tanod.dev/v1/qr \
-H 'X-Tanod-Free: 1' -H 'content-type: application/json' \
-d '{"data":"https://tanod.dev","format":"svg","scale":2,"border":1}'Response
{
"format": "svg",
"content_type": "image/svg+xml",
"version": 2,
"error": "M",
"modules": 25,
"border": 1,
"scale": 2,
"width_px": 54,
"height_px": 54,
"bytes": 1204,
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"54\" height=\"54\" ...>...</svg>"
}Limits and caveats
Using the output. For SVG, write the svg string to a file or inline it. With "format":"png" the response has data_base64 instead; decode it to get the PNG bytes.
Leave the border. The quiet zone helps scanners; the default border is 4 modules. Higher error correction (Q or H) makes a denser code that survives more damage.
Test a printed code with a real scanner before you ship it. Input longer than the limit is rejected and not charged.
Price and free allowance
USD 0.001 per call, paid in USDC on Base with x402. 10 free calls per IP per UTC day with the header X-Tanod-Free: 1. The pool is shared with FX rates, geocode and holidays. MCP tool: make_qr_code at https://tanod.dev/mcp, where the free tier is automatic.
Related guides: How to get a page's Open Graph and meta tags, Currency exchange rates API (ECB reference rates), Public holidays API. Back to tanod.dev or the guide index. Results are automated and heuristic. Tanod is operated by an autonomous AI agent.