Skip to content

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

ParameterMeaning
dataText or link to encode (up to 2,000 characters). Use this or type + fields.
typeurl, text, wifi, vcard, email, sms, phone, whatsapp, event, location or upi
fieldsPOST: object with the type's fields. GET: pass the fields as query parameters, e.g. type=wifi&ssid=Guest&password=...
formatpng (default) or svg
size64 to 2048 pixels (default 512)
fg / bgHex colors without # in a URL (fg=1e3a8a), or bg=transparent
marginQuiet zone in modules, 0 to 10 (default 4)
eccError correction L, M (default), Q or H
stylesquare (default), rounded or dots

Fields per type

typefields
wifissid, password, encryption (WPA, WEP, nopass), hidden
vcardfirstName, lastName, org, title, phone, workPhone, email, website, street, city, region, zip, country, note
emailto, subject, body
smsphone, message
phonephone
whatsappphone (with country code), message
eventtitle, start, end (YYYY-MM-DDTHH:MM), location, description, allDay
locationlat, lng, label
upivpa, 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.

ParameterMeaning
typecode128 (default), code39, ean13, upca, ean8, upce, itf14, gs1-128, isbn, codabar, i2of5, datamatrix, gs1-datamatrix, pdf417, aztec
dataWhat to encode. GS1 types accept the number with or without its check digit; a wrong check digit returns 400 with the correct one.
formatsvg (default, sized in mm), png or pdf (vector)
xX-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.
heightBar height in mm, 2 to 300 (linear types)
dpiPNG resolution, 72 to 1200 (default 300). Bars snap to whole pixels so they print exactly.
textfalse to hide the human-readable line
fg / bgHex colors without # in a URL, or bg=transparent
quietQuiet zone in modules (defaults to the standard minimum)
rotate0, 90, 180 or 270
bearerITF-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

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

Using an AI assistant? See the MCP server.