Setting Up BrowserAI

Before diving into automation, let’s grab your credentials. You’ll need your API Token, which you can find inside of your BrowserAI project.

Make sure you have Puppeteer, Playwright, or Selenium installed before proceeding.

Test Your Setup

Run the sample code below to confirm that BrowserAI is connected and working. Remember: Replace USER:PASS with your actual credentials.

const puppeteer = require('puppeteer-core');  
// Enter your zone name and password below
const AUTH = 'USER:PASS';  
const SBR_WS_ENDPOINT = `wss://${AUTH}@brd.superproxy.io:9222`;  

async function main() {  
console.log('Connecting to BrowserAI...');  
const browser = await puppeteer.connect({  
  browserWSEndpoint: SBR_WS_ENDPOINT,  
});  
try {  
  console.log('Connected! Navigating...');  
  const page = await browser.newPage();  
  // Enter your test URL below
  await page.goto('https://example.com', { timeout: 2 * 60 * 1000 });  
  console.log('Taking screenshot to page.png');  
  await page.screenshot({ path: './page.png', fullPage: true });  
console.log('Navigated! browser.ai...');  
const html = await page.content();  
console.log(html)  
} finally {  
  await browser.close();  
}  
}  

if (require.main === module) {  
main().catch(err => {  
  console.error(err.stack || err);  
  process.exit(1);  
});  
}

Live Debugging with DevTools

Want a real-time view of your BrowserAI session? Run the snippet below to auto-launch Chrome DevTools every time you start a session.

Puppeteer
const { exec } = require('child_process');  
const chromeExecutable = 'google-chrome';  
  
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));  
const openDevtools = async (page, client) => {  
    const frameId = page.mainFrame()._id;  
    const { url: inspectUrl } = await client.send('Page.inspect', { frameId });  
    exec(`"${chromeExecutable}" "${inspectUrl}"`, error => {  
        if (error)  
            throw new Error('Unable to open devtools: ' + error);  
    });  
    await delay(5000);  
};  
  
const page = await browser.newPage();  
const client = await page.target().createCDPSession();  
await openDevtools(page, client);  
await page.goto('http://example.com');

Session Limits & Timeouts

  • Single Navigation Per Session: You can load one site per session. After that, interact freely via clicks, scrolling, and JS execution.
  • Idle Timeout: Sessions inactive for 5 minutes auto-close.
  • Max Session Length: Sessions expire after 30 minutes to prevent abuse.

Run Your Script

node script.js

Final Thoughts

BrowserAI is built for serious automationno CAPTCHAs, no blocks, no rate limits. Whether you’re scraping at scale or automating workflows, this is the browser you actually need.