Skip to content

Python SDK Reference

from rayobrowse import Rayobrowse
client = Rayobrowse(
endpoint="ws://localhost:9222", # or "wss://cloud.rayobrowse.com"
api_key=None, # required for cloud, optional for local
timeout=120.0, # HTTP request timeout in seconds
)
ParameterTypeDefaultDescription
endpointstr"ws://localhost:9222"WebSocket endpoint (local or cloud)
api_keystr | NoneNoneAPI key for cloud or paid local tier
timeoutfloat120.0HTTP request timeout in seconds

Get a CDP WebSocket URL for a new browser session. Pass the returned URL to playwright.chromium.connect_over_cdp().

ParameterTypeDefaultDescription
backendstrDEFAULT_ENGINEEngine identifier
osstr"windows"Target OS fingerprint: windows, linux, android, macos
proxystr | NoneNoneProxy URL (http://user:pass@host:port)
headlessboolFalseRun headless
protectionProtectionConfig | dict | NoneNonePer-feature fingerprint overrides
browser_languagestr | NoneNoneAccept-Language header value
max_lifetimeint | NoneNoneSession TTL in seconds
vncboolFalseStart per-browser noVNC session
**kwargsAdditional query parameters passed through

Local mode: Returns a ws://... URL directly (no HTTP call made). Cloud mode: Makes GET /connect to the gateway, returns the direct CDP URL.

Get the CDP URL for an existing session. Useful when a client disconnects and wants to reconnect without creating a new browser.

Close the browser from the most recent connect_url() call. If no session is active, this is a no-op.

List active browser sessions.

Check service health. Returns the JSON response from GET /health.

PropertyTypeDescription
last_session_idstr | NoneSession ID from the most recent connect_url() call (cloud only)
last_vnc_urlstr | NoneVNC URL from the most recent connect_url(vnc=True) call
ExceptionWhen raised
RayobrowseErrorBase exception for all SDK errors
BrowserCreateErrorBrowser creation failed (includes status_code and body)
ConnectionFailedErrorCannot reach the rayobrowse service
DaemonNotRunningLocal daemon is not running
LicenseLimitExceededConcurrent browser limit exceeded
TermsNotAcceptedTerms of service not accepted
ConcurrencyLimitErrorCloud concurrency limit reached (includes limit, active, retry_after)
RateLimitErrorRequest rate limit exceeded (includes retry_after)