Afina

Download app

AppleWindows
EN

Browser Automation API for the Afina Antidetect Browser

Drive Afina through a documented local HTTP API on 127.0.0.1:50778 — start profiles, run RPA scripts, manage proxies and cookies, attach Puppeteer or Playwright over the returned CDP WebSocket. One antidetect browser, one API, predictable behavior at scale.

Browser Automation API for the Afina Antidetect Browser
Local API • CDP • RPA

Automate routine actions without leaving your antidetect browser

Multi-account workflows fall apart when antidetect, automation and queueing live in different tools. Afina ships a local HTTP API, an RPA scripts engine, a visual flow canvas and a task scheduler in one platform — and exposes a CDP WebSocket so Puppeteer and Playwright keep working with isolated, fingerprinted profiles.

Local HTTP API

A local server on 127.0.0.1:50778 controls profiles, proxies, cookies, scripts and tasks. Auth via x-api-key — only localhost origins are accepted.

CDP WebSocket attach

POST /api/profiles/start returns a wsEndpoint you can plug into Puppeteer or Playwright directly — full devtools control over a real, isolated profile.

RPA scripts & visual flows

Build flows on a drag-and-drop canvas or run JS modules through executeModule. Launch them from your code with POST /api/scripts/run and stream the log.

One-time disposable profiles

POST /api/profiles/one-time spins up a fresh fingerprinted profile and hard-deletes it the moment the browser stops — perfect for scraping and isolated checks.

# Start a profile and get a CDP WebSocket endpoint
curl -X POST http://127.0.0.1:50778/api/profiles/start \
  -H "x-api-key: $AFINA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"profileId":"1d64f838-a1b8-47de-8a3f-9cebf859c375"}'

# Response
{
  "msg": "success",
  "wsEndpoint": "ws://127.0.0.1:9223/devtools/browser/abcd-...",
  "data": { "port": 9223 }
}

FAQs

Afina exposes a local HTTP API on 127.0.0.1:50778 that controls everything the desktop app does — profiles, sessions, proxies, cookies, RPA scripts, modules and task groups. Calls are authenticated with an x-api-key header and only accepted from localhost origins. Your own code drives the antidetect browser directly instead of scraping the UI.

The server starts automatically when Afina launches. Base URL is http://127.0.0.1:50778 (the desktop app tries the next ports if 50778 is busy). You generate the API key in Settings → General → API key inside Afina and pass it on every request as x-api-key: YOUR_KEY. Without the key the connection is silently closed; CORS only allows http://localhost, http://127.0.0.1 and tauri:// origins.

Yes. POST /api/profiles/start returns a wsEndpoint like ws://127.0.0.1:9223/devtools/browser/... — feed it into puppeteer.connect({ browserWSEndpoint }) or chromium.connectOverCDP() and you have full DevTools Protocol control over a real, isolated antidetect profile with the right fingerprint and proxy.

POST /api/scripts/run with { profileId, scriptId } starts the script and returns a task uuid immediately. Stream the live text log with GET /api/scripts/run-logs?uuid=… while the script runs. For scheduled, repeatable batches use task groups (POST /api/task-groups/create) and tasks — Afina handles the queue, parallelism limit, time-window scheduling and retries.

POST /api/profiles/one-time creates a fresh profile with a unique fingerprint, starts the browser and returns a wsEndpoint — and as soon as the browser stops (manually, via stop endpoint or browser.close from Puppeteer) Afina hard-deletes the profile, files and remote record automatically. Ideal for web scraping, isolated checks and throw-away accounts you don't want to maintain.

Both work. Afina ships a visual flow canvas where you chain clicks, navigations, waits, conditionals and data steps with drag-and-drop — so analysts and ops engineers can ship automations without writing code. When you need raw power, drop into the built-in scripts engine and write JavaScript or call Node.js modules via executeModule.

Yes. Task groups schedule and execute tasks on hundreds of profiles concurrently with explicit limits (activeSession, timeout, time-window, repeatCount). Profiles can be grouped by use case or client and queried via GET /api/profiles/list filters. Live logs and per-task status (waiting / working / finished / error / stop) make a batch run observable end-to-end.

Puppeteer and Playwright drive an off-the-shelf Chromium — no isolated profiles, no real device fingerprints, no multi-account session management, no built-in proxy and cookie store. Afina ships those primitives natively and exposes them through one API plus a CDP WebSocket, so you keep your favourite tooling while every account looks like a separate real device.

Start automating in minutes

Spin up isolated profiles, hit the local API and ship your first flow today — the same browser your team already uses.

Local API & browser automation | Afina