| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| msg | string | 是 | 二维码内容(网址、文本等),支持任意字符串。 | https://xiaoapi.cn |
| size | integer | 否 | 二维码矩阵点大小,值越大二维码越精细(建议 1~10)。 | 8 |
| margin | integer | 否 | 二维码内部的静区(留白)宽度,单位:像素点。 | 3 |
| fgcolor | string | 否 | 前景色,即二维码模块(黑色方块)的颜色。支持十六进制(可省略 # 或使用 %23 编码)。 | %23FFCCCC |
| bgcolor | string | 否 | 背景色,二维码空白区域的颜色。同样支持十六进制(可省略 # 或编码)。 | %23800080 |
| border | integer | 否 | 外边框宽度(像素),设为 0 表示无边框。 | 3 |
| bordercolor | string | 否 | 外边框的颜色(当 border>0 时生效),支持十六进制(可省略 # 或编码)。 | %2300FF00 |
| radius | integer | 否 | 二维码圆角半径(像素),设为 0 表示直角。注意:半径过大会破坏定位图案,影响扫码识别,建议 ≤15。 | 10 |
[
{
"name": "msg",
"type": "string",
"required": true,
"description": "二维码内容(网址、文本等),支持任意字符串。",
"example": "https://xiaoapi.cn"
},
{
"name": "size",
"type": "integer",
"required": false,
"description": "二维码矩阵点大小,值越大二维码越精细(建议 1~10)。",
"example": "8"
},
{
"name": "margin",
"type": "integer",
"required": false,
"description": "二维码内部的静区(留白)宽度,单位:像素点。",
"example": "3"
},
{
"name": "fgcolor",
"type": "string",
"required": false,
"description": "前景色,即二维码模块(黑色方块)的颜色。支持十六进制(可省略 # 或使用 %23 编码)。",
"example": "%23FFCCCC"
},
{
"name": "bgcolor",
"type": "string",
"required": false,
"description": "背景色,二维码空白区域的颜色。同样支持十六进制(可省略 # 或编码)。",
"example": "%23800080"
},
{
"name": "border",
"type": "integer",
"required": false,
"description": "外边框宽度(像素),设为 0 表示无边框。",
"example": "3"
},
{
"name": "bordercolor",
"type": "string",
"required": false,
"description": "外边框的颜色(当 border>0 时生效),支持十六进制(可省略 # 或编码)。",
"example": "%2300FF00"
},
{
"name": "radius",
"type": "integer",
"required": false,
"description": "二维码圆角半径(像素),设为 0 表示直角。注意:半径过大会破坏定位图案,影响扫码识别,建议 ≤15。",
"example": "10"
}
]
{
"openapi": "3.1.1",
"info": {
"title": "二维码生成",
"description": "提供一串文字或者一个url即可生成一个简单实用的二维码。",
"version": "1.0.0"
},
"paths": {
"/v1/zs_ewm.php": {
"get": {
"summary": "二维码生成",
"description": "提供一串文字或者一个url即可生成一个简单实用的二维码。",
"parameters": [
{
"name": "msg",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "https://xiaoapi.cn"
},
"description": "二维码内容(网址、文本等),支持任意字符串。"
},
{
"name": "size",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"example": 8
},
"description": "二维码矩阵点大小,值越大二维码越精细(建议 1~10)。"
},
{
"name": "margin",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"example": 3
},
"description": "二维码内部的静区(留白)宽度,单位:像素点。"
},
{
"name": "fgcolor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "%23FFCCCC"
},
"description": "前景色,即二维码模块(黑色方块)的颜色。支持十六进制(可省略 # 或使用 %23 编码)。"
},
{
"name": "bgcolor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "%23800080"
},
"description": "背景色,二维码空白区域的颜色。同样支持十六进制(可省略 # 或编码)。"
},
{
"name": "border",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"example": 3
},
"description": "外边框宽度(像素),设为 0 表示无边框。"
},
{
"name": "bordercolor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "%2300FF00"
},
"description": "外边框的颜色(当 border>0 时生效),支持十六进制(可省略 # 或编码)。"
},
{
"name": "radius",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"example": 10
},
"description": "二维码圆角半径(像素),设为 0 表示直角。注意:半径过大会破坏定位图案,影响扫码识别,建议 ≤15。"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "二维码生成",
"description": "提供一串文字或者一个url即可生成一个简单实用的二维码。",
"parameters": [
{
"name": "msg",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "https://xiaoapi.cn"
},
"description": "二维码内容(网址、文本等),支持任意字符串。"
},
{
"name": "size",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"example": 8
},
"description": "二维码矩阵点大小,值越大二维码越精细(建议 1~10)。"
},
{
"name": "margin",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"example": 3
},
"description": "二维码内部的静区(留白)宽度,单位:像素点。"
},
{
"name": "fgcolor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "%23FFCCCC"
},
"description": "前景色,即二维码模块(黑色方块)的颜色。支持十六进制(可省略 # 或使用 %23 编码)。"
},
{
"name": "bgcolor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "%23800080"
},
"description": "背景色,二维码空白区域的颜色。同样支持十六进制(可省略 # 或编码)。"
},
{
"name": "border",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"example": 3
},
"description": "外边框宽度(像素),设为 0 表示无边框。"
},
{
"name": "bordercolor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "%2300FF00"
},
"description": "外边框的颜色(当 border>0 时生效),支持十六进制(可省略 # 或编码)。"
},
{
"name": "radius",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"example": 10
},
"description": "二维码圆角半径(像素),设为 0 表示直角。注意:半径过大会破坏定位图案,影响扫码识别,建议 ≤15。"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://xiaoapi.cn",
"description": "当前访问入口(https)"
}
]
}
图片资源
暂无详细文档
暂无代码示例。管理员可在后台用 AI 生成或手动编写。
// 结果将在此处显示
生效日期:2026年7月22日
欢迎使用 xiaoapi.cn(以下简称"本平台")。在使用本平台提供的 API 服务(以下简称"本服务")前,请务必仔细阅读并充分理解本免责声明。您以任何方式调用、访问或使用本服务,即视为您已阅读、理解并同意接受本声明的全部内容。
本平台作为 API 技术服务的提供方,仅提供技术接口与数据分发服务。本声明的目的在于明确平台与用户之间的责任边界,督促用户合法、合规地使用本服务,防范违法违规行为的发生。
用户在使用本服务时,明确禁止从事以下行为:
在法律法规允许的最大范围内,本平台对以下情形不承担责任:
因用户违反本声明或相关法律法规,导致本平台及其关联方、合作方遭受任何损失(包括但不限于赔偿款、罚款、律师费、诉讼费等),用户同意向本平台及相关方承担全部赔偿责任。
本平台有权根据法律法规变化、业务调整或监管要求,随时修改本声明。修改后的声明将在本页面公布,自公布之日起生效。您继续使用本服务,即视为接受更新后的声明。
如您对本声明有任何疑问,或发现他人存在违规使用本服务的行为,欢迎通过本平台公示的联系方式与我们联系,我们将及时处理。