Skip to main content

Minimal cloud browser SDK for browser-use — session lifecycle management via CDP.

Project description

browser-use-lite

Minimal cloud browser SDK for browser-use — session lifecycle management via CDP.

Install

pip install browser-use-lite

Quick Start

from browser_use_lite import BrowserUseCloud

client = BrowserUseCloud(api_key="bu-...")  # or set BROWSER_USE_API_KEY env var

# Create a cloud browser session
session = client.sessions.create()
print(session.cdp_url)    # wss://...
print(session.session_id)

# Use with Playwright
from playwright.sync_api import sync_playwright
with sync_playwright() as pw:
    browser = pw.chromium.connect_over_cdp(session.cdp_url)
    page = browser.contexts[0].new_page()
    page.goto("https://example.com")

# Cleanup
client.sessions.delete(session.session_id)

# Or use context manager for auto-cleanup
with client.sessions.create() as session:
    ...  # session auto-deleted on exit

Session CRUD

session = client.sessions.create()       # POST /browsers
info    = client.sessions.get(session_id) # GET  /browsers/{id}
items   = client.sessions.list()          # GET  /browsers
client.sessions.delete(session_id)        # PATCH /browsers/{id} (stop)

Proxy Support

from browser_use_lite import ManagedProxyConfig, ProxyConfig

# Managed proxy (200+ countries)
session = client.sessions.create(proxy=ManagedProxyConfig(country="US"))

# Custom proxy
session = client.sessions.create(proxy=ProxyConfig(
    server="proxy.example.com:8080",
    username="user",
    password="pass",
))

Vendor Parameters

session = client.sessions.create(
    profile_id="prof-123",          # Browser profile
    timeout=120,                    # Minutes (1-240)
    browser_screen_width=1920,
    browser_screen_height=1080,
    allow_resizing=True,
)

Feature Matrix

Feature Supported Notes
Managed proxy Yes 200+ country codes
Custom proxy Yes host/port/username/password
Screen size Yes browserScreenWidth/Height
Timeout Yes 1-240 minutes
Profile Yes profileId as vendor_param
Fingerprint No API does not support
Recording No Only via Task API

Exception Hierarchy

CloudBrowserError
├── AuthenticationError     # 401/403
├── QuotaExceededError      # 429 (has .retry_after)
├── SessionNotFoundError    # 404
├── ProviderError           # 5xx (has .status_code, .request_id)
├── TimeoutError
└── NetworkError

Async Support

from browser_use_lite import AsyncBrowserUseCloud

async with AsyncBrowserUseCloud(api_key="bu-...") as client:
    session = await client.sessions.create()
    await client.sessions.delete(session.session_id)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

browser_use_lite-1.0.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

browser_use_lite-1.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file browser_use_lite-1.0.0.tar.gz.

File metadata

  • Download URL: browser_use_lite-1.0.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for browser_use_lite-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8263148b5904879ec3b42584b2dfdc6db5f5aff5368db134e27a923f67364575
MD5 570d49aeeeae6dcba09086def486452b
BLAKE2b-256 663b7129c74481e6ce88062643f8b83b8ada3b3adc686695dd7e9a8a73694e15

See more details on using hashes here.

File details

Details for the file browser_use_lite-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for browser_use_lite-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5110fda2330c99202fb233c4c7cdc9bbb14856e3bc6c105553f8a6bea0452c10
MD5 03418515d12fdd673cdd03c8eb54cb06
BLAKE2b-256 4b11cbde47eb0ea828c961ddc5db266d4625ab72b1011f6c0f55d0ed877e7477

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page