For the complete documentation index, see llms.txt. This page is also available as Markdown.

Agent Browser

A cloud-based headless browser with built-in adaptive security, CAPTCHA management, and residential proxies. Test it with code samples and customize with advanced features.

Agent Browser allows you to run and control remote instances for browser-based automation, testing, and web scraping without managing them locally. It provides built-in adaptive security, automatic CAPTCHA handling, geotargeting, integrated residential proxies, session recording, sticky sessions, and persistent profiles.

Supported libraries

Agent Browser works with any library that supports the Chrome DevTools Protocol (CDP), including:

Connection details

Field
Description

Protocol

wss:// (WebSocket Secure)

Host (Chromium)

hb.oxylabs.io

Authentication

In the URL, user info – wss://USERNAME:PASSWORD@host. Must include username suffix token (e.g. user_ab12). Building custom Authorization headers is not recommended.

Transport

CDP – chromium.connectOverCDP (Playwright) / puppeteer.connect (Puppeteer).

Domain

oxylabs.io – used for connection endpoints (e.g. hb.oxylabs.io), the Dashboard (hb.oxylabs.io/dashboard), and session inspection (hb.oxylabs.io/novnc).

Rate limits

100 concurrent sessions, 10 session per second. See more.

Features

Oxylabs Agent Browser includes built-in, cloud-native features designed to be used through query parameters to your WebSocket connection URL.

Identify every page, handle supported challenges and track page state (default – off).

Identify pages and handle access challenges automatically (default – off).

Select the browser engine and fingerprint profiles.

Route sessions through specific countries, states, or cities.

Emulate device-specific fingerprints and viewports.

Monitor live headless browser sessions.

Record browser sessions in video format.

Create and manage sticky browser instances.

Save and restore cookies/localStorage across sessions.

Passing parameters

All features are enabled and configured by appending query parameters directly to your WebSocket Secure endpoint by chaining multiple features together using ampersands (&).

Integrations

Connect Stagehand and browser-use to open live session inspection.

Set up Agent Browser in Claude Code, Cursor and other AI coding assistants.

Give MCP-compatible AI assistants a remote Agent Browser.

Code examples

Below are basic examples to initialize a cloud-hosted browser session:

Note: Examples use USERNAME and PASSWORD for readability only. In real projects, load them from environment variables (e.g. process.env.OXYLABS_USERNAME / process.env.OXYLABS_PASSWORD) via a .env file.

Parameter reference

Parameter
Description
Type

p_cc

Country geolocation in ISO 3166-1 alpha-2 2-letter code (e.g., US, DE).

string

p_state

State geolocation in lowercase (e.g., texas). Overrides p_cc if both are used. Supported states list.

string

p_city

City geolocation, lowercase, _ for spaces (e.g., new_york). p_cc / p_state required.

string

p_device

Set device fingerprints, viewports, and user-agents. Supports desktop (default) and mobile.

string

p_src

Browser engine. Supports oxybrowser proprietary engine. If omitted, the standard engine is used. See Engine & Fingerprints.

string

p_fp_tag

Fingerprint profile: oxyfp_win (default), oxyfp_mac, oxyfp_mac_optimized (only with p_src=oxybrowser), oxyfp_win_v1 (legacy). See Engine & Fingerprints.

string

page_handler

Identify pages and handle access challenges automatically. Default: false. See Page Handler.

boolean

solve_captcha

Automatic, real-time CAPTCHA solving on page loads. Default: false.

boolean

record

Record headless session video. Default: false.

boolean

record_name

Name the recording for easy lookup (^[a-zA-Z0-9_-]{1,64}$).

string

session_name

Sticky sessions. Reconnects to the same live remote browser (^[A-Za-z0-9-]{3,36}$, supports hyphens, no underscores). Max TTL – 24h.

string

keep_alive

Keeps the remote browser instance live on client disconnect when set to true. Requires session_name. Default: false.

boolean

o_profile

Persistent profiles – save/restore cookies and localStorage with a named profile (^[a-zA-Z0-9][a-zA-Z0-9_-]{2,35}$).

string

o_profile_save

Persistent profiles – force profile save during or at the end of the session. Requires o_profile. Default: false.

boolean

proxy_resi_ses_id

Custom session ID to pin residential exit IP across sessions (^[A-Za-z0-9]{3,36}$).

string

proxy_resi_ses_time

Duration to hold the pinned residential proxy exit IP in minutes. Min 1, max 1440 (24h).

integer

Optimizing traffic

Scraping dynamic pages often causes the browser to download unnecessary assets such as heavy media, tracking scripts, images, and fonts. This consumes bandwidth and slows down execution times.

You can intercept and abort these requests programmatically before they consume resources:

Error handling and retries

Network hiccups and 10-sessions-per-second rate limit mean a single connectOverCDP call can fail transiently. Wrap connection in a retry with exponential backoff, and cap each attempt with a timeout. The example below uses standard Playwright API.

For the full list of handshake, WebSocket close and in-page errors, see Response Codes.

Resource cleanup

Always close the browser when you are done, even if your automation throws midway. Use a try { ... } finally { ... } block so cleanup runs on every path:

If an exception occurs between connect and close and you do not clean up, the remote session stays open and consumes one of your 100 concurrent sessions until it is reclaimed. Leaking sessions under load can exhaust the limit and block new connections.

Need a feature enabled?

Some Agent Browser features are limited by default. To adjust your limits, contact Oxylabs support (live chat or email) or your Dedicated Account Manager:

  • More persistent profiles – raise your account's default cap of 5 saved profiles.

  • More persistent sessions – raise your account's default cap of 5 concurrent persistent sessions.

  • Restricted targets – unlock more target categories via KYC process.

  • Higher rate limits – increase beyond 100 concurrent sessions / 10 per second.

Last updated

Was this helpful?