preview_qr_encoding
Work out how a payload will encode as a QR code, without creating anything. Returns the exact string the pixels would carry, its byte length, the QR version and module count required, the capacity remaining at that version, and any warnings. Costs nothing and mints nothing.
Use this to answer questions like "will this URL fit at error correction level H" or "how much does a long Wi-Fi password cost me in QR density". Higher ECC survives damage better but needs more modules for the same data; more modules print smaller and get harder to scan.
payloadKind 'qart_code' sizes the RETARGETABLE variant instead: the pixels carry a 16-byte qart.uk/_ link rather than your data, which is usually several versions smaller. Compare the two before committing to a print.
This returns metadata only, never the module grid. For the actual black/white matrix, call get_qr_matrix.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ecc | No | Error correction level, lowest to highest. Defaults to the Studio default if omitted. | |
| end | No | For 'event': end datetime. | |
| url | No | For payloadKind 'url': the destination. | |
| name | No | For payloadKind 'vcard': full name. | |
| ssid | No | For payloadKind 'wifi': network name. | |
| text | No | For payloadKind 'text': the literal text. | |
| No | For payloadKind 'vcard': email address. | ||
| phone | No | Phone, for vcard/mecard/tel/sms/whatsapp. | |
| start | No | For 'event': start datetime (YYYY-MM-DDTHH:MM). | |
| title | No | For 'event': title. For 'vcard': job title. | |
| allDay | No | For 'event': all-day (DATE values). | |
| amount | No | For 'paypal': optional amount. | |
| fields | No | Payload fields for the kind. Flat sibling properties (url, phone, handle, …) are also accepted, matching get_qr_matrix. | |
| handle | No | For social kinds: handle or profile URL. | |
| message | No | For 'sms'/'whatsapp': message text. | |
| version | No | Force a QR version (size). Omit to use the smallest that fits. | |
| location | No | For 'event': location. | |
| password | No | For payloadKind 'wifi': network password. | |
| username | No | For 'telegram': username or t.me URL. | |
| description | No | For 'event': description. | |
| payloadKind | Yes | What the code should contain. 'qart_code' sizes the retargetable variant — a 16-byte qart.uk/_ link instead of your data. whatsapp/telegram/event/social kinds assemble a standard URL or VCALENDAR; they are verbatim, not retargetable. |