API 文档

提示: 使用 API 前需要先在 API 管理 页面创建 Token

基础信息

Base URL https://qr.mm64.cn/api/v1
认证方式 Bearer Token
请求格式 JSON
响应格式 JSON

1. 生成二维码

POST /api/v1/qrcode/generate

请求示例:
curl -X POST https://qr.mm64.cn/api/v1/qrcode/generate \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "https://example.com",
    "type": "static",
    "options": {
      "size": 500,
      "title": "示例网站"
    }
  }'
响应示例:
{
  "code": 200,
  "message": "生成成功",
  "data": {
    "id": 123,
    "short_code": "abc123XY",
    "url": "https://qr.mm64.cn/qr/abc123XY",
    "image": "https://qr.mm64.cn/storage/qrcodes/202311/abc123XY.png"
  }
}

2. 查询二维码

GET /api/v1/qrcode/{shortCode}

请求示例:
curl -X GET https://qr.mm64.cn/api/v1/qrcode/abc123XY \
  -H "Authorization: Bearer YOUR_API_TOKEN"

3. 删除二维码

DELETE /api/v1/qrcode/{shortCode}

请求示例:
curl -X DELETE https://qr.mm64.cn/api/v1/qrcode/abc123XY \
  -H "Authorization: Bearer YOUR_API_TOKEN"
速率限制

默认限制:100 次/小时

超出限制将返回 429 Too Many Requests