跳转到内容
Local API代理管理

获取代理列表 ​

版本概览
GET
/api/v1/proxies

分页返回当前用户、当前团队有权访问的代理。支持 custom、api、integ、syt 四种模式;API 代理配置包含 auth_type(whitelist 默认白名单或 credential 账密认证)以及对应用户名和密码。password 与 API 提取地址属于敏感字段,不应写入调用方日志。

请求参数

Authorization Bearer Token

在请求头 Authorization 中使用 Bearer Token 传入 API Key。

Authorization: Bearer <api-key>

Query 参数

10
字段说明
integer
页码
默认值1
示例值1
minimum: 1
integer
每页数量,默认 10,最大 100
默认值10
示例值10
minimum: 1maximum: 100
string
按代理 ID 模糊筛选
minLength: 1
string
按代理名称模糊筛选
minLength: 1
string
按代理备注模糊筛选
minLength: 1
string
按代理模式筛选。代理模式:custom 表示自定义代理;api 表示通过提取地址获取的代理;integ 表示集成代理;syt 表示四叶天同步代理
枚举值
string
按代理协议筛选。代理协议:http 表示 HTTP;https 表示 HTTPS;socks5 表示 SOCKS5
枚举值
string
按最近一次代理检测状态筛选。代理检测状态:unchecked 表示尚未检测;available 表示最近一次检测可用;unavailable 表示最近一次检测不可用
枚举值
string
按是否过期筛选:true 表示已过期;false 表示未过期或没有有效期;主要用于 integ 和 syt 代理
枚举值
string
排序字段和方向:name 表示名称,created_at 表示创建时间,updated_at 表示更新时间,checked_at 表示最近检测时间;asc 表示升序,desc 表示降序
枚举值

请求示例代码

JavaScript / TypeScript 使用 Node.js 18+ 内置 fetch;PHP 需启用 cURL 扩展;Go 需 1.16+;Java 需 JDK 11+。运行前请替换 Token 和示例参数值。

curl -H 'Authorization: Bearer <TOKEN>' 'http://local.zhongyibrowser.com:39025/api/v1/proxies?page=1&size=10'

返回响应

成功时 code = 0,失败时 code > 0。选择状态码查看对应字段和示例,展开对象可查看嵌套字段;可选字段可能不返回。

代理列表

Body

application/jsonProxyListSuccessResponse
字段说明
number必填
业务状态码;成功固定为 0
枚举值
string必填
业务状态信息;成功固定为 success
枚举值
object必填
接口业务数据

不允许额外字段。

示例

根据数据模型生成,非实际请求结果。

{
  "code": 0,
  "message": "success",
  "data": {
    "items": [
      {
        "id": "string",
        "name": "string",
        "remark": "string",
        "status": "unchecked",
        "checked_at": "2024-01-15T09:30:00Z",
        "browser_count": 0,
        "is_expired": true,
        "created_at": "2024-01-15T09:30:00Z",
        "updated_at": "2024-01-15T09:30:00Z",
        "mode": "custom",
        "config": {
          "protocol": "http",
          "ip_protocol": "ipv4",
          "host": "string",
          "port": 0,
          "username": "string",
          "password": "string"
        }
      }
    ],
    "total": 0,
    "page": 0,
    "size": 0,
    "total_pages": 0
  }
}

查看全部业务错误码与 HTTP 状态码

中屹浏览器 Local API 文档