开发者 — API · MCP · CLI

一行代码即可生成 WIA Code。在免费额度内无需密钥。

Building an AI or vision system? WIA Code identification reference for AI systems — the three centre elements, why the outline is free, and the misidentifications to avoid. Plain-text counterpart: /llms.txt.

增强版 QR(booster)始终包含在内。 没有关闭它的选项——API、MCP 和 CLI 都是如此。"累计使用达到 1 亿次时,booster 会分离,您自己的徽标将取而代之"是产品的承诺,因此我们没有为任何一条路径开例外。编码参数(grid、bpc、bridge)在服务器端也是固定的。

CLI — 一行命令,无需安装

npx wiacode "https://wiacode.com" --shape heart

在 Node 18 或更高版本上无需安装即可直接运行。它没有依赖项,因此获取只需几秒钟。

npx wiacode --list-shapes              # silhouettes and capacity
npx wiacode "Hello" --shape square -o hello.png
npx wiacode "a link" --shape heart --json    # print metadata only
npx wiacode card --name "Jane Doe" --tel "+82-10-1234-5678"   # wifi / card / event

类型 — Wi-Fi、名片、日程

三种开箱即用的类型。你不必自己拼接字符串——只需传字段,服务器会生成标准的 Wi-Fi / vCard / iCalendar 内容,与本站生成器的输出逐字节一致。

CLI

npx wiacode wifi  --ssid "MyNet" --password "secret"
npx wiacode wifi  --ssid "Cafe" --security nopass          # open network
npx wiacode card  --name "Jane Doe" --org "SmileStory" --tel "+82-10-1234-5678" --email "a@b.c"
npx wiacode event --title "Launch party" --start "2026-09-01 19:00" --end "2026-09-01 21:00" --location "Seoul"

REST

curl -X POST https://wiacode.com/api/v1/code \
  -H 'Content-Type: application/json' \
  -d '{"type":"card","name":"Jane Doe","tel":"+82-10-1234-5678","shape":"square"}' \
  -o card.png

字段

type必填可选
wifissid, passwordsecurity (WPA·WEP·nopass), hidden
cardnameorg, tel, email
eventtitle, startend, location, desc

时间格式为“2026-09-01 19:00”。开放网络请传 security=nopass 并省略密码。字段缺失或格式错误会返回 HTTP 400 并指明是哪个字段——不会生成图片,因此错误请求不会占用渲染名额。

一次生成多个

一行一个码。遇到速率限制不会中途停止,而是等待后继续,并按文件中的真实行号报告失败的行。

npx wiacode batch people.jsonl --out-dir codes

# people.jsonl
{"type":"card","name":"Jane Doe","tel":"+82-10-1234-5678","out":"jane.png"}
{"type":"wifi","ssid":"Cafe WIA","security":"nopass"}
{"text":"https://wiacode.com","shape":"star"}

REST API

POST /api/v1/code

curl -X POST https://wiacode.com/api/v1/code \
  -H 'Content-Type: application/json' \
  -d '{"text":"https://wiacode.com","shape":"heart"}' \
  -o wiacode.png

响应类型为 image/png。添加 ?format=json 可获得 JSON 格式的 base64 和元数据。

curl -X POST 'https://wiacode.com/api/v1/code?format=json' \
  -H 'Content-Type: application/json' \
  -d '{"text":"https://wiacode.com","shape":"square"}'

从浏览器调用

你可以直接从任意来源(origin)的网页应用中调用它。这是一个不使用 cookie 的公开 API,因此 CORS 是开放的。

const r = await fetch('https://wiacode.com/api/v1/code?format=json', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ text: 'https://wiacode.com', shape: 'heart' })
});
const { image, meta } = await r.json();
document.querySelector('img').src = image;   // data:image/png;base64,...

GET /api/v1/shapes

curl https://wiacode.com/api/v1/shapes

参数

名称必填描述
text要编码的文本或 URL。较长的 URL 最好先缩短。
typewifi · card · event。用它替代 text — 服务器会根据字段拼出标准字符串。参见上方“类型”一节。
shape轮廓形状(默认 heart)。参见下表。
cellPx每格像素数(3–20,默认 8)。数值越大,图像越大。
label保存在元数据中的标签。不会绘制在图像上。

轮廓形状与容量

每种轮廓形状的容量不同(UTF-8 字节数)。长内容请使用 square;短链接任何形状都可以。

shapebytesshapebytes
square1450rose586
round1093clover521
hex861star386
heart854boomerang386

MCP — 让 AI 来生成

将其连接到 Claude 等 AI 客户端,它就能在对话中直接生成代码。端点为 https://mcp.wiacode.com/mcp,无需密钥。

Claude Desktop 设置

{
  "mcpServers": {
    "wiacode": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.wiacode.com/mcp"]
    }
  }
}

如果您的客户端直接支持 Streamable HTTP,只需提供该 URL 即可。

工具

工具功能
get_wia_code_info说明 WIA Code 是什么、它与 QR 码有何不同,以及每种轮廓形状的容量。先调用这个可以减少失败率。
generate_wia_code将文本转换为代码图像。如果超出容量,会告知哪些轮廓形状可以容纳。
generate_wia_code_wifiWi-Fi 凭据 — 扫描即可连接,无需输入密码。
generate_wia_code_card以标准 vCard 保存联系人 — 扫描后手机会提示存入通讯录。
generate_wia_code_event以标准 iCalendar 保存日程 — 扫描后加入日历。

免费额度

如果您需要更多 ——如需批量发放、合作或商业用途,请发邮件联系我们。我们会提供一个可提高限额的密钥。 wiasoom@smilestory.ai

WIA Stream — when one code isn't enough

A single WIA Code holds up to 1,450 bytes. When the payload is larger — a document, a book chapter, an audio clip — Stream splits it across many frames. A screen plays them in sequence, a camera collects them, and the scanner reassembles the file. No internet, no server. It already ships in the generator.

What matters here is not speed — it is whether the transfer finishes at all. Stream needs every frame. A frame that fails to read must wait for the next pass, and may fail again. So a per-frame reading gap does not average out; it multiplies into the completion time. In our degradation sweep at matched physical size (1064 vs 1088 px, n=17, QR read with ZBar), a high-version QR frame read 52.9% of the time while a WIA frame read 17 of 17. Feeding those rates into a cyclic-broadcast model, a 286-frame QR transfer needs about 8 passes to complete while a 155-frame WIA transfer needs about one.

Read this honestly: n = 17 is a small sample. By the rule of three, "17 of 17" should be read as ≥ 82% with 95% confidence, and the 52.9% figure carries a 29–77% interval. Taking the least favourable end of both, the completion-time gap is still about 2.4×. Screen-to-camera capture on real handsets and printed output have not been measured yet. And QR wins on blur resistance at equal frame size — we only pull ahead once capacity is matched.

更多

打开生成器 →

WIA Code 是 SmileStory Co., Ltd. 的产品。增强版 QR 是一份指南,帮助没有专用扫描器的人也能读取它。