Skip to content
ViceVox
MenuClose
DocumentationA proxy per account

How to use a proxy for each social media account

Last updated

Every ViceVox account belongs to an identity, one person or brand. The accounts of an identity share one browser profile, one fixed device fingerprint, and one proxy or location. A proxy gives the identity its own network address. Set one proxy per identity, when you add its first account or later. An identity without a proxyuses a location of the ViceVox network.

You need a ViceVox API key, your workspace id or the account's id, and proxy addresses from your proxy provider.

Write the proxy as one URL

The proxy field takes one URL of at most 4,096 characters. Put the login in the URL. These forms work:

FormNotes
http://user:pass@host:portHTTP proxy. Port 80 when you leave it out.
https://user:pass@host:portHTTP proxy over TLS. Port 443 by default.
socks5://user:pass@host:portSOCKS5. Port 1080 by default. socks5h:// is read as socks5.
ss://...Shadowsocks, as your provider gives it. shadowsocks:// also works.
vless://... vmess://... trojan://...The share links these protocols use.
hysteria2://...Hysteria 2. hy2:// also works.
host:portNo scheme: read as HTTP.
host:port:user:passThe four-part form many providers export: read as HTTP.

SOCKS4 is not supported. A residential proxy in the account's usual country keeps the account safer. Give each identity its own address.

Tip: Set the proxy before the identity's first sign-in. ViceVox makes its device fingerprint once, at its first browser launch, and never changes it. If the proxy login names a country, such as user-country-de, cc-de or geo-de, the fingerprint gets that country's time zone. Without a country, it uses UTC.

Set the proxy when you add the account

POST/v1/workspaces/{workspace_id}/accounts

Add proxy next to connect. It works with every connect method; this example uses a sign-in link. proxy is for an account that gets a new identity. With identity_id, the account joins that identity and uses its proxy: sending proxy too is a 422.

Request
curl https://api.vicevox.com/v1/workspaces/$WORKSPACE_ID/accounts \
  -H "Authorization: Bearer $VICEVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "x",
    "label": "Brand X (Germany)",
    "connect": { "method": "browser" },
    "proxy": "http://user-country-de:secret@203.0.113.7:8000"
  }'
201 Created (trimmed)
{
  "account": {
    "id": "0199a1b2-...",
    "status": "connecting",
    "proxy": { "configured": true, "scheme": "http", "host": "203.0.113.7" }
  },
  "action": { "id": "0199c3d4-...", "type": "connect", "status": "queued" },
  "sign_in_url": "https://vicevox.com/connect/bts_..."
}

The account shows the proxy's scheme and host. It never shows the port, the user or the password. In the web app, the third step of "Add account" has the fields "Location" and "Proxy (optional)" when the account gets a new identity.

Change the proxy of one identity or many

PATCH/v1/identities/{id}

PATCH/v1/accounts/{id}

Send the new URL in proxy, on the identity or on one of its accounts. Every account of the identity uses it. No sign-in runs and no usage is used. On an account, the answer is the updated account, and proxy_account_ids lists every account that uses the new proxy. In the web app, open the identity from the account list. An identity holds at most one X account, so this script gives the identity of each X account in a workspace its own line from a file of proxies:

curl

curl
curl -X PATCH https://api.vicevox.com/v1/accounts/$ACCOUNT_ID \
  -H "Authorization: Bearer $VICEVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "proxy": "socks5://user:pass@198.51.100.20:1080" }'

JavaScript

JavaScript
// Give the identity of every X account in the workspace its own proxy, one line of proxies.txt each.
import { readFileSync } from "node:fs";

const api = "https://api.vicevox.com/v1";
const headers = {
  Authorization: `Bearer ${process.env.VICEVOX_API_KEY}`,
  "Content-Type": "application/json",
};
const proxies = readFileSync("proxies.txt", "utf8").split("\n").filter(Boolean);

const res = await fetch(
  `${api}/workspaces/${process.env.WORKSPACE_ID}/accounts?platform=x&limit=100`,
  { headers },
);
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const { accounts } = await res.json();
if (accounts.length > proxies.length) throw new Error("Not enough proxies for every account.");

for (const [index, account] of accounts.entries()) {
  const update = await fetch(`${api}/accounts/${account.id}`, {
    method: "PATCH",
    headers,
    body: JSON.stringify({ proxy: proxies[index] }),
  });
  if (!update.ok) throw new Error(`${account.id}: ${await update.text()}`);
  const { proxy } = await update.json();
  console.log(account.label, proxy.scheme, proxy.host);
}

Python

Python
# Give the identity of every X account in the workspace its own proxy, one line of proxies.txt each.
import os
import requests

api = "https://api.vicevox.com/v1"
headers = {"Authorization": f"Bearer {os.environ['VICEVOX_API_KEY']}"}
with open("proxies.txt", encoding="utf-8") as f:
    proxies = [line.strip() for line in f if line.strip()]

resp = requests.get(
    f"{api}/workspaces/{os.environ['WORKSPACE_ID']}/accounts",
    params={"platform": "x", "limit": 100},
    headers=headers,
    timeout=30,
)
if not resp.ok:
    raise SystemExit(f"{resp.status_code}: {resp.text}")
accounts = resp.json()["accounts"]
if len(accounts) > len(proxies):
    raise SystemExit("Not enough proxies for every account.")

for account, proxy_url in zip(accounts, proxies):
    update = requests.patch(
        f"{api}/accounts/{account['id']}",
        headers=headers,
        json={"proxy": proxy_url},
        timeout=30,
    )
    if not update.ok:
        raise SystemExit(f"{account['id']}: {update.text}")
    proxy = update.json()["proxy"]
    print(account["label"], proxy["scheme"], proxy["host"])

The account list returns 50 accounts unless you set limit, and next_cursor names the next page. To put the identity on the ViceVox network, send null or an empty string. ViceVox picks a location:

Use the ViceVox network
curl -X PATCH https://api.vicevox.com/v1/accounts/$ACCOUNT_ID \
  -H "Authorization: Bearer $VICEVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "proxy": null }'

The new address applies the next time ViceVox starts the identity's browser. A browser stays open for about 2 minutes after each run, so an action in that time can still use the old address.

Check the account after a change

ViceVox reads the URL when you save it but does not connect through it. Run a check to open the account through the new proxy.

POST/v1/accounts/{id}/check

Request
curl -X POST "https://api.vicevox.com/v1/accounts/$ACCOUNT_ID/check?wait=60" \
  -H "Authorization: Bearer $VICEVOX_API_KEY"
200 OK (trimmed)
{
  "type": "check",
  "status": "succeeded",
  "result": { "type": "session", "state": "signed_in", "handle": "acme_demo", "display_name": "Acme Demo" }
}

state is signed_in, signed_out or blocked. If it is not signed_in, seehow to check and fix a signed-out account.

Without a proxy, an identity uses a location

Every identity uses its own proxy or a location of the ViceVox network. No browser uses the address of a ViceVox server. Without a proxy, ViceVox picks a location. To choose one, read the list:

GET/v1/locations

Request
curl https://api.vicevox.com/v1/locations \
  -H "Authorization: Bearer $VICEVOX_API_KEY"
200 OK (trimmed)
{
  "locations": [
    { "code": "us-nyc", "country": "US", "city": "New York" },
    { "code": "de-fra", "country": "DE", "city": "Frankfurt" }
  ]
}

Send a code as location when you add the account, or later on the identity or on one of its accounts. It replaces a proxy from the next browser start. In the web app, open the identity from the account list.

PATCH/v1/identities/{id}

Request
curl -X PATCH https://api.vicevox.com/v1/identities/$IDENTITY_ID \
  -H "Authorization: Bearer $VICEVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "location": "de-fra" }'
  • A location is a data-center address. Platforms trust it less than a residential address.
  • Many identities can share one location and its address.
  • A new device fingerprint gets the location's time zone.
  • Traffic on the network reaches only the social platforms ViceVox drives and what their pages need, such as their sign-in and captcha providers, plus the identity's own Mastodon servers. A live browser on the network cannot open other sites.

Common errors

422 invalid_input
"An identity uses its own proxy or a location: send proxy or location, not both."
422 invalid_input
"that location does not exist: GET /v1/locations lists them"
422 invalid_input
"proxy could not be read (unusable proxy: unsupported scheme socks4). Use a URL such as http://user:pass@203.0.113.7:8000, socks5://..., ss://..., vless://..., vmess://..., trojan://... or hysteria2://..."
422 invalid_input
"proxy has no readable server host." Check the part after @.
422 invalid_input
"proxy must be one URL of at most 4096 characters."
A check fails after a change
Read error.code and error.message on the check action, then test the proxy outside ViceVox. Fix it with another PATCH.

See also

To run this on your own accounts, create a ViceVox account, then add an account and an API key.