QR code API docs
The base URL is https://qr.cuelark.com. GET or POST /v1/qr returns the image itself, and POST /v1/decode reads a code. No account or key is needed.
GET or POST /v1/qr
| Parameter | Meaning |
|---|---|
| data | Text or link to encode (up to 2,000 characters). Use this or type + fields. |
| type | url, text, wifi, vcard, email, sms, phone, whatsapp, event, location or upi |
| fields | POST: object with the type's fields. GET: pass the fields as query parameters, e.g. type=wifi&ssid=Guest&password=... |
| format | png (default) or svg |
| size | 64 to 2048 pixels (default 512) |
| fg / bg | Hex colors without # in a URL (fg=1e3a8a), or bg=transparent |
| margin | Quiet zone in modules, 0 to 10 (default 4) |
| ecc | Error correction L, M (default), Q or H |
| style | square (default), rounded or dots |
Fields per type
| type | fields |
|---|---|
| wifi | ssid, password, encryption (WPA, WEP, nopass), hidden |
| vcard | firstName, lastName, org, title, phone, workPhone, email, website, street, city, region, zip, country, note |
| to, subject, body | |
| sms | phone, message |
| phone | phone |
| phone (with country code), message | |
| event | title, start, end (YYYY-MM-DDTHH:MM), location, description, allDay |
| location | lat, lng, label |
| upi | vpa, name, amount, note |
html
<img src="https://qr.cuelark.com/v1/qr?data=https%3A%2F%2Fexample.com&size=256" width="256" height="256" alt="QR code for example.com">js
const svg = await fetch("https://qr.cuelark.com/v1/qr", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ type: "vcard", fields: { firstName: "Jane", lastName: "Rivera", phone: "+14155550134" }, format: "svg" }),
}).then((r) => r.text());GET or POST /v1/barcode
Barcodes with the same engine as the barcode generator. The response headers x-barcode-size-mm and x-barcode-encoded give the print size and the encoded value with its check digit.
| Parameter | Meaning |
|---|---|
| type | code128 (default), code39, ean13, upca, ean8, upce, itf14, gs1-128, isbn, codabar, i2of5, datamatrix, gs1-datamatrix, pdf417, aztec |
| data | What to encode. GS1 types accept the number with or without its check digit; a wrong check digit returns 400 with the correct one. |
| format | svg (default, sized in mm), png or pdf (vector) |
| x | X-dimension (narrowest bar or module) in mm, 0.1 to 5. Defaults to the GS1 target for the type, e.g. 0.33 for EAN-13 and 0.495 for ITF-14. |
| height | Bar height in mm, 2 to 300 (linear types) |
| dpi | PNG resolution, 72 to 1200 (default 300). Bars snap to whole pixels so they print exactly. |
| text | false to hide the human-readable line |
| fg / bg | Hex colors without # in a URL, or bg=transparent |
| quiet | Quiet zone in modules (defaults to the standard minimum) |
| rotate | 0, 90, 180 or 270 |
| bearer | ITF-14 bearer bars: box (default) or bars (top and bottom only) |
bash
curl -o case.pdf "https://qr.cuelark.com/v1/barcode?type=itf14&data=1540014128876&format=pdf"
curl -o sku.png "https://qr.cuelark.com/v1/barcode?type=code128&data=SKU-0001&format=png&dpi=203"POST /v1/decode
Send a PNG or JPEG as the raw body (content-type image/png or image/jpeg), or JSON with image (base64) or url (a public image link). Images up to 4 MB and 16 megapixels.
bash
curl -X POST https://qr.cuelark.com/v1/decode -H "content-type: application/json" \
-d '{"url":"https://qr.cuelark.com/v1/qr?data=hello"}'
# {"found":true,"text":"hello","version":1,"type":"unknown","summary":"Plain text"}Limits
- 240 requests per minute per IP. Repeated GET image URLs are served from Cloudflare's cache.
- Decoding: 200 images per day per IP.
- Free API keys with higher limits are coming with Cuelark accounts; keys will be sent as
Authorization: Bearer <key>.
Errors
Errors are JSON: {"error":"bad_request","message":"…"}, with status 400 (bad input or URL refused), 413 (too large), 429 (limit reached; see retry-after) or 504 (image URL timed out).
Security and privacy
- Image URLs must be public http(s) on ports 80 or 443 and resolve to public IP addresses, checked again on every redirect. localhost, private ranges and cloud metadata addresses are refused.
- Inputs and outputs aren't stored or logged. Counters for the free limits use salted hashes, never raw IP addresses.
Using an AI assistant? See the MCP server.