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

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

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

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

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

Have questions? We're here to help.

Online Support Available

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.

Afina API & Automation turns the Afina antidetect browser into a programmable workstation. Instead of stitching together third-party automation, headless Chrome and a separate profile manager, you get a local HTTP API, a CDP WebSocket, an RPA engine and a task scheduler in one platform — all working on top of isolated profiles with real browser fingerprints, isolated cookies and per-profile proxies.

Why automate inside an antidetect browser

Standard Chromium automation breaks the moment platforms start fingerprinting. Headless flags, missing fonts, identical WebGL renderers and shared cookies make every script look like the same machine — and that machine gets flagged. Afina solves this at the runtime level: every script runs inside a fingerprinted profile from the profile manager, so anti-fraud systems see a normal human session, not a bot harness.

What's inside the Afina automation stack

1. Local HTTP API on 127.0.0.1

A REST server on 127.0.0.1:50778 exposes the entire app: profiles, proxies, cookies, scripts, tasks, modules, email manager, databases and global variables. Authentication uses an x-api-key header you generate in Settings, and only localhost origins are accepted — credentials never leave the machine.

2. CDP WebSocket attach for Puppeteer and Playwright

POST /api/profiles/start returns a wsEndpoint you can plug into Puppeteer or Playwright directly. You keep the API you already know, but every command runs against a real fingerprinted profile, not headless Chrome — so detection-heavy targets like ad platforms and ticketing sites stop pattern-matching your traffic.

3. RPA scripts and a visual flow canvas

Build flows on a drag-and-drop canvas or write JS modules that run through executeModule. Launch them from your own code with POST /api/scripts/run, stream logs over Server-Sent Events, and reuse the same blocks across hundreds of accounts. No-code marketers and engineers share the same script library.

4. One-time disposable profiles

POST /api/profiles/one-time spins up a fresh profile with a unique fingerprint and hard-deletes it the moment the browser stops. Perfect for data scraping, headless checks, fingerprint validation and anything that should leave zero trace on disk.

5. Tasks, queues and the scheduler

Group accounts into task groups, set start time, parallelism, repeat count, working hours and timeouts. Afina dispatches the work across browser instances, retries failures, and exposes the queue state through the same API — so dashboards and external orchestrators can drive Afina without polling the UI.

Where teams use Afina API and Automation

Affiliate teams generate creatives and warm accounts across thousands of profiles. SEO and SMM agencies post, comment and check rankings from real residential proxies. Airdrop and Web3 farms sign transactions, claim tokens and rotate wallets without leaking common fingerprints. Data teams scrape SERPs, marketplaces and dashboards on isolated profiles. QA engineers replay flaky end-to-end flows under a different geo and time zone — all from the same API.

If you've been juggling Selenium + a profile manager + a proxy rotator + a scheduler, Afina collapses that stack into one local API with a documented surface, an MCP server for AI agents, and the same fingerprint engine the manual UI uses. Automation stops looking like automation.