DocumentationA proxy per account
How to use a proxy for each social media account
Every BuzzTake 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. A proxy gives the identity its own network address. Set one proxy per identity, when you add its first account or later.
You need a BuzzTake API key, your workspace id or the account's id, and proxy addresses from your proxy provider.
1. 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:
| Form | Notes |
|---|---|
http://user:pass@host:port | HTTP proxy. Port 80 when you leave it out. |
https://user:pass@host:port | HTTP proxy over TLS. Port 443 by default. |
socks5://user:pass@host:port | SOCKS5. 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:port | No scheme: read as HTTP. |
host:port:user:pass | The four-part form many providers export: read as HTTP. |
SOCKS4 is not supported. The web app's own advice is a residential proxy in the account's usual country. Give each identity its own address.
user-country-de, cc-de or geo-de, the fingerprint gets
that country's time zone. Without a country, it uses UTC.
2. 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.
curl https://api.buzztake.com/v1/workspaces/$WORKSPACE_ID/accounts \
-H "Authorization: Bearer $BUZZTAKE_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"
}'{
"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://buzztake.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 field "Proxy (optional)" when the account gets a new identity.
3. 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 nothing is charged. 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 -X PATCH https://api.buzztake.com/v1/accounts/$ACCOUNT_ID \
-H "Authorization: Bearer $BUZZTAKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "proxy": "socks5://user:pass@198.51.100.20:1080" }'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.buzztake.com/v1";
const headers = {
Authorization: `Bearer ${process.env.BUZZTAKE_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
# 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.buzztake.com/v1"
headers = {"Authorization": f"Bearer {os.environ['BUZZTAKE_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 remove a proxy, send null or an empty string:
curl -X PATCH https://api.buzztake.com/v1/accounts/$ACCOUNT_ID \
-H "Authorization: Bearer $BUZZTAKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "proxy": null }'The new address applies the next time BuzzTake 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.
4. Check the account after a change
BuzzTake reads the URL when you save it but does not connect through it. Run a check to open the account through the new proxy. It costs 1 credit, charged when it succeeds.
POST/v1/accounts/{id}/check
curl -X POST "https://api.buzztake.com/v1/accounts/$ACCOUNT_ID/check?wait=60" \
-H "Authorization: Bearer $BUZZTAKE_API_KEY"{
"type": "check",
"status": "succeeded",
"result": { "type": "session", "state": "signed_in", "handle": "acme_demo", "display_name": "Acme Demo" },
"credits": 1
}state is signed_in, signed_out or blocked. If it is not signed_in, seehow to check and fix a signed-out account.
Common errors
- 422 invalid_input
- "
proxycould 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
- "
proxyhas no readable server host." Check the part after@. - 422 invalid_input
- "
proxymust be one URL of at most 4096 characters." - A check fails after a change
- Read
error.codeanderror.messageon the check action, then test the proxy outside BuzzTake. Fix it with anotherPATCH.
See also
- Add an account
- Account routes
- How to connect a social account with exported cookies
- How to connect an account that uses two-factor authentication
- How to post to many social media accounts at once
To run this on your own accounts, create a BuzzTake account, then add an account and an API key.