OPEN API · V1 COMPATIBLE
不是黑盒,是一套好用的接口。
沿用原有接口地址与核心字段,方便已有脚本平滑迁移。以下示例默认站点地址为 https://next.zxso.net。
API
v1stable
v1stable
生成二维码
/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!。
识别二维码
/api/deqrcodeapplication/json
curl -X POST -F "file=@qrcode.png" https://next.zxso.net/api/deqrcode
{
"code": 200,
"msg": "成功",
"text": "二维码中的内容"
}
支持 PNG/JPG,单文件最大 2 MB。图片只在当前请求中处理。
编码转换
/api/strtohexstr → hex/api/hextostrhex → str/api/unicode/encode中文 → Unicode/api/unicode/decodeUnicode → 中文/api/domainencode域名 → Punycode/api/domaindecodePunycode → 域名/api/batchbase64批量 Base64curl -X POST -d "str=风雪" https://next.zxso.net/api/strtohex
{"code":200,"msg":"success","str":"风雪","hex":"e9a38ee99baa"}