BROWSY ANTYby AGR Buy on Telegram
How-to guides

The BROWSY ANTY Automation API: an Easy Manual with Examples

By AGR · · 6 min read App features of version 1.1.3

The BROWSY ANTY Automation API: an Easy Manual with Examples

The Automation API lets your own scripts work with your profiles: list them, create one, open one, drive it and close it. It runs inside BROWSY ANTY on your PC, so nothing goes through the internet. This manual starts from zero. You need BROWSY ANTY 1.1.3 or newer on Windows.

What a script can do

  • List all profiles with engine, system, notes, tags, status label and proxy (never the password).
  • Create a profile with the same fields as the New profile form.
  • Open a profile the way the Launch button does, with the same checks: plan, proxy, Google and the launch checks.
  • Drive a Chromium or Chrome profile with Playwright, Puppeteer or Selenium. The pages your script opens are pages of that profile: same device, language, time zone, proxy and cookies as the pages you open by hand.
  • Close it. Cookies and storage are saved, as with Stop.

Firefox and Camoufox profiles can be opened and closed through the API, for you to work in. A script cannot drive them.

Step 1: switch it on

Open Settings and scroll to Automation API. Tick Local API for my scripts. The app makes your key at once. Until you tick it, the API answers nothing at all.

Automation API in Settings: address, key and examples for Playwright, Puppeteer and Selenium
The Automation API in Settings: address, key and examples Version 1.1.3, demo data.

Step 2: copy the address and the key

  • Address: http://127.0.0.1:8790/api/v1 on a normal installation. Settings shows yours.
  • API key: it starts with ba_. Press Show to see it and Copy to copy it. Keep it like a password.
  • New key makes the old key stop working at once. Use it if the key was shared by mistake.

Every request carries the key in one header: Authorization: Bearer YOUR_KEY.

Step 3: your first request

Open PowerShell, paste these two lines and put your key in the first one:

$H = @{ Authorization = "Bearer YOUR_KEY" }
(Invoke-RestMethod "http://127.0.0.1:8790/api/v1/profiles" -Headers $H).profiles | Format-Table name, engine, running, proxy

You see your profiles. The Settings panel has this example and the ones below with your own key already in them: press Copy example.

Step 4: open a profile and drive it with Python

Install the two packages once with pip install requests playwright. Then:

import requests
from playwright.sync_api import sync_playwright

API = "http://127.0.0.1:8790/api/v1"
H = {"Authorization": "Bearer YOUR_KEY"}
name = "SHOP DE"

r = requests.post(f"{API}/profiles/{name}/start", json={"timeout": 600}, headers=H, timeout=660).json()
if not r["ok"]:
    raise SystemExit(r["error"])
with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(r["profile"]["automation"]["http"])
    page = browser.contexts[0].new_page()
    page.goto("https://example.com")
    print(page.title())
    browser.close()
requests.post(f"{API}/profiles/{name}/stop", headers=H)

What happens, line by line:

  1. start opens the profile like Launch. The answer comes when the browser is open and holds automation.http, the address of that browser on your PC.
  2. connect_over_cdp attaches Playwright to it. browser.contexts[0] is the profile, with its cookies.
  3. browser.close() only lets go of the browser. The profile stays open.
  4. stop closes the profile and saves its cookies.

A new profile warms up at its first launch, which takes a few minutes. That is why the example waits up to 600 seconds. Later launches open in seconds.

Node and Puppeteer

Install with npm i puppeteer-core (Node 18 or newer):

const puppeteer = require('puppeteer-core');
const API = 'http://127.0.0.1:8790/api/v1';
const H = { Authorization: 'Bearer YOUR_KEY', 'Content-Type': 'application/json' };

(async () => {
  const name = 'SHOP DE';
  const r = await (await fetch(`${API}/profiles/${encodeURIComponent(name)}/start`, { method: 'POST', headers: H, body: '{"timeout": 600}' })).json();
  if (!r.ok) throw new Error(r.error);
  const browser = await puppeteer.connect({ browserURL: r.profile.automation.http, defaultViewport: null });
  const page = await browser.newPage();
  await page.goto('https://example.com');
  console.log(await page.title());
  await browser.disconnect();
  await fetch(`${API}/profiles/${encodeURIComponent(name)}/stop`, { method: 'POST', headers: H, body: '{}' });
})();

defaultViewport: null matters: without it Puppeteer gives every new page a small window of its own instead of the profile's.

Selenium

Selenium attaches to the open browser through its port. It needs a chromedriver of the same Chrome version as the profile's engine; the answer of start shows that version in automation.browser.

import requests
from selenium import webdriver

API = "http://127.0.0.1:8790/api/v1"
H = {"Authorization": "Bearer YOUR_KEY"}
r = requests.post(f"{API}/profiles/SHOP DE/start", json={"timeout": 600}, headers=H, timeout=660).json()

options = webdriver.ChromeOptions()
options.debugger_address = f"127.0.0.1:{r['profile']['automation']['port']}"
driver = webdriver.Chrome(options=options)
driver.get("https://example.com")
print(driver.title)
requests.post(f"{API}/profiles/SHOP DE/stop", headers=H)

Create a profile from a script

The fields are those of the New profile form, for example name, engine, os_family, proxy_url and notes. Your plan's profile limit counts as usual.

$body = @{ name = "SHOP IT"; engine = "chromium"; os_family = "windows"; proxy_url = "host:port:user:password"; notes = "#shops" } | ConvertTo-Json
Invoke-RestMethod "http://127.0.0.1:8790/api/v1/profiles" -Method Post -Headers $H -ContentType "application/json" -Body $body

All requests

RequestWhat it does
GET /statusApp, version, number of profiles and how many are open
GET /profilesEvery profile: name, engine, os, running, notes, tags, status label, proxy, country, created, edited and last used
GET /profiles/{name}One profile. While it is open for a script: automation.http, ws, port and browser
POST /profilesA new profile with the fields of the New profile form
POST /profiles/{name}/startOpens it. Options: automation (true for Chromium and Chrome), wait, timeout in seconds
POST /profiles/{name}/stopCloses it. Cookies and storage are saved

When something goes wrong

Every answer has ok, and error in plain words when something is not right.

AnswerMeaningWhat to do
401The key is missing or wrongCopy the key again from Settings
403The API is off, or the request came from a web pageTick the switch. Call it from a script, not from a website
402The plan or the free day does not allow this launchChoose a plan, or use one of the profiles your plan allows
404No profile with that nameCheck the name, also its spaces and capitals
409A launch check stopped it, for example a missing or failed proxyRead issues in the answer and fix the profile in the app
400A script cannot drive this engineUse a Chromium or Chrome profile, or start it with automation false
502The browser closed before it was openThe answer's log shows the last lines of the launch
504Still opening (a first launch warms up first)Ask GET /profiles/{name} a moment later

Good habits

  • One profile for one account, also when a script uses it.
  • Close profiles with stop, so their cookies are saved.
  • Use automation only where the website allows it, and read its terms.
  • Keep the key private. If it was shared by mistake, press New key.

More about the tool itself: Automation API.

Frequently asked questions

Can a website or another PC use the API?

No. It answers only on this PC, never to a web page, and every request needs your key.

Which engines can a script drive?

Chromium and Chrome profiles. Firefox and Camoufox profiles can be opened and closed through the API, for you to work in.

Does a profile opened by a script count against my plan?

Yes. It is a launch like any other, with the same plan limits.

Must the app stay open?

Yes. The API is part of the app. Closing the app window closes the profiles and the API with it.

Is the API on by default?

No. It stays off until you tick Local API for my scripts in Settings, and you can switch it off again at any time.

Tools for this

How-to guidesBrowser profilesWindows

Try BROWSY ANTY

Many browser profiles on Windows, each aligned with its proxy. Try it free for a day with one profile, no account needed.