OPEN API · V1 COMPATIBLE

不是黑盒,是一套好用的接口。

沿用原有接口地址与核心字段,方便已有脚本平滑迁移。以下示例默认站点地址为 https://next.zxso.net。

API
v1stable
GET

生成二维码

/api/qrcodeimage/png

curl "https://next.zxso.net/api/qrcode?text=hello&w=8&el=q" --output qrcode.png
参数必填类型说明
text是string二维码内容
w否float模块像素大小,范围 2–24,默认 5.34
of否int静区边框数量,默认 2
el否h/q/m/l纠错等级,默认 q
bg否hex背景色,例如 ffffff
fg否hex前景色,例如 000000

成功时直接返回 PNG;内容为空时返回文本 get input text!。

POST

识别二维码

/api/deqrcodeapplication/json

curl -X POST -F "file=@qrcode.png" https://next.zxso.net/api/deqrcode
{
  "code": 200,
  "msg": "成功",
  "text": "二维码中的内容"
}

支持 PNG/JPG,单文件最大 2 MB。图片只在当前请求中处理。

POST

编码转换

/api/strtohexstr → hex
/api/hextostrhex → str
/api/unicode/encode中文 → Unicode
/api/unicode/decodeUnicode → 中文
/api/domainencode域名 → Punycode
/api/domaindecodePunycode → 域名
/api/batchbase64批量 Base64
curl -X POST -d "str=风雪" https://next.zxso.net/api/strtohex

{"code":200,"msg":"success","str":"风雪","hex":"e9a38ee99baa"}