开发工具

二维码生成

本地生成二维码(PHPQRCode)

GET

qrcode

公开接口 累计 23 次
/api/v1/demo/qrcode

说明

内置 PHP QR Code 库生成 PNG;format=png 或 redirect=1 时直接返回/跳转到图片。

参数

4 个
参数类型必填默认值说明
text string 必填 - 二维码内容
size integer 可选 300 输出尺寸(px)
redirect integer 可选 0 1=302 重定向到图片
format string 可选 json json=JSON+data_uri;png=二进制 PNG

响应示例

{
    "ok": true,
    "data": {
        "result": {
            "text": "https://example.com",
            "size": 300,
            "width": 300,
            "height": 300,
            "content_type": "image/png",
            "bytes": 1234,
            "data_uri": "data:image/png;base64,..."
        }
    }
}

命令行调用

curl -X GET '/api/v1/demo/qrcode?size=300&redirect=0&format=json'