Anti-Detect Browser API: Automation Guide 2026

Anti-Detect Browser API: Automation Guide 2026

Manual multi-account management does not scale. Anti-detect browser APIs let you programmatically create profiles, start browsers, and connect automation frameworks like Selenium, Puppeteer, and Playwright — combining the stealth of anti-detect fingerprinting with the power of browser automation.

API Capabilities Comparison

FeatureMultilogin XGoLoginAdsPowerDolphin Anty
REST APIYesYesYesYes (local)
Create profilesYesYesYesYes
Start/stop profilesYesYesYesYes
Selenium supportYesYesYesYes
Puppeteer supportYesYesYesYes
Playwright supportYesYesLimitedLimited
Bulk operationsYesYesYesYes
Cloud APIYesYesYesNo (local only)
API docs qualityVery goodGoodGoodGood

Selenium Integration

Universal Pattern

All anti-detect browsers follow the same integration pattern with Selenium:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import requests
import time

class AntiDetectAutomation:
    def __init__(self, api_url, api_token):
        self.api_url = api_url
        self.headers = {
            "Authorization": f"Bearer {api_token}",
            "Content-Type": "application/json"
        }

    def start_profile(self, profile_id):
        """Start an anti-detect browser profile."""
        response = requests.get(
            f"{self.api_url}/profile/{profile_id}/start",
            headers=self.headers
        )
        data = response.json()
        return data  # Contains debug port or WebSocket URL

    def connect_selenium(self, debug_port):
        """Connect Selenium WebDriver to the running profile."""
        options = Options()
        options.debugger_address = f"127.0.0.1:{debug_port}"
        driver = webdriver.Chrome(options=options)
        return driver

    def stop_profile(self, profile_id):
        """Stop the browser profile."""
        requests.get(
            f"{self.api_url}/profile/{profile_id}/stop",
            headers=self.headers
        )

    def automate_task(self, profile_id, task_func):
        """Run a task on a specific profile."""
        profile_data = self.start_profile(profile_id)
        driver = self.connect_selenium(profile_data["port"])

        try:
            result = task_func(driver)
            return result
        finally:
            driver.quit()
            self.stop_profile(profile_id)

# Example usage
def check_account_status(driver):
    """Check if account is still active."""
    driver.get("https://www.example.com/account")
    time.sleep(3)
    status = driver.find_element("css selector", ".account-status")
    return status.text

automation = AntiDetectAutomation("https://api.multilogin.com", "your_token")
result = automation.automate_task("profile-uuid", check_account_status)
print(f"Account status: {result}")

Multilogin X Selenium

import requests
from selenium import webdriver

# Multilogin X API
ML_API = "https://api.multilogin.com"
ML_TOKEN = "your_api_token"

def multilogin_selenium(profile_id):
    headers = {"Authorization": f"Bearer {ML_TOKEN}"}

    # Start profile
    start_resp = requests.get(f"{ML_API}/profile/{profile_id}/start", headers=headers)
    port = start_resp.json()["selenium_port"]

    # Connect Selenium
    options = webdriver.ChromeOptions()
    options.debugger_address = f"127.0.0.1:{port}"
    driver = webdriver.Chrome(options=options)

    return driver

GoLogin Selenium

import requests
from selenium import webdriver

GL_API = "https://api.gologin.com"
GL_TOKEN = "your_token"

def gologin_selenium(profile_id):
    headers = {"Authorization": f"Bearer {GL_TOKEN}"}

    # Start profile
    start_resp = requests.get(f"{GL_API}/browser/{profile_id}/start", headers=headers)
    data = start_resp.json()

    # Connect Selenium
    options = webdriver.ChromeOptions()
    options.debugger_address = f"127.0.0.1:{data['port']}"
    driver = webdriver.Chrome(options=options)

    return driver

Dolphin Anty Selenium (Local API)

import requests
from selenium import webdriver

ANTY_LOCAL = "http://localhost:3001/v1.0"

def dolphin_selenium(profile_id):
    # Start profile
    start_resp = requests.get(f"{ANTY_LOCAL}/browser_profiles/{profile_id}/start?automation=1")
    data = start_resp.json()

    # Connect via WebSocket
    options = webdriver.ChromeOptions()
    options.debugger_address = f"127.0.0.1:{data['automation']['port']}"
    driver = webdriver.Chrome(options=options)

    return driver

Puppeteer Integration

const puppeteer = require('puppeteer-core');
const axios = require('axios');

async function connectToPuppeteer(profileId, apiUrl, apiToken) {
    // Start profile
    const response = await axios.get(`${apiUrl}/profile/${profileId}/start`, {
        headers: { 'Authorization': `Bearer ${apiToken}` }
    });

    const { port } = response.data;

    // Connect Puppeteer
    const browser = await puppeteer.connect({
        browserURL: `http://127.0.0.1:${port}`,
        defaultViewport: null
    });

    const pages = await browser.pages();
    const page = pages[0] || await browser.newPage();

    return { browser, page };
}

// Usage
async function main() {
    const { browser, page } = await connectToPuppeteer(
        'profile-uuid',
        'https://api.gologin.com',
        'your_token'
    );

    await page.goto('https://www.example.com');
    const title = await page.title();
    console.log(`Page title: ${title}`);

    await browser.disconnect();
}

Playwright Integration

from playwright.sync_api import sync_playwright
import requests

def playwright_antidetect(profile_id, api_url, token):
    """Connect Playwright to an anti-detect browser profile."""
    headers = {"Authorization": f"Bearer {token}"}

    # Start profile
    resp = requests.get(f"{api_url}/profile/{profile_id}/start", headers=headers)
    ws_url = resp.json().get("ws_url")

    with sync_playwright() as p:
        browser = p.chromium.connect_over_cdp(ws_url)
        context = browser.contexts[0]
        page = context.pages[0] if context.pages else context.new_page()

        page.goto("https://www.example.com")
        print(page.title())

        browser.close()

Batch Automation Patterns

Sequential Profile Processing

def process_all_profiles(profile_ids, task_func, delay=30):
    """Process multiple profiles sequentially with delays."""
    results = {}
    for profile_id in profile_ids:
        try:
            result = automation.automate_task(profile_id, task_func)
            results[profile_id] = {"status": "success", "data": result}
        except Exception as e:
            results[profile_id] = {"status": "error", "error": str(e)}

        time.sleep(delay)  # Delay between profiles

    return results

Parallel Profile Processing

from concurrent.futures import ThreadPoolExecutor, as_completed

def process_profiles_parallel(profile_ids, task_func, max_workers=5):
    """Process multiple profiles in parallel."""
    results = {}
    with ThreadPoolExecutor(max_workers=max_workers) as executor:
        futures = {
            executor.submit(automation.automate_task, pid, task_func): pid
            for pid in profile_ids
        }
        for future in as_completed(futures):
            pid = futures[future]
            try:
                results[pid] = {"status": "success", "data": future.result()}
            except Exception as e:
                results[pid] = {"status": "error", "error": str(e)}
    return results

Error Handling Best Practices

ErrorCauseRecovery
Profile start timeoutProxy unreachableRetry with backup proxy
Selenium connection refusedProfile not readyWait 5 seconds, retry
Element not foundPage layout changedUpdate selectors, screenshot for debug
CAPTCHA encounteredDetection triggeredPause automation, manual solve
Account lockedToo many actionsCool down 24-48 hours
API rate limitToo many API callsImplement exponential backoff

Internal Linking

FAQ

Which anti-detect browser has the best API?

Multilogin X has the most comprehensive and well-documented REST API, supporting full CRUD operations on profiles, proxy management, and browser control. GoLogin’s API is also solid and well-documented. AdsPower offers a good API plus built-in RPA for no-code automation. Choose based on your technical level and automation needs.

Can I run automation 24/7 with anti-detect browsers?

Technically yes, but it is not recommended for account-based operations. Platforms flag accounts that are active 24/7 since real users sleep. Schedule automation during realistic hours (8 AM – 11 PM in the account’s timezone) with natural breaks. For data scraping (not account management), 24/7 operation with rotating profiles is standard.

How many profiles can I automate simultaneously?

Hardware is the limiting factor — each running profile consumes 500MB-1GB RAM. On a 32GB server, you can run 15-25 profiles simultaneously. For larger scale, use multiple servers or process profiles sequentially. Cloud anti-detect APIs (Multilogin X, GoLogin) offload some processing but still require local Selenium/Puppeteer connections.

Should I use Selenium, Puppeteer, or Playwright?

Selenium (Python) is the most widely supported across all anti-detect browsers. Puppeteer (Node.js) integrates well with GoLogin and Dolphin Anty. Playwright (Python/Node.js) is newer and has limited but growing support. For the broadest compatibility, use Selenium. For performance, Playwright is fastest but check your anti-detect browser’s compatibility first.

How do I avoid detection when automating?

Add random delays between actions (2-10 seconds), randomize mouse movements and scroll patterns, avoid exact timing patterns, do not perform more actions than a human would, take screenshots at key steps for debugging, and implement exponential backoff when errors occur. The automation should mimic human browsing speed and patterns.


Related Reading

Scroll to Top