APIShardX Launcher APIFolders

Folders

文件夹列表

GEThttp://127.0.0.1:40325/folders

所有永久配置文件中唯一的非空文件夹标签。

Authorizations
bearerAuth
Authorizationstringrequired

来自 Settings → Automation API 的永久 JWT。

Responses
200文件夹名称。application/json
401缺失或无效的 Bearer 令牌。
GET/folders
GET /folders HTTP/1.1
Host: 127.0.0.1:40325
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'http://127.0.0.1:40325/folders' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# 来自 Settings → Automation API 的永久 JWT。
token = "YOUR_SECRET_TOKEN"

url = "http://127.0.0.1:40325/folders"
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// 来自 Settings → Automation API 的永久 JWT。
const token = "YOUR_SECRET_TOKEN";

const url = "http://127.0.0.1:40325/folders";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// 来自 Settings → Automation API 的永久 JWT。
	token := "YOUR_SECRET_TOKEN"

	url := "http://127.0.0.1:40325/folders"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // 来自 Settings → Automation API 的永久 JWT。
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("http://127.0.0.1:40325/folders")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // 来自 Settings → Automation API 的永久 JWT。
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "http://127.0.0.1:40325/folders");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // 来自 Settings → Automation API 的永久 JWT。
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "http://127.0.0.1:40325/folders");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
200文件夹名称。
[
  "work",
  "scrapers"
]

重命名文件夹

PATCHhttp://127.0.0.1:40325/folders/{folder}

为文件夹中所有配置文件更新标签。返回受影响的配置文件数量。

Authorizations
bearerAuth
Authorizationstringrequired

来自 Settings → Automation API 的永久 JWT。

Path parameters
folderstringrequired
Body
application/json
namestringrequired

新文件夹名称。

Responses
200已重命名。application/json
renamed_tostringoptional
profilesintegeroptional

已重新打标签的配置文件数量。

401缺失或无效的 Bearer 令牌。
PATCH/folders/text
PATCH /folders/text HTTP/1.1
Host: 127.0.0.1:40325
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "name": "text"
}
curl -X PATCH 'http://127.0.0.1:40325/folders/text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name":"text"}'
import requests

# 来自 Settings → Automation API 的永久 JWT。
token = "YOUR_SECRET_TOKEN"

url = "http://127.0.0.1:40325/folders/text"
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "name": "text",
}

response = requests.patch(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// 来自 Settings → Automation API 的永久 JWT。
const token = "YOUR_SECRET_TOKEN";

const url = "http://127.0.0.1:40325/folders/text";
const payload = {
  "name": "text"
};

const response = await fetch(url, {
  method: "PATCH",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// 来自 Settings → Automation API 的永久 JWT。
	token := "YOUR_SECRET_TOKEN"

	url := "http://127.0.0.1:40325/folders/text"
	body := bytes.NewBufferString(`{
  "name": "text"
}`)

	req, err := http.NewRequest("PATCH", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // 来自 Settings → Automation API 的永久 JWT。
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .patch("http://127.0.0.1:40325/folders/text")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "name": "text"
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // 来自 Settings → Automation API 的永久 JWT。
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Patch, "http://127.0.0.1:40325/folders/text");
        request.Content = new StringContent("""
            {
              "name": "text"
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // 来自 Settings → Automation API 的永久 JWT。
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "name": "text"
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "http://127.0.0.1:40325/folders/text");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
200已重命名。
{
  "renamed_to": "text",
  "profiles": 1
}

删除文件夹

DELhttp://127.0.0.1:40325/folders/{folder}

删除文件夹标签。若 delete_profiles=true,文件夹内的配置文件也会被删除; 否则它们移至"全部"(仅移除标签)。

Authorizations
bearerAuth
Authorizationstringrequired

来自 Settings → Automation API 的永久 JWT。

Path parameters
folderstringrequired
Query parameters
delete_profilesboolean· default: falseoptional

删除文件夹中的配置文件(默认 false = 仅移除标签)。

Responses
200已删除。application/json
deleted_folderstringoptional
delete_profilesbooleanoptional
profilesintegeroptional

受影响的配置文件数量。

401缺失或无效的 Bearer 令牌。
DEL/folders/text
DELETE /folders/text HTTP/1.1
Host: 127.0.0.1:40325
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X DELETE 'http://127.0.0.1:40325/folders/text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# 来自 Settings → Automation API 的永久 JWT。
token = "YOUR_SECRET_TOKEN"

url = "http://127.0.0.1:40325/folders/text"
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.delete(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// 来自 Settings → Automation API 的永久 JWT。
const token = "YOUR_SECRET_TOKEN";

const url = "http://127.0.0.1:40325/folders/text";

const response = await fetch(url, {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// 来自 Settings → Automation API 的永久 JWT。
	token := "YOUR_SECRET_TOKEN"

	url := "http://127.0.0.1:40325/folders/text"

	req, err := http.NewRequest("DELETE", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // 来自 Settings → Automation API 的永久 JWT。
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .delete("http://127.0.0.1:40325/folders/text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // 来自 Settings → Automation API 的永久 JWT。
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Delete, "http://127.0.0.1:40325/folders/text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // 来自 Settings → Automation API 的永久 JWT。
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "http://127.0.0.1:40325/folders/text");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
200已删除。
{
  "deleted_folder": "text",
  "delete_profiles": true,
  "profiles": 1
}

在文件夹中创建配置文件

POSThttp://127.0.0.1:40325/folders/{folder}/profiles

与 POST /profiles 相同,但文件夹从路径中获取 (覆盖请求体中的 folder 字段)。

Authorizations
bearerAuth
Authorizationstringrequired

来自 Settings → Automation API 的永久 JWT。

Path parameters
folderstringrequired
Body
application/json
namestringoptional
notesstringoptional
proxy_idstringoptional

绑定存储中的代理(按 id)。

proxystringoptional

以字符串方式绑定代理(host:port:user:pass 或 scheme://user:pass@host:port)。对于永久配置文件,代理 会被添加到存储(按端点去重)并完成全量测试(UDP + 地理位置), 然后按 id 绑定; 显示在代理列表中,QUIC/WebRTC 结果被缓存。 对于临时配置文件,代理以内联方式附加(不保存)。 若已指定 proxy_id 则忽略。

folderstringoptional

文件夹标签(对于 /folders/{folder}/profiles 被忽略; 路径优先)。

colorstringoptional

配置文件窗口图标和地址栏名称标签的强调色。省略时,图标颜色根据名称生成,标签保留浏览器工具栏的颜色。

extensionsstring[]optional

扩展库 ID (GET /extensions),在启动时加载。库不保存的 id 是 400,而不是在没有它的情况下静默启动的配置文件。

refresh_rateinteger· min: 24· max: 480optional

声称的显示刷新率,写入screen.refresh_rate。没有 Web API 报告它;页面通过计时 requestAnimationFrame 来衡量它,这就是为什么将其排除在外并不是中立的;缺席意味着 60,这是大多数机器报告的值,而不是主机自己的屏幕所做的任何内容。帧只能减慢,因此有效速率是主机面板在此或低于此的最接近的整个划分。

fingerprintobject · Fingerprintrequired

原样保存。从 /fingerprint/new 获取后按需编辑。

Show propertiesHide properties
namestringoptional
notesstringoptional
seedintegeroptional

0 = 仅覆盖模式(典型情况)。

navigatorobjectoptional
Show propertiesHide properties
user_agentstringoptional
platformstringoptional
hardware_concurrencyintegeroptional
device_memoryinteger · enumoptional
Possible values:81632
languagestringoptional
do_not_trackbooleanoptional
screenobjectoptional
Show propertiesHide properties
widthintegeroptional
heightintegeroptional
avail_widthintegeroptional
avail_heightintegeroptional
color_depthintegeroptional
device_pixel_rationumberoptional
color_gamutstring · enumoptional
Possible values:srgbp3rec2020
refresh_rateinteger· min: 24· max: 480optional

所声明的显示刷新频率。缺席意味着 60。请参阅创建/编辑请求上的刷新率字段。

client_hintsobjectoptional

Sec-CH-UA 系列(在 browser.vision 中称为 hints)。

Show propertiesHide properties
platformstringoptional
platform_versionstringoptional
architecturestringoptional
bitnessstringoptional
mobilebooleanoptional
webglobjectoptional
Show propertiesHide properties
unmasked_vendorstringoptional
unmasked_rendererstringoptional
webgpuobjectoptional
webrtcstring · enumoptional

WebRTC 处理模式。

Possible values:autotcp_onlyblock
noiseobject · NoisePrefsoptional

各向量的反指纹噪音配置。每个块:{enabled, seed} (+ 特定参数)。enabled:false = 直接透传。

Show propertiesHide properties
canvasobject · NoiseBlockoptional
Show propertiesHide properties
enabledbooleanoptional
seedintegeroptional

每个配置文件的熵值;0 = 自动计算。

webglobject · NoiseBlockoptional
Show propertiesHide properties
enabledbooleanoptional
seedintegeroptional

每个配置文件的熵值;0 = 自动计算。

intensitynumberoptional
audioobject · NoiseBlockoptional
Show propertiesHide properties
enabledbooleanoptional
seedintegeroptional

每个配置文件的熵值;0 = 自动计算。

intensitynumberoptional
client_rectsobject · NoiseBlockoptional
Show propertiesHide properties
enabledbooleanoptional
seedintegeroptional

每个配置文件的熵值;0 = 自动计算。

max_offsetnumberoptional
sensorsobject · NoiseBlockoptional
Show propertiesHide properties
enabledbooleanoptional
seedintegeroptional

每个配置文件的熵值;0 = 自动计算。

fontsobject · NoiseBlockoptional

enabled:true 为每个配置文件隐藏少量确定性的 非关键字体子集(其余真实主机字体直接透传)。

Show propertiesHide properties
enabledbooleanoptional
seedintegeroptional

每个配置文件的熵值;0 = 自动计算。

networkobjectoptional
Show propertiesHide properties
blocked_portsinteger[]optional

局域网端口扫描防护(ports_protection)。

timezonestringoptional

IANA 名称或 "auto"; 将在启动时通过绑定代理解析。

Responses
200已创建配置文件的元数据。application/json

启动器中配置文件的元数据(创建时返回)。

idstring · uuidoptional
namestringoptional
notesstringoptional
proxy_idstring· nullableoptional
last_launched_atstring· nullableoptional

ISO-8601 或 null。

created_atstring· nullableoptional
pinnedbooleanoptional
folderstringoptional
colorstring· nullableoptional

图标强调色,格式为 #rrggbb;null 表示根据名称自动生成颜色,这是浏览器在未选择颜色时的默认行为。

extensionsstring[]optional

启动时加载的扩展库 ID。

400缺少 `fingerprint` 或其不是对象,或代理字符串无法解析。application/json
errorstringrequired
401缺失或无效的 Bearer 令牌。
POST/folders/text/profiles
POST /folders/text/profiles HTTP/1.1
Host: 127.0.0.1:40325
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "name": "text",
  "notes": "text",
  "proxy_id": "text",
  "proxy": "socks5://user:[email protected]:1080",
  "folder": "text",
  "color": "#2FCB80",
  "extensions": [
    "text"
  ],
  "refresh_rate": 60,
  "fingerprint": {
    "name": "text",
    "notes": "text",
    "seed": 1,
    "navigator": {
      "user_agent": "text",
      "platform": "Win32",
      "hardware_concurrency": 12,
      "device_memory": 16,
      "language": "text",
      "do_not_track": true
    },
    "screen": {
      "width": 1,
      "height": 1,
      "avail_width": 1,
      "avail_height": 1,
      "color_depth": 24,
      "device_pixel_ratio": 2,
      "color_gamut": "",
      "refresh_rate": 60
    },
    "client_hints": {
      "platform": "text",
      "platform_version": "text",
      "architecture": "x86",
      "bitness": "64",
      "mobile": true
    },
    "webgl": {
      "unmasked_vendor": "text",
      "unmasked_renderer": "text"
    },
    "webgpu": {},
    "webrtc": "auto",
    "noise": {
      "canvas": {
        "enabled": true,
        "seed": 1
      },
      "webgl": {
        "enabled": true,
        "seed": 1,
        "intensity": 1
      },
      "audio": {
        "enabled": true,
        "seed": 1,
        "intensity": 1
      },
      "client_rects": {
        "enabled": true,
        "seed": 1,
        "max_offset": 1
      },
      "sensors": {
        "enabled": true,
        "seed": 1
      },
      "fonts": {
        "enabled": true,
        "seed": 1
      }
    },
    "network": {
      "blocked_ports": [
        1
      ]
    },
    "timezone": "text"
  }
}
curl -X POST 'http://127.0.0.1:40325/folders/text/profiles' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name":"text","notes":"text","proxy_id":"text","proxy":"socks5://user:[email protected]:1080","folder":"text","color":"#2FCB80","extensions":["text"],"refresh_rate":60,"fingerprint":{"name":"text","notes":"text","seed":1,"navigator":{"user_agent":"text","platform":"Win32","hardware_concurrency":12,"device_memory":16,"language":"text","do_not_track":true},"screen":{"width":1,"height":1,"avail_width":1,"avail_height":1,"color_depth":24,"device_pixel_ratio":2,"color_gamut":"","refresh_rate":60},"client_hints":{"platform":"text","platform_version":"text","architecture":"x86","bitness":"64","mobile":true},"webgl":{"unmasked_vendor":"text","unmasked_renderer":"text"},"webgpu":{},"webrtc":"auto","noise":{"canvas":{"enabled":true,"seed":1},"webgl":{"enabled":true,"seed":1,"intensity":1},"audio":{"enabled":true,"seed":1,"intensity":1},"client_rects":{"enabled":true,"seed":1,"max_offset":1},"sensors":{"enabled":true,"seed":1},"fonts":{"enabled":true,"seed":1}},"network":{"blocked_ports":[1]},"timezone":"text"}}'
import requests

# 来自 Settings → Automation API 的永久 JWT。
token = "YOUR_SECRET_TOKEN"

url = "http://127.0.0.1:40325/folders/text/profiles"
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "name": "text",
    "notes": "text",
    "proxy_id": "text",
    "proxy": "socks5://user:[email protected]:1080",
    "folder": "text",
    "color": "#2FCB80",
    "extensions": [
        "text",
    ],
    "refresh_rate": 60,
    "fingerprint": {
        "name": "text",
        "notes": "text",
        "seed": 1,
        "navigator": {
            "user_agent": "text",
            "platform": "Win32",
            "hardware_concurrency": 12,
            "device_memory": 16,
            "language": "text",
            "do_not_track": True,
        },
        "screen": {
            "width": 1,
            "height": 1,
            "avail_width": 1,
            "avail_height": 1,
            "color_depth": 24,
            "device_pixel_ratio": 2,
            "color_gamut": "",
            "refresh_rate": 60,
        },
        "client_hints": {
            "platform": "text",
            "platform_version": "text",
            "architecture": "x86",
            "bitness": "64",
            "mobile": True,
        },
        "webgl": {
            "unmasked_vendor": "text",
            "unmasked_renderer": "text",
        },
        "webgpu": {},
        "webrtc": "auto",
        "noise": {
            "canvas": {
                "enabled": True,
                "seed": 1,
            },
            "webgl": {
                "enabled": True,
                "seed": 1,
                "intensity": 1,
            },
            "audio": {
                "enabled": True,
                "seed": 1,
                "intensity": 1,
            },
            "client_rects": {
                "enabled": True,
                "seed": 1,
                "max_offset": 1,
            },
            "sensors": {
                "enabled": True,
                "seed": 1,
            },
            "fonts": {
                "enabled": True,
                "seed": 1,
            },
        },
        "network": {
            "blocked_ports": [
                1,
            ],
        },
        "timezone": "text",
    },
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// 来自 Settings → Automation API 的永久 JWT。
const token = "YOUR_SECRET_TOKEN";

const url = "http://127.0.0.1:40325/folders/text/profiles";
const payload = {
  "name": "text",
  "notes": "text",
  "proxy_id": "text",
  "proxy": "socks5://user:[email protected]:1080",
  "folder": "text",
  "color": "#2FCB80",
  "extensions": [
    "text"
  ],
  "refresh_rate": 60,
  "fingerprint": {
    "name": "text",
    "notes": "text",
    "seed": 1,
    "navigator": {
      "user_agent": "text",
      "platform": "Win32",
      "hardware_concurrency": 12,
      "device_memory": 16,
      "language": "text",
      "do_not_track": true
    },
    "screen": {
      "width": 1,
      "height": 1,
      "avail_width": 1,
      "avail_height": 1,
      "color_depth": 24,
      "device_pixel_ratio": 2,
      "color_gamut": "",
      "refresh_rate": 60
    },
    "client_hints": {
      "platform": "text",
      "platform_version": "text",
      "architecture": "x86",
      "bitness": "64",
      "mobile": true
    },
    "webgl": {
      "unmasked_vendor": "text",
      "unmasked_renderer": "text"
    },
    "webgpu": {},
    "webrtc": "auto",
    "noise": {
      "canvas": {
        "enabled": true,
        "seed": 1
      },
      "webgl": {
        "enabled": true,
        "seed": 1,
        "intensity": 1
      },
      "audio": {
        "enabled": true,
        "seed": 1,
        "intensity": 1
      },
      "client_rects": {
        "enabled": true,
        "seed": 1,
        "max_offset": 1
      },
      "sensors": {
        "enabled": true,
        "seed": 1
      },
      "fonts": {
        "enabled": true,
        "seed": 1
      }
    },
    "network": {
      "blocked_ports": [
        1
      ]
    },
    "timezone": "text"
  }
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// 来自 Settings → Automation API 的永久 JWT。
	token := "YOUR_SECRET_TOKEN"

	url := "http://127.0.0.1:40325/folders/text/profiles"
	body := bytes.NewBufferString(`{
  "name": "text",
  "notes": "text",
  "proxy_id": "text",
  "proxy": "socks5://user:[email protected]:1080",
  "folder": "text",
  "color": "#2FCB80",
  "extensions": [
    "text"
  ],
  "refresh_rate": 60,
  "fingerprint": {
    "name": "text",
    "notes": "text",
    "seed": 1,
    "navigator": {
      "user_agent": "text",
      "platform": "Win32",
      "hardware_concurrency": 12,
      "device_memory": 16,
      "language": "text",
      "do_not_track": true
    },
    "screen": {
      "width": 1,
      "height": 1,
      "avail_width": 1,
      "avail_height": 1,
      "color_depth": 24,
      "device_pixel_ratio": 2,
      "color_gamut": "",
      "refresh_rate": 60
    },
    "client_hints": {
      "platform": "text",
      "platform_version": "text",
      "architecture": "x86",
      "bitness": "64",
      "mobile": true
    },
    "webgl": {
      "unmasked_vendor": "text",
      "unmasked_renderer": "text"
    },
    "webgpu": {},
    "webrtc": "auto",
    "noise": {
      "canvas": {
        "enabled": true,
        "seed": 1
      },
      "webgl": {
        "enabled": true,
        "seed": 1,
        "intensity": 1
      },
      "audio": {
        "enabled": true,
        "seed": 1,
        "intensity": 1
      },
      "client_rects": {
        "enabled": true,
        "seed": 1,
        "max_offset": 1
      },
      "sensors": {
        "enabled": true,
        "seed": 1
      },
      "fonts": {
        "enabled": true,
        "seed": 1
      }
    },
    "network": {
      "blocked_ports": [
        1
      ]
    },
    "timezone": "text"
  }
}`)

	req, err := http.NewRequest("POST", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // 来自 Settings → Automation API 的永久 JWT。
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("http://127.0.0.1:40325/folders/text/profiles")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "name": "text",
          "notes": "text",
          "proxy_id": "text",
          "proxy": "socks5://user:[email protected]:1080",
          "folder": "text",
          "color": "#2FCB80",
          "extensions": [
            "text"
          ],
          "refresh_rate": 60,
          "fingerprint": {
            "name": "text",
            "notes": "text",
            "seed": 1,
            "navigator": {
              "user_agent": "text",
              "platform": "Win32",
              "hardware_concurrency": 12,
              "device_memory": 16,
              "language": "text",
              "do_not_track": true
            },
            "screen": {
              "width": 1,
              "height": 1,
              "avail_width": 1,
              "avail_height": 1,
              "color_depth": 24,
              "device_pixel_ratio": 2,
              "color_gamut": "",
              "refresh_rate": 60
            },
            "client_hints": {
              "platform": "text",
              "platform_version": "text",
              "architecture": "x86",
              "bitness": "64",
              "mobile": true
            },
            "webgl": {
              "unmasked_vendor": "text",
              "unmasked_renderer": "text"
            },
            "webgpu": {},
            "webrtc": "auto",
            "noise": {
              "canvas": {
                "enabled": true,
                "seed": 1
              },
              "webgl": {
                "enabled": true,
                "seed": 1,
                "intensity": 1
              },
              "audio": {
                "enabled": true,
                "seed": 1,
                "intensity": 1
              },
              "client_rects": {
                "enabled": true,
                "seed": 1,
                "max_offset": 1
              },
              "sensors": {
                "enabled": true,
                "seed": 1
              },
              "fonts": {
                "enabled": true,
                "seed": 1
              }
            },
            "network": {
              "blocked_ports": [
                1
              ]
            },
            "timezone": "text"
          }
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // 来自 Settings → Automation API 的永久 JWT。
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "http://127.0.0.1:40325/folders/text/profiles");
        request.Content = new StringContent("""
            {
              "name": "text",
              "notes": "text",
              "proxy_id": "text",
              "proxy": "socks5://user:[email protected]:1080",
              "folder": "text",
              "color": "#2FCB80",
              "extensions": [
                "text"
              ],
              "refresh_rate": 60,
              "fingerprint": {
                "name": "text",
                "notes": "text",
                "seed": 1,
                "navigator": {
                  "user_agent": "text",
                  "platform": "Win32",
                  "hardware_concurrency": 12,
                  "device_memory": 16,
                  "language": "text",
                  "do_not_track": true
                },
                "screen": {
                  "width": 1,
                  "height": 1,
                  "avail_width": 1,
                  "avail_height": 1,
                  "color_depth": 24,
                  "device_pixel_ratio": 2,
                  "color_gamut": "",
                  "refresh_rate": 60
                },
                "client_hints": {
                  "platform": "text",
                  "platform_version": "text",
                  "architecture": "x86",
                  "bitness": "64",
                  "mobile": true
                },
                "webgl": {
                  "unmasked_vendor": "text",
                  "unmasked_renderer": "text"
                },
                "webgpu": {},
                "webrtc": "auto",
                "noise": {
                  "canvas": {
                    "enabled": true,
                    "seed": 1
                  },
                  "webgl": {
                    "enabled": true,
                    "seed": 1,
                    "intensity": 1
                  },
                  "audio": {
                    "enabled": true,
                    "seed": 1,
                    "intensity": 1
                  },
                  "client_rects": {
                    "enabled": true,
                    "seed": 1,
                    "max_offset": 1
                  },
                  "sensors": {
                    "enabled": true,
                    "seed": 1
                  },
                  "fonts": {
                    "enabled": true,
                    "seed": 1
                  }
                },
                "network": {
                  "blocked_ports": [
                    1
                  ]
                },
                "timezone": "text"
              }
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // 来自 Settings → Automation API 的永久 JWT。
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "name": "text",
  "notes": "text",
  "proxy_id": "text",
  "proxy": "socks5://user:[email protected]:1080",
  "folder": "text",
  "color": "#2FCB80",
  "extensions": [
    "text"
  ],
  "refresh_rate": 60,
  "fingerprint": {
    "name": "text",
    "notes": "text",
    "seed": 1,
    "navigator": {
      "user_agent": "text",
      "platform": "Win32",
      "hardware_concurrency": 12,
      "device_memory": 16,
      "language": "text",
      "do_not_track": true
    },
    "screen": {
      "width": 1,
      "height": 1,
      "avail_width": 1,
      "avail_height": 1,
      "color_depth": 24,
      "device_pixel_ratio": 2,
      "color_gamut": "",
      "refresh_rate": 60
    },
    "client_hints": {
      "platform": "text",
      "platform_version": "text",
      "architecture": "x86",
      "bitness": "64",
      "mobile": true
    },
    "webgl": {
      "unmasked_vendor": "text",
      "unmasked_renderer": "text"
    },
    "webgpu": {},
    "webrtc": "auto",
    "noise": {
      "canvas": {
        "enabled": true,
        "seed": 1
      },
      "webgl": {
        "enabled": true,
        "seed": 1,
        "intensity": 1
      },
      "audio": {
        "enabled": true,
        "seed": 1,
        "intensity": 1
      },
      "client_rects": {
        "enabled": true,
        "seed": 1,
        "max_offset": 1
      },
      "sensors": {
        "enabled": true,
        "seed": 1
      },
      "fonts": {
        "enabled": true,
        "seed": 1
      }
    },
    "network": {
      "blocked_ports": [
        1
      ]
    },
    "timezone": "text"
  }
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "http://127.0.0.1:40325/folders/text/profiles");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "notes": "text",
  "proxy_id": "text",
  "last_launched_at": "text",
  "created_at": "text",
  "pinned": true,
  "folder": "text",
  "color": "text",
  "extensions": [
    "text"
  ]
}
{
  "error": "text"
}

最后更新

本页内容