Skip to content

REST API 参考

Base URL: https://api.sybilslayer.com/api/v1

所有请求需在 Header 中携带认证令牌(除 /system/health 外):

Authorization: Bearer <token>

System

GET /system/health

健康检查(无需认证)。

Response:

json
{ "status": "ok", "timestamp": "2026-02-11T10:00:00.000Z" }

GET /system/countries

获取可用国家/地区列表及资源统计。

Response:

json
{
  "countries": [
    {
      "code": "JP",
      "fingerprints": 150,
      "proxies": 50,
      "proxies_available": 45
    }
  ]
}

GET /system/version

获取各客户端版本信息(Desktop、Chrome)。

Response:

json
{
  "versions": {
    "windows": {
      "version": "1.0.34",
      "download_url": "...",
      "release_notes": "...",
      "released_at": "..."
    },
    "chrome": {
      "version": "1.0.12",
      "download_url": "..."
    }
  }
}

Auth

POST /auth/login

用户名密码登录。

Request Body:

json
{
  "username": "alice",
  "password": "secret123"
}

Response:

json
{
  "token": "64位hex",
  "user": {
    "id": 1,
    "username": "alice",
    "email": "alice@example.com",
    "status": "active"
  },
  "quota": {
    "total": 100,
    "used": 5,
    "remaining": 95
  }
}

User

GET /user/profile

获取当前用户信息和配额。

Response:

json
{
  "user": {
    "id": 1,
    "username": "alice",
    "email": "alice@example.com",
    "status": "active"
  },
  "quota": {
    "total": 100,
    "used": 5,
    "remaining": 95
  },
  "stats": {
    "environments": 5,
    "tokens": 2
  }
}

Environment

POST /env/create

创建新的浏览器环境。

Request Body:

json
{
  "country": "JP",
  "name": "my-environment",
  "platform": "windows",
  "note": "测试环境"
}
参数类型必填说明
countrystring国家代码 (JP, US, KR 等)
namestring环境名称
platformstring平台类型
notestring备注

Response:

json
{
  "env_id": "env_abc123",
  "country": "JP",
  "proxy": "socks5://user:pass@ip:port",
  "quota_remaining": 94,
  "profile": { "profileId": "...", "envId": "...", "base": { ... } }
}

GET /env/list

分页获取环境列表。

Query Parameters: page (default: 1), limit (default: 20)

Response:

json
{
  "environments": [
    {
      "env_id": "env_abc123",
      "name": "my-env",
      "country": "JP",
      "proxy": "...",
      "status": "active",
      "created_at": "..."
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 50,
    "pages": 3
  }
}

GET /env/:env_id

获取单个环境详情(包含完整 profile)。

DELETE /env/:env_id

删除指定环境。

Response:

json
{ "message": "Environment deleted" }

POST /env/:env_id/refresh-proxy

刷新环境代理。

Request Body (可选):

json
{ "reason": "proxy_failed" }

Response:

json
{
  "env_id": "env_abc123",
  "country": "JP",
  "proxy": "socks5://new-proxy:port"
}

POST /env/:env_id/report-proxy-dead

上报代理失效。

Request Body:

json
{
  "consecutive_failures": 3,
  "reason": "timeout"
}

Download

GET /download/client

下载 Desktop 客户端(自动检测最新版本)。

GET /download/chrome

下载 Chrome 内核(自动检测最新版本)。

GET /download/chrome/info

获取 Chrome 内核版本信息(不下载)。


Admin

WARNING

以下接口需要管理员权限的 Token。

GET /admin/users

分页获取用户列表。

Query Parameters: page, limit

POST /admin/users

创建新用户。

Request Body:

json
{
  "username": "alice",
  "email": "alice@example.com",
  "password": "optional-password",
  "quota_total": 20
}

GET /admin/tokens

分页获取 Token 列表。

POST /admin/tokens

创建新 Token。

Request Body:

json
{
  "user_id": 1,
  "name": "ci-key",
  "expires_in_days": 90
}

DELETE /admin/tokens/:id

撤销指定 Token。

GET /admin/proxies

获取代理列表。

Query Parameters: country, status, limit

GET /admin/proxies/stats

获取代理统计信息(总量、可用、按国家分组、补货建议)。

POST /admin/proxies/recheck

批量重新检查代理健康状态。

Request Body:

json
{
  "country": "JP",
  "limit": 50
}

POST /admin/proxies/import-csv

CSV 格式批量导入代理。

Request Body:

json
{
  "csv": "JP,socks5://1.2.3.4:1080\nUS,http://5.6.7.8:8080",
  "default_country": "US"
}

POST /admin/proxies/import

JSON 格式批量导入代理。

Request Body:

json
{
  "items": [
    { "country": "JP", "proxy_url": "socks5://1.2.3.4:1080" }
  ]
}

POST /admin/templates/import

批量导入指纹模板。

POST /admin/fingerprints/import

批量导入指纹数据。

GET /admin/fingerprints/stats

获取指纹统计信息。

GET /admin/country-matrix

获取国家就绪矩阵(模板 + 代理可用性)。

Response:

json
{
  "min_templates_per_country": 100,
  "templates_total": 5000,
  "proxies_total": 150,
  "countries": [
    {
      "code": "JP",
      "fingerprints": 500,
      "proxies_available": 45,
      "ok_templates": true,
      "ok_proxies": true,
      "ok": true
    }
  ]
}

Linege Anti-Browser Documentation