API 文檔 v1

支持單個鏈接生成、批量生成、小程式短鏈、二維碼生成。

接口說明
  • 接口地址:https://suo.run/api/v1
  • 請求方式:POST
  • 內容類型:application/json
  • 響應結構:code / msg / data
  • 認證方式:API Key ( 創建 API Key
示例請求頭
Content-Type: application/json
X-API-Key: 你的APIKey
POST /api/v1/generate 生成短鏈接
參數說明
參數 說明
url 原始鏈接
expire 有效期天數
custom_code 自定義短碼
password 訪問密碼
ua_stay 訪問平台策略
ua_plan 訪問平台白名單
site_id 短域名配置 ID
示例請求
{
  "url": "https://example.com",
  "expire": 7,
  "custom_code": "",
  "password": "",
  "ua_stay": 0,
  "ua_plan": ["IOS","Android","PC","other"],
  "site_id": 1
}
示例響應
{
  "code": 1,
  "msg": "success",
  "data": {
    "original_url": "https://example.com",
    "short_url": "http://j58s.298.run",
    "short_code": "j58s",
    "expire_time": "2026-02-13 00:15:25",
    "site_url": "j58s.298.run"
  }
}
POST /api/v1/batchGenerate 批量生成短鏈接
參數說明
參數 說明
urls URL 列表(最多 100 條)
expire 有效期天數
password 訪問密碼
ua_stay 訪問平台策略
ua_plan 訪問平台白名單
site_id 短域名配置 ID
示例請求
{
  "urls": [
    "https://example.com/a",
    "https://example.com/b"
  ],
  "expire": 7,
  "password": "",
  "ua_stay": 0,
  "ua_plan": ["IOS","Android","PC","other"],
  "site_id": 1
}
示例響應
{
  "code": 1,
  "msg": "success",
  "data": {
    "results": [
      {
        "original_url": "https://example.com/a",
        "short_url": "http://bf63sr.298.run",
        "site_url": "bf63sr.298.run"
      },
      {
        "original_url": "https://example.com/b",
        "short_url": "http://3yj2oy.298.run",
        "site_url": "3yj2oy.298.run"
      }
    ],
    "expire_time": "2026-02-13 00:05:11",
    "errors": [],
    "total": 2,
    "success_count": 2,
    "error_count": 0
  }
}
POST /api/v1/miniApp 生成小程式短鏈
參數說明
參數 說明
appid 小程式 AppID
appsecret 小程式 AppSecret
page 小程式頁面路徑(支持 ?query)
expire 有效期天數
custom_code 自定義短碼
password 訪問密碼
ua_stay 訪問平台策略
ua_plan 訪問平台白名單
site_id 短域名配置 ID
示例請求
{
  "appid": "小程式 AppID",
  "appsecret": "小程式 AppSecret",
  "page": "pages/index",
  "expire": 7,
  "custom_code": "",
  "password": "",
  "ua_stay": 0,
  "ua_plan": ["IOS","Android","PC","other"],
  "site_id": 1
}
示例響應
{
  "code": 1,
  "msg": "success",
  "data": {
    "original_url": "weixin://dl/business/?t=Sctv5oaz0Id",
    "short_url": "http://vmei.298.run",
    "short_code": "vmei",
    "expire_time": "2026-02-13 00:15:31",
    "site_url": "vmei.298.run"
  }
}
POST /api/v1/qcodeGenerate 二維碼生成
參數說明
參數 說明
url 原始鏈接
expire 有效期天數
custom_code 自定義短碼
password 訪問密碼
ua_stay 訪問平台策略
ua_plan 訪問平台白名單
site_id 短域名配置 ID
示例請求
{
  "url": "https://example.com",
  "expire": 7,
  "custom_code": "",
  "password": "",
  "ua_stay": 0,
  "ua_plan": ["IOS","Android","PC","other"],
  "site_id": 1
}
示例響應
{
  "code": 1,
  "msg": "success",
  "data": {
    "original_url": "https://example.com",
    "short_url": "http://8fw6.298.run",
    "short_code": "8fw6",
    "expire_time": "2026-02-13 00:15:32",
    "site_url": "8fw6.298.run",
    "qr_url": "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=http%3A%2F%2F8fw6.298.run"
  }
}