Every session runs in a hardened Chromium fork with stealth, anti-fingerprinting, and residential proxies enabled by default — no configuration needed.
Option 1: WebSocket URL (no SDK)
Connect with a single URL. All configuration is passed as query parameters.
Playwright
from playwright.async_api import async_playwright
WSS_URL = "wss://connect.browser-use.com?apiKey=YOUR_API_KEY&proxyCountryCode=us"
async with async_playwright() as p:
browser = await p.chromium.connect_over_cdp(WSS_URL)
page = browser.contexts[0].pages[0]
await page.goto("https://example.com")
print(await page.title())
await browser.close()
# Browser is automatically stopped when the WebSocket disconnects
Puppeteer
import puppeteer from "puppeteer-core";
const WSS_URL = "wss://connect.browser-use.com?apiKey=YOUR_API_KEY&proxyCountryCode=us";
const browser = await puppeteer.connect({ browserWSEndpoint: WSS_URL });
const [page] = await browser.pages();
await page.goto("https://example.com");
console.log(await page.title());
await browser.close();
Selenium
Selenium requires a local WebSocket proxy to connect to Browser Use’s remote CDP endpoint. Use selenium-wire or connect through Playwright’s CDP bridge instead:
from playwright.sync_api import sync_playwright
WSS_URL = "wss://connect.browser-use.com?apiKey=YOUR_API_KEY&proxyCountryCode=us"
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(WSS_URL)
page = browser.contexts[0].pages[0]
page.goto("https://example.com")
print(page.title())
browser.close()
Selenium’s debugger_address only supports local host:port connections. For remote CDP over WebSocket, use Playwright or Puppeteer instead.
Query parameters
| Parameter | Type | Description |
|---|
apiKey | string | Required. Your Browser Use API key. |
proxyCountryCode | string | Proxy country code (e.g. us, de, jp). 195+ countries. |
profileId | string | Load a saved browser profile (cookies, localStorage). |
timeout | int | Session timeout in minutes. Default: 15. Max: 240 (4 hours). |
browserScreenWidth | int | Browser width in pixels. |
browserScreenHeight | int | Browser height in pixels. |
Option 2: SDK
Create a browser via the SDK, get a cdp_url, and connect with Playwright or Puppeteer.
Playwright
from browser_use_sdk.v3 import AsyncBrowserUse
from playwright.async_api import async_playwright
client = AsyncBrowserUse()
browser = await client.browsers.create()
print(browser.cdp_url) # https://uuid.cdpN.browser-use.com
print(browser.live_url) # https://live.browser-use.com?wss=...
async with async_playwright() as p:
pw_browser = await p.chromium.connect_over_cdp(browser.cdp_url)
page = pw_browser.contexts[0].pages[0]
await page.goto("https://example.com")
print(await page.title())
await pw_browser.close()
await client.browsers.stop(browser.id)
Puppeteer
import { BrowserUse } from "browser-use-sdk/v3";
import puppeteer from "puppeteer-core";
const client = new BrowserUse();
const browser = await client.browsers.create();
// Puppeteer needs the WebSocket URL from /json/version
const resp = await fetch(`${browser.cdpUrl}/json/version`);
const { webSocketDebuggerUrl } = await resp.json();
const pwBrowser = await puppeteer.connect({ browserWSEndpoint: webSocketDebuggerUrl });
const [page] = await pwBrowser.pages();
await page.goto("https://example.com");
console.log(await page.title());
await pwBrowser.close();
await client.browsers.stop(browser.id);
Always stop browser sessions when done. Sessions left running will continue to incur charges until the timeout expires.