生成自定义二维码

POST /custom

本接口代理 QR Code Monkey API,支持高度自定义的二维码生成,包括形状、颜色、Logo、渐变等。

请求格式

Content-Type: application/json

{
  "data": "https://example.com",
  "size": 300,
  "config": {
    "body": "square",
    "eye": "frame0",
    "eyeBall": "ball0",
    "bodyColor": "#000000",
    "bgColor": "#ffffff",
    "eye1Color": "#000000",
    "eye2Color": "#000000",
    "eye3Color": "#000000",
    "logo": "",
    "logoMode": "default"
  },
  "file": "png",
  "download": false
}
请求参数说明
参数类型说明
datastring二维码内容(URL、文本等)
sizenumber图片尺寸(像素),范围 100-2000
filestring输出格式:png / svg / pdf / eps
downloadboolean是否强制下载
config.bodystring数据点形状:square / circle / dot / mosaic / rounded-pointed / star / diamond
config.eyestring定位点外框:frame0 ~ frame14
config.eyeBallstring定位点中心:ball0 ~ ball16
config.*Colorstring颜色值(HEX 格式,如 #000000)
响应格式

成功时返回二维码图片(二进制),Content-Type 根据 file 参数决定。

HTTP/1.1 200 OK
Content-Type: image/png

[二进制图片数据]
错误响应
HTTP/1.1 500 Internal Server Error
使用示例 (cURL)
curl -X POST https://qr.abencat.bond/custom \
  -H "Content-Type: application/json" \
  -d '{"data":"https://example.com","size":300,"config":{"body":"circle","bodyColor":"#15a97c","bgColor":"#ffffff"},"file":"png"}' \
  --output qrcode.png