一、环境接口详情
GET 获取环境列表
GET /v1/env/list
请求参数
| 名称 | 类型 | 必选 | 说明 |
| page_no | integer | 是 | 页码,默认1 |
| page_size | integer | 是 | 分页大小,默认10 |
| serial_num | integer | 否 | 序号 |
| value | string | 否 | 序号/名称/备注 |
| name | string | 否 | 名称 |
| group_id | string | 否 | 分组 |
| group_ids | [string] | 否 | 分组ids |
| proxy_type | string | 否 | 代理类型(方式1) (NON_USE:不使用 HTTP HTTPS SSH SOCKS5 IPFLY) |
| proxy_host | string | 否 | 代理主机(方式1) |
| out_ip | string | 否 | 出口IP |
| status | string | 否 | 状态(DISABLED停用 ENABLED正常) |
| platform_user | string | 否 | 平台 |
| platform | string | 否 | 平台类型 |
| remark | string | 否 | 备注 |
| start_create_time | string | 否 | 开始时间 |
| end_create_time | string | 否 | 结束时间 |
| start_last_open_time | string | 否 | 最后打开开始时间 |
| end_last_open_time | string | 否 | 最后打开结束时间 |
| operate_status | string | 否 | 环境打开状态 ENABLED 打开,DISABLED 关闭 |
| share | boolean | 否 | 是否分享环境 |
| order_by | string | 否 | 排序字段 环境字段 ENV_SERIAL_NUM,环境名称 ENV_NAME,备注 ENV_REMARK,最近打开时间 ENV_LAST_OPEN_TIME, 最近创建时间 ENV_CREATE_TIME, 排序 SORT |
| sort | string | 否 | 排序方式 ASC DESC |
| env_tag_list_type | string | 否 | CONTAIN 包含标签 EQUALS 等于标签 |
| env_tag_ids | [string] | 否 | 标签ids——匹配一个即可查询出结果 |
相应参数
| 名称 | 类型 | 说明 |
| id | string | 环境id,env_id |
| create_time | string | 创建时间 |
| update_time | string | 修改时间 |
| serial_num | integer | 序号 |
| group_id | string | 分组ID |
| group_ids | [string] | 分组IDs |
| groups | [EnvGroupVO] | 分组集合 |
| group_name | string | 分组名称 |
| name | string | 名称 |
| browser | string | 浏览器类型 (CHROME:Chrome) |
| ua_type | string | ua类型 |
| ua | string | User Agent |
| ua_os | string | User Agent OS WINDOWS/MAC/ANDROID/IOS/LINUX |
| cookie | string | cookie |
| other_cookie | string | 其它cookie |
| proxy_way | string | 代理方式 (CUSTOM:自定义 SELECT_EXIST:选择已有) |
| proxy_id | string | 代理ID(方式2) |
| proxy_type | string | 代理类型(方式1) (NON_USE:不使用 HTTP HTTPS SSH SOCKS5 IPFLY) |
| proxy_host | string | 代理主机(方式1) |
| proxy_port | integer(int32) | 代理端口(方式1) |
| proxy_user_name | string | 代理账号(方式1) |
| proxy_passwd | string | 代理密码(方式1) |
| proxy_ip_type | string | IP查询渠道(方式1) (IP2LOCATION) |
| proxy_soft_enable | boolean | 代理类型(方式3) 代理服务商是否读取配置账户(true:是false:否) |
| proxy_api_info | ProxyApiInfoVO | 代理api链接信息 |
| urls | [string] | url列表 |
| fixed_urls | [string] | 固定url列表 |
| be_top | boolean | 是否置顶 true 置顶 false没置顶 |
| browser_version_id | string | 浏览器内核版本ID |
| sort | string | 排序值 |
| env_tag_list | [EnvTagListVO] | 标签信息 |
| config | string | 高级设置JSON |
| status | string | 状态(DISABLED停用 ENABLED正常) |
| remark | string | 备注 |
| last_open_time | string | 最近打开时间 |
| operate_status | string | 操作状态 DISABLED关闭 ENABLED启用 LOCK锁定 |
| account_list | [object] | 账号 |
| font_id | string | 字体id |
| local_data_config | string | 本地数据设置 |
| env_data_sync | string | 数据同步限制 |
| data_config | string | 数据配置 |
| browser_config | string | 浏览器配置 |
| env_mutil_open_type | string | 环境多开: GLOBAL:全局 ALLOW:允许 BAN:禁止 |
| spoofing_video_type | string | 视频替换: DEFAULT :默认 ENALBLE :开启 DISABLE:关闭 |
| restore_url_type | string | 还原URL: GLOBAL:全局 RESTORE:还原 NOT_RESTORE:不还原 |
| operate_members | [object] | 当前环境操作人信息 |
| config_ext_map | object | 扩展字段 |
| share_number | integer(int32) | 环境分享数量 |
| extensions_groupId | string | 扩展分组Id |
| extensions_list | [object] | 扩展集合 |
| bookmark_config | string | 书签配置详情 |
| access_limit_config | string | 访问限制配置详情 |
| total | integer(int32) | 总条数 |
响应示例(Python)
{
"code": 0,
"msg": "success",
"data": {
"list": [
{
"id": "1848687666096832515",
"create_time": "2024-10-22 19:27:41",
"update_time": "2024-10-23 21:28:15",
"serial_num": 166,
"group_id": "1776895967565094913",
"group_name": null,
"name": "env——name",
"browser": "CHROME",
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6005.0 Safari/537.36",
"ua_os": "MAC",
"cookie": "",
"other_cookie": null,
"urls": [
],
"status": "ENABLED",
"remark": null,
"last_open_time": "2024-10-23 21:26:15",
"operate_status": "DISABLED",
"account_list": null,
"font_id": "",
"data_config": "{\"type\":25,\"dataType\":\"custom\"}",
"browser_config": "{\"type\":1,\"browserType\":\"custom\"}",
"env_mutil_open_type": "GLOBAL",
"config_ext_map": null
}
],
"total": 65
}
}
PATCH 打开环境
PATCH /v1/env/{env_id}/open
请求参数
| 名称 | 类型 | 必选 | 说明 |
| env_id | string | 是 | 环境ID,对应列表中的id |
Body传参
| 名称 | 类型 | 必选 | 说明 |
| headless | boolean | 否 | 传true为无头,传false或不传皆为正常打开 |
响应参数
| 名称 | 类型 | 必选 | 说明 |
| serial_number | integer(int32) | 是 | 环境序号 |
| pid | string | 是 | 环境的进程id |
| debug_port | integer | 是 | 环境端口 |
响应示例(Python)
{
'code': 0,
'msg': 'success',
'data': {
'serial_number': 2,
'pid': '27028',
'debug_port': 17539
}
}
PATCH 关闭环境
PATCH /v1/env/{env_id}/close
请求参数
| 名称 | 类型 | 必选 | 说明 |
| env_id | string | 是 | 环境ID,对应列表中的id |
响应参数
| 名称 | 类型 | 必选 | 说明 |
| serial_number | integer(int32) | 是 | 环境序号 |
| pid | string | 是 | 环境的进程id |
| debug_port | integer | 是 | 环境端口 |
响应示例(Python)
{
'code': 0,
'msg': 'success'
}
POST 新增环境
接口地址
POST /v1/env
用于创建一个新的浏览器环境。
请求头
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
x-api-key | string | 是 | Local API Key。 |
Content-Type | string | 是 | 固定为 application/json。 |
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
name | string | 否 | 环境名称。 |
browser | string | 是 | 浏览器类型。当前支持 CHROME。 |
group_id | string | 是 | 环境分组 ID。 |
group_ids | string[] | 否 | 环境分组 ID 列表。可传默认未分组ID:1876881021063852033 |
kernel_version | string | 否 | 浏览器内核版本,例如 120、134、142。如不传,系统将按当前规则使用默认内核版本。 |
ua | string | 否 | User Agent。不传时,系统会根据 kernel_version 和 os 自动生成。 |
ua_type | string | 否 | UA 版本范围,JSON 字符串格式,例如 "[\"all\"]"。 |
ua_os | string | 否 | UA 对应的操作系统。可选值:WINDOWS、MAC、ANDROID、IOS、LINUX。 |
os | object | 否 | 操作系统范围。 |
status | string | 否 | 环境状态。可选值:ENABLED、DISABLED。 |
remark | string | 否 | 备注。 |
env_tag_ids | string[] | 否 | 环境标签 ID 列表。 |
urls | string[] | 否 | 打开环境时访问的 URL 列表。 |
fixed_urls | string[] | 否 | 固定 URL 列表。 |
restore_url_type | string | 否 | 是否还原上次打开网页。可选值见下方枚举说明。 |
account_list | object[] | 否 | 账号列表。 |
cookie | string | 否 | Cookie 数据。 |
other_cookie | string | 否 | 其它 Cookie 数据。 |
bookmark | string | 否 | 书签数据。 |
local_storage | string | 否 | Local Storage 数据。 |
indexed_db | string | 否 | IndexedDB 数据。 |
config_ext_map | object | 否 | 扩展字段。 |
proxy_way | string | 否 | 代理方式。可选值见下方枚举说明。 |
proxy_type | string | 否 | 代理类型或代理协议。可选值见下方枚举说明。 |
proxy_host | string | 否 | 代理主机。 |
proxy_port | integer | 否 | 代理端口。 |
proxy_user_name | string | 否 | 代理账号。 |
proxy_passwd | string | 否 | 代理密码。 |
proxy_id | string | 否 | 已保存代理的 ID。proxy_way=SELECT_EXIST 时使用。 |
proxy_ip_type | string | 否 | IP 查询渠道。可选值:IPAPI、IP2LOCATION。 |
proxy_ip_addr_type | string | 否 | 代理 IP 协议类型。可选值:IPV4、IPV6。 |
proxy_soft_enable | boolean | 否 | 是否启用代理服务商配置。 |
proxy_soft | string | 否 | 代理服务商类型。 |
proxy_soft_info | object | 否 | 代理服务商参数。 |
proxy_api_info | object | 否 | API 提取代理配置。proxy_way=FROM_API 时使用。 |
extensions_type | string | 否 | 扩展安装权限。可选值:ALLOW、BAN。 |
extensions_group_id | string | 否 | 扩展分组 ID。 |
env_mutil_open_type | string | 否 | 多开设置。可选值见下方枚举说明。 |
remote_inspector_type | string | 否 | 远程调试设置。可选值见下方枚举说明。 |
spoofing_video_type | string | 否 | 视频替换设置。可选值见下方枚举说明。 |
config | string | 否 | 指纹配置,值为 JSON 字符串。 |
data_config | string | 否 | 数据同步配置,值为 JSON 字符串。 |
browser_config | string | 否 | 浏览器设置,值为 JSON 字符串。 |
local_data_config | string | 否 | 清除本地缓存配置,值为 JSON 字符串。 |
env_data_sync | string | 否 | 环境数据同步权限配置,值为 JSON 字符串。 |
bookmark_config | string | 否 | 书签配置,值为 JSON 字符串。 |
access_limit_config | string | 否 | 访问限制配置,值为 JSON 字符串。 |
参数说明
os
os 用于指定创建环境时可使用的操作系统范围。
{
"windows": ["windows-all"],
"mac": [],
"android": [],
"ios": [],
"linux": []
}
| 字段 | 类型 | 说明 |
|---|---|---|
windows | string[] | Windows 系统版本。可传 windows-all 或具体版本。 |
mac | string[] | macOS 系统版本。可传 mac-all 或具体版本。 |
android | string[] | Android 系统版本。可传 android-all 或具体版本。 |
ios | string[] | iOS 系统版本。可传 ios-all 或具体版本。 |
linux | string[] | Linux 系统版本。可传 linux-all。 |
proxy_way
| 值 | 说明 |
|---|---|
CUSTOM | 自定义代理。通过 proxy_type、proxy_host、proxy_port、proxy_user_name、proxy_passwd 等字段传入代理信息。 |
SELECT_EXIST | 使用已保存代理。需要传入 proxy_id。 |
FROM_API | 从 API 提取代理。需要传入 proxy_api_info。 |
proxy_type
| 值 | 说明 |
|---|---|
NON_USE | 不使用代理,本地网络直连。 |
HTTP | HTTP 代理。 |
HTTPS | HTTPS 代理。 |
SOCKS5 | SOCKS5 代理。 |
SSH | SSH 代理。 |
IPFLY | IPFLY 动态代理。 |
S5PROXY | 922S5 动态代理。 |
IPROYAL | IPRoyal 动态代理。 |
NETNUT | NetNut 动态代理。 |
NODE_MAVEN | NodeMaven 动态代理。 |
proxy_api_info
proxy_way=FROM_API 时使用。
{
"ip_method": "EVERY_TIME",
"url": "https://example.com/get-proxy",
"ip": "",
"port": "",
"check_duplicate": false
}
| 名称 | 类型 | 说明 |
|---|---|---|
ip_method | string | IP 提取方式。可选值:EVERY_TIME、AFTER_EXPIRE。 |
url | string | 提取代理的 API 地址。 |
ip | string | 提取到的代理 IP。 |
port | string | 提取到的代理端口。 |
check_duplicate | boolean | 是否检查重复。 |
restore_url_type
| 值 | 说明 |
|---|---|
GLOBAL | 跟随全局设置。 |
RESTORE | 还原上次打开网页。 |
NOT_RESTORE | 不还原上次打开网页。 |
account_list
[
{
"platform": "facebook",
"url": "https://facebook.com",
"user_name": "account@example.com",
"passwd": "password",
"secret": "",
"remark": "account remark"
}
]
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
platform | string | 是 | 平台名称。 |
url | string | 否 | 平台 URL。 |
user_name | string | 否 | 登录账号。 |
passwd | string | 否 | 登录密码。 |
secret | string | 否 | 2FA 密钥。 |
remark | string | 否 | 账号备注。 |
env_mutil_open_type
| 值 | 说明 |
|---|---|
GLOBAL | 跟随全局设置。 |
ALLOW | 允许多开。 |
BAN | 禁止多开。 |
remote_inspector_type
| 值 | 说明 |
|---|---|
GLOBAL | 跟随全局设置。 |
ALLOW | 允许远程调试。 |
BAN | 禁止远程调试。 |
spoofing_video_type
| 值 | 说明 |
|---|---|
DEFAULT | 跟随默认设置。 |
ENABLE | 启用视频替换。 |
DISABLE | 禁用视频替换。 |
JSON 字符串字段
以下字段的值需要传入 JSON 字符串,而不是 JSON 对象:
| 字段 | 示例 |
|---|---|
config | "{\"webrtcType\":\"replace\",\"canvasType\":\"noise\"}" |
data_config | "{\"type\":13,\"dataType\":\"custom\"}" |
browser_config | "{\"type\":525829,\"browserType\":\"custom\"}" |
local_data_config | "{\"type\":0,\"browserType\":\"global\",\"dataType\":null}" |
env_data_sync | "{\"status\":false,\"roleIds\":[]}" |
bookmark_config | "{\"bookmarkType\":\"global\",\"status\":false}" |
access_limit_config | "{\"accessLimitType\":\"custom\",\"status\":true,\"type\":1,\"urlList\":\"example.com\"}" |
config
config 用于传入指纹配置。其值为 JSON 字符串,内部对象可包含以下字段。
| 名称 | 类型 | 说明 |
|---|---|---|
acceptLangType | string | 语言匹配方式。常用值:ip。 |
acceptLangValue | string[] | Accept-Language 值,例如 ["en-US", "en"]。 |
langType | string | 界面语言来源。常用值:acceptLang、custom、truth。 |
langValue | string | 界面语言值。 |
timezoneType | string | 时区来源。常用值:ip、custom、truth。 |
timezoneValue | string | 时区值。timezoneType=ip 时通常传 local。 |
geoType | string | 地理位置权限。可选值:ask、allow、disable。 |
geoSubType | string | 地理位置来源。常用值:ip、custom。 |
geoValue | object | 自定义地理位置。可包含 longitude、latitude、accuracy。 |
fontType | string | 字体列表方式。常用值:custom、truth。 |
fontValue | string[] | 字体列表。 |
webrtcType | string | WebRTC 指纹模式。可选值见下方 WebRTC 说明。 |
webrtcValue | string | WebRTC 指纹值。手动传入内网 IP 或由系统在打开环境时按配置处理。 |
webrtcSyncProxyIpFlag | boolean | 是否使用网络出口 IP。 |
webrtcUseRandomInternalIp | boolean | 是否使用随机内网 IP。 |
webrtcKeepRandomInternalIp | boolean | 随机内网 IP 是否保持。 |
canvasType | string | Canvas 指纹。常用值:noise、truth。 |
canvasValue | number | Canvas 噪音值。 |
canvasRev2Value | number | Canvas Rev2 噪音值。 |
ratioType | string | 分辨率方式。常用值:truth、random、custom。 |
ratioValue | string | 分辨率值类型。 |
ratioWidth | string | 分辨率宽度。 |
ratioHeight | string | 分辨率高度。 |
windowRatioType | string | 窗口大小方式。常用值:default、custom。 |
windowRatioValue | string | 窗口大小值。 |
webGLImageType | string | WebGL 图像指纹。常用值:noise、truth。 |
webGLImageValue | number | WebGL 图像噪音值。 |
webGLImageRev2Value | number | WebGL 图像 Rev2 噪音值。 |
webGLMetadataType | string | WebGL 元数据方式。常用值:custom、truth。 |
webglManufacturer | string | WebGL 厂商。 |
webglRender | string | WebGL 渲染。 |
webGPUType | string | WebGPU 指纹。常用值:inWebGL、disable、truth。 |
webGPUTypeValue | number | WebGPU 噪音值。 |
audioContextType | string | AudioContext 指纹。常用值:noise、truth。 |
audioContextValue | number | AudioContext 噪音值。 |
clientRectsType | string | ClientRects 指纹。常用值:noise、truth。 |
clientRectsValue | number | ClientRects 噪音值。 |
speechVoicesType | string | SpeechVoices 指纹。常用值:noise、truth。 |
speechVoicesValue | number | SpeechVoices 噪音值。 |
hardwareConcurrencyValue | string | CPU 核心数。 |
deviceMemoryValue | string | 设备内存。 |
trackType | string | Do Not Track 配置。 |
batteryType | string | Battery 指纹。常用值:noise、truth。 |
batteryValue | number | Battery 噪音值。 |
portType | string | 端口扫描保护配置。 |
portValue | string | 允许被扫描的端口,多个端口使用英文逗号分隔。 |
accelerateType | string | 硬件加速配置。 |
startParams | string | 浏览器启动参数,多个参数使用英文逗号分隔。 |
deviceNameType | string | 设备名称方式。常用值:truth、custom。 |
deviceNameValue | string | 设备名称。 |
macType | string | MAC 地址方式。常用值:truth、custom。 |
macValue | string | MAC 地址。 |
platformVersion | string | 平台版本。 |
adapterinfoArchitecture | string | GPU Adapter 架构。 |
adapterinfoVendor | string | GPU Adapter 厂商。 |
WebRTC 说明
webrtcType | 说明 |
|---|---|
replace | 替代。可配合 webrtcValue、webrtcSyncProxyIpFlag、webrtcUseRandomInternalIp、webrtcKeepRandomInternalIp 使用。 |
forward | 转发。转发模式下通常使用网络出口 IP。 |
truth | 真实。使用真实 WebRTC 信息。 |
disable | 禁止。禁用 WebRTC。 |
webrtcType=replace 时,可通过以下方式设置 WebRTC 内网 IP:
| 字段组合 | 说明 |
|---|---|
webrtcValue="192.168.1.10" | 手动指定内网 IP。 |
webrtcSyncProxyIpFlag=true | 使用网络出口 IP。 |
webrtcUseRandomInternalIp=true | 使用随机内网 IP。 |
webrtcUseRandomInternalIp=true 且 webrtcKeepRandomInternalIp=true | 随机内网 IP 保持不变;公网 IP 变化时重新随机。 |
webrtcType=truth 或 webrtcType=disable 时,通常不需要传入 webrtcValue。
data_config
data_config 用于设置需要同步的数据类型。其值为 JSON 字符串。
{
"type": 13,
"dataType": "custom"
}
| 字段 | 类型 | 说明 |
|---|---|---|
dataType | string | 配置来源。可选值:global、custom。global 表示跟随全局设置;custom 表示使用当前环境配置。 |
type | integer | 数据同步项的位运算值。dataType=global 时通常传 0。 |
type 使用位运算累加。需要启用多个选项时,将对应数值相加后传入。
| 数值 | 数据项 | 说明 |
|---|---|---|
1 | Cookie | 同步 Cookie。 |
2 | BookMark | 同步书签。 |
4 | Account | 同步账号密码。 |
8 | LocalStorage | 同步 Local Storage。 |
16 | IndexedDB | 同步 IndexedDB。 |
32 | Extensions | 同步扩展数据。 |
示例:同步 Cookie、账号密码、Local Storage:
1 + 4 + 8 = 13
{
"type": 13,
"dataType": "custom"
}
判断某一项是否启用时,可使用按位与。例如 13 & 4 = 4,表示已启用账号密码同步。
browser_config
browser_config 用于设置浏览器打开行为、安全限制和加载策略。其值为 JSON 字符串。
{
"type": 525829,
"browserType": "custom"
}
| 字段 | 类型 | 说明 |
|---|---|---|
browserType | string | 配置来源。可选值:global、custom。global 表示跟随全局设置;custom 表示使用当前环境配置。 |
type | integer | 浏览器设置项的位运算值。browserType=global 时通常传 0。 |
type 使用位运算累加。需要启用多个选项时,将对应数值相加后传入。
| 数值 | 说明 |
|---|---|
1 | 打开环境时,还原上次已打开的页面。 |
2 | 禁止加载图片。 |
4 | 禁止加载视频。 |
8 | 禁止播放声音。 |
16 | 禁止网页弹出消息通知。 |
32 | 代理检测失败时,不打开环境。 |
64 | 禁止弹出保存账号/密码确认框。 |
128 | 禁止打开浏览器开发者工具界面。 |
256 | 忽略 HTTPS 证书错误提示,直接打开网页。 |
512 | 禁止管理/移除扩展,以及从本地安装扩展至浏览器。 |
1024 | 每次打开环境时,随机指纹。 |
2048 | 禁止打开无痕模式。 |
4096 | 打开环境时,不展示首页(检测页)。 |
8192 | 开启扩展加密并防止篡改;检测到有篡改扩展时将禁止打开环境。 |
16384 | 禁止成员访问谷歌扩展商店和扩展设置页面。 |
32768 | 禁止查看网站密码。 |
131072 | 国家/地区与上一次打开时不一致,不打开浏览器。 |
262144 | 扩展下载失败时,不打开环境。 |
524288 | 禁止浏览器写入数据到磁盘(Cookie、Session & Local Storage、IndexedDB)。 |
示例:启用“还原上次页面、禁止加载视频、禁止管理/移除扩展、每次打开随机指纹、禁止浏览器写入数据到磁盘”:
1 + 4 + 512 + 1024 + 524288 = 525829
{
"type": 525829,
"browserType": "custom"
}
判断某一项是否启用时,可使用按位与。例如 525829 & 524288 = 524288,表示已启用“禁止浏览器写入数据到磁盘”。
local_data_config
local_data_config 用于设置打开环境时的本地缓存清理规则。其值为 JSON 字符串。
{
"type": 0,
"browserType": "global",
"dataType": null,
"synchronize": true,
"frequency": 1,
"interval": 1
}
| 字段 | 类型 | 说明 |
|---|---|---|
browserType | string | 配置来源。可选值:global、custom。 |
type | integer | 清理方式。0 表示不清理;1 表示清理默认本地缓存项;2 表示按 dataType 自定义清理。 |
dataType | integer/null | 自定义清理项的位运算值。type=2 且 browserType=custom 时使用;其它情况通常传 null。 |
synchronize | boolean | 清理本地数据后是否同步保存。 |
frequency | integer | 清理频率。 |
interval | integer | 清理间隔。 |
dataType 使用位运算累加。
| 数值 | 数据项 | 说明 |
|---|---|---|
1 | Cookie | 清理 Cookie。 |
2 | BookMark | 清理书签。 |
4 | LocalStorage | 清理 Local Storage。 |
8 | IndexedDB | 清理 IndexedDB。 |
16 | History | 清理历史记录。 |
32 | Media | 清理媒体缓存。 |
64 | AccountPwd | 清理账号密码。 |
示例:清理 Cookie、Local Storage、IndexedDB:
1 + 4 + 8 = 13
{
"type": 2,
"browserType": "custom",
"dataType": 13,
"synchronize": true,
"frequency": 1,
"interval": 1
}
env_data_sync
env_data_sync 用于设置环境数据同步权限。其值为 JSON 字符串。
{
"status": false,
"roleIds": []
}
| 字段 | 类型 | 说明 |
|---|---|---|
status | boolean | 是否启用环境数据同步权限控制。 |
roleIds | string[] | 启用后允许同步的角色 ID 列表。 |
bookmark_config
bookmark_config 用于设置书签配置。其值为 JSON 字符串。
{
"bookmarkType": "global",
"status": false,
"fileContent": [],
"coverRule": 1,
"fileName": "",
"type": 1
}
| 字段 | 类型 | 说明 |
|---|---|---|
bookmarkType | string | 配置来源。可选值:global、custom。 |
status | boolean | 是否启用书签配置。 |
fileContent | array | 书签文件内容。 |
coverRule | integer | 覆盖规则。 |
fileName | string | 书签文件名。 |
type | integer | 书签导入方式。 |
access_limit_config
access_limit_config 用于设置访问限制。其值为 JSON 字符串。
{
"accessLimitType": "custom",
"status": true,
"type": 1,
"quickSelectionOption": [],
"quickSelectionType": 0,
"urlList": "example.com\n*.example.org"
}
| 字段 | 类型 | 说明 |
|---|---|---|
accessLimitType | string | 配置来源。可选值:global、custom。 |
status | boolean | 是否启用访问限制。 |
type | integer | 限制类型。1 表示禁止访问指定网址;2 表示只允许访问指定网址,其他网址不可访问。 |
quickSelectionOption | number[] | 快捷选择项。 |
quickSelectionType | integer | 快捷选择项的位运算值。 |
urlList | string | 域名黑白名单内容,多个网址可使用换行分隔。 |
type=1 时,urlList 表示黑名单;type=2 时,urlList 表示白名单。
请求示例
请按照以下请求信息调用接口:
| 项目 | 内容 |
|---|---|
| 请求方式 | POST |
| 接口路径 | http://127.0.0.1:52100/openapi/v1/env |
| 请求头 | x-api-key: your-local-api-key |
| 内容类型 | application/json |
| 请求体 | 传入 JSON 格式的环境配置参数 |
请求体示例:
{
"extensions_type": "ALLOW",
"name": "profile-0617367",
"browser": "CHROME",
"group_id": "1876881021063852033",
"kernel_version": "120",
"ua_os": "WINDOWS",
"os": {
"windows": ["windows-all"],
"mac": [],
"android": [],
"ios": [],
"linux": []
},
"ua_type": "[\"all\"]",
"ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.59 Safari/537.36",
"proxy_way": "CUSTOM",
"proxy_type": "SOCKS5",
"proxy_host": "192.168.0.1",
"proxy_port": 8000,
"proxy_user_name": "Username",
"proxy_passwd": "Password",
"proxy_ip_type": "IPAPI",
"proxy_id": "",
"proxy_ip_addr_type": "IPV4",
"account_list": [],
"urls": [],
"fixed_urls": [],
"restore_url_type": "GLOBAL",
"config": "{\"acceptLangType\":\"ip\",\"acceptLangValue\":[\"en-US\",\"en\"],\"langType\":\"acceptLang\",\"langValue\":\"local\",\"timezoneType\":\"ip\",\"timezoneValue\":\"local\",\"geoType\":\"ask\",\"geoSubType\":\"ip\",\"geoValue\":{},\"fontType\":\"custom\",\"fontValue\":[\"Arial\",\"Calibri\",\"Times New Roman\"],\"webrtcType\":\"replace\",\"webrtcValue\":\"\",\"webrtcSyncProxyIpFlag\":true,\"webrtcKeepRandomInternalIp\":false,\"webrtcUseRandomInternalIp\":false,\"canvasType\":\"noise\",\"canvasValue\":85877,\"canvasRev2Value\":52896,\"ratioType\":\"custom\",\"ratioValue\":\"custom\",\"ratioWidth\":\"1024\",\"ratioHeight\":\"768\",\"windowRatioType\":\"default\",\"windowRatioValue\":\"\",\"webGLImageType\":\"noise\",\"webGLImageValue\":23517,\"webGLImageRev2Value\":88964,\"mediadeviceType\":\"noise\",\"mediadeviceValue\":51052,\"webGLMetadataType\":\"custom\",\"webglManufacturer\":\"Google Inc. (Intel)\",\"webglRender\":\"ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0)\",\"webGPUType\":\"inWebGL\",\"webGPUTypeValue\":85195,\"audioContextType\":\"truth\",\"audioContextValue\":83641,\"clientRectsType\":\"noise\",\"clientRectsValue\":50248,\"speechVoicesType\":\"noise\",\"speechVoicesValue\":80004,\"hardwareConcurrencyValue\":\"2\",\"deviceMemoryValue\":\"4\",\"trackType\":\"0\",\"batteryType\":\"noise\",\"batteryValue\":58088,\"portType\":\"1\",\"portValue\":\"\",\"accelerateType\":\"0\",\"startParams\":\"\",\"deviceNameType\":\"truth\",\"deviceNameValue\":\"\",\"macType\":\"truth\",\"macValue\":\"\",\"platformVersion\":\"10.0.0\",\"adapterinfoArchitecture\":\"gen-12lp\",\"adapterinfoVendor\":\"intel\"}",
"data_config": "{\"type\":13,\"dataType\":\"custom\"}",
"browser_config": "{\"type\":525829,\"browserType\":\"custom\"}",
"env_mutil_open_type": "ALLOW",
"remote_inspector_type": "BAN",
"spoofing_video_type": "DISABLE",
"local_data_config": "{\"type\":0,\"browserType\":\"global\",\"dataType\":null,\"synchronize\":true,\"frequency\":1,\"interval\":1}",
"proxy_soft_enable": false,
"proxy_soft": "NONE",
"proxy_soft_info": {
"ip": "",
"country": "",
"country_code": "",
"region": "",
"region_code": "",
"city": ""
},
"proxy_api_info": {
"ip_method": "EVERY_TIME",
"url": "",
"ip": "",
"port": "",
"check_duplicate": false
},
"env_data_sync": "{\"status\":false,\"roleIds\":[]}",
"bookmark_config": "{\"bookmarkType\":\"global\",\"status\":false,\"fileContent\":[],\"coverRule\":1,\"fileName\":\"\",\"type\":1}",
"access_limit_config": "{\"accessLimitType\":\"custom\",\"status\":false,\"type\":1,\"quickSelectionOption\":[],\"quickSelectionType\":0,\"urlList\":\"\"}",
"env_tag_ids": [],
"extensions_group_id": "1876881021072240641",
"remark": "remark"
}
响应示例
{
"code": 0,
"data": {
"id": "1876881021063852034"
},
"msg": "success"
}
响应参数
| 名称 | 类型 | 说明 |
|---|---|---|
code | integer | 响应状态码。0 表示成功。 |
data | object | 响应数据。 |
data.id | string | 新创建的环境 ID。 |
msg | string | 响应信息。 |
PUT 更新环境
接口地址
PUT /v1/env/{env_id}
用于更新已有浏览器环境。
请求头
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
x-api-key | string | 是 | Local API Key。 |
Content-Type | string | 是 | 固定为 application/json。 |
路径参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
env_id | string | 是 | 环境 ID。 |
请求参数
更新环境支持传入新增环境接口中的同名字段。字段含义、枚举值、JSON 字符串字段结构、data_config / browser_config / local_data_config 位运算规则,请参考上方“新增环境”的“请求参数”和“参数说明”。
更新环境时可只传入需要修改的字段。未传入的字段保持原值。
更新规则
config、data_config、browser_config、local_data_config、env_data_sync、bookmark_config、access_limit_config 均为 JSON 字符串字段。更新这些字段时,传入值会作为该字段的新值保存。
如果只需要修改 JSON 字符串字段中的某一个子项,先获取环境详情,基于原字段内容修改后再完整传回该字段。
示例:只更新 WebRTC 为转发模式,并设置窗口大小时,需将完整 config 对象序列化后传入:
{
"config": "{\"acceptLangType\":\"ip\",\"acceptLangValue\":[\"en-US\",\"en\"],\"langType\":\"acceptLang\",\"langValue\":\"local\",\"timezoneType\":\"ip\",\"timezoneValue\":\"local\",\"geoType\":\"ask\",\"geoSubType\":\"ip\",\"geoValue\":{},\"fontType\":\"custom\",\"fontValue\":[\"Arial\",\"Calibri\",\"Times New Roman\"],\"webrtcType\":\"forward\",\"webrtcValue\":\"\",\"webrtcSyncProxyIpFlag\":true,\"windowRatioType\":\"custom\",\"windowRatioValue\":\"1280x720\"}"
}
请求示例
请按照以下请求信息调用接口:
| 项目 | 内容 |
|---|---|
| 请求方式 | PUT |
| 请求地址 | http://127.0.0.1:52100/openapi/v1/env/{env_id} |
| 请求头 | x-api-key: your-local-api-key |
| 内容类型 | application/json |
请求体示例:
{
"name": "profile-updated",
"remark": "updated remark",
"kernel_version": "120",
"proxy_way": "CUSTOM",
"proxy_type": "SOCKS5",
"proxy_host": "192.168.0.2",
"proxy_port": 8001,
"proxy_user_name": "Username",
"proxy_passwd": "Password",
"proxy_ip_type": "IPAPI",
"proxy_ip_addr_type": "IPV4",
"config": "{\"acceptLangType\":\"ip\",\"acceptLangValue\":[\"en-US\",\"en\"],\"langType\":\"acceptLang\",\"langValue\":\"local\",\"timezoneType\":\"ip\",\"timezoneValue\":\"local\",\"geoType\":\"ask\",\"geoSubType\":\"ip\",\"geoValue\":{},\"fontType\":\"custom\",\"fontValue\":[\"Arial\",\"Calibri\",\"Times New Roman\"],\"webrtcType\":\"forward\",\"webrtcValue\":\"\",\"webrtcSyncProxyIpFlag\":true,\"webrtcKeepRandomInternalIp\":false,\"webrtcUseRandomInternalIp\":false,\"canvasType\":\"noise\",\"canvasValue\":85877,\"canvasRev2Value\":52896,\"ratioType\":\"custom\",\"ratioValue\":\"custom\",\"ratioWidth\":\"1280\",\"ratioHeight\":\"720\",\"windowRatioType\":\"custom\",\"windowRatioValue\":\"1280x720\",\"webGLImageType\":\"noise\",\"webGLImageValue\":23517,\"webGLImageRev2Value\":88964,\"mediadeviceType\":\"noise\",\"mediadeviceValue\":51052,\"webGLMetadataType\":\"custom\",\"webglManufacturer\":\"Google Inc. (Intel)\",\"webglRender\":\"ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0)\",\"webGPUType\":\"inWebGL\",\"webGPUTypeValue\":85195,\"audioContextType\":\"truth\",\"audioContextValue\":83641,\"clientRectsType\":\"noise\",\"clientRectsValue\":50248,\"speechVoicesType\":\"noise\",\"speechVoicesValue\":80004,\"hardwareConcurrencyValue\":\"2\",\"deviceMemoryValue\":\"4\",\"trackType\":\"0\",\"batteryType\":\"noise\",\"batteryValue\":58088,\"portType\":\"1\",\"portValue\":\"\",\"accelerateType\":\"0\",\"startParams\":\"\",\"deviceNameType\":\"truth\",\"deviceNameValue\":\"\",\"macType\":\"truth\",\"macValue\":\"\",\"platformVersion\":\"10.0.0\",\"adapterinfoArchitecture\":\"gen-12lp\",\"adapterinfoVendor\":\"intel\"}",
"data_config": "{\"type\":13,\"dataType\":\"custom\"}",
"browser_config": "{\"type\":525829,\"browserType\":\"custom\"}",
"local_data_config": "{\"type\":2,\"browserType\":\"custom\",\"dataType\":49,\"synchronize\":true,\"frequency\":1,\"interval\":1}",
"access_limit_config": "{\"accessLimitType\":\"custom\",\"status\":true,\"type\":1,\"quickSelectionOption\":[],\"quickSelectionType\":0,\"urlList\":\"example.com\\n*.example.org\"}",
"env_mutil_open_type": "ALLOW",
"remote_inspector_type": "BAN",
"spoofing_video_type": "DISABLE"
}
响应示例
{
"code": 0,
"data": {},
"msg": "success"
}
响应参数
| 名称 | 类型 | 说明 |
|---|---|---|
code | integer | 响应状态码。0 表示成功。 |
data | object | 响应数据。 |
msg | string | 响应信息。 |
DELETE 删除环境
DELETE /v1/env/{env_id}
请求参数
| 名称 | 类型 | 必选 | 说明 |
| env_id | string | 是 | 环境唯一id |
响应参数(Python)
{
'code': 0,
'msg': 'success'
}
DELETE 彻底删除环境
DELETE /v1/env/{env_id}/thorough
请求参数
| 名称 | 类型 | 必选 | 说明 |
| env_id | string | 是 | 环境唯一id |
响应参数(Python)
{
'code': 0,
'msg': 'success'
}