rayobrowse
Python SDK for rayobrowse, the Rayobyte
cloud stealth Chromium browser. The SDK asks the gateway at
https://browser.rayobyte.com for a browser and returns its CDP WebSocket URL,
which you pass to Playwright, Puppeteer, or any other CDP client.
Installation
pip install rayobrowse playwright && playwright install
Python 3.10 or newer.
Quick start
from rayobrowse import Rayobrowse
from playwright.sync_api import sync_playwright
PROXY = "http://USERNAME:PASSWORD@us-east.gw.rayobyte.com:8000"
client = Rayobrowse(endpoint="https://browser.rayobyte.com", api_key="rb_live_YOUR_KEY")
ws_url = client.connect_url(os="windows", proxy=PROXY)
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(ws_url)
page = browser.new_page()
page.goto("https://example.com")
print(page.title())
browser.close()
client.close()
Every connect_url() call needs a proxy. Without one the gateway returns
400 PROXY_REQUIRED and the SDK raises BrowserCreateError.
endpoint defaults to https://browser.rayobyte.com, or to the
RAYOBYTE_ENDPOINT environment variable when it is set.
client.close() closes the browser from the most recent connect_url() call.
An open session keeps running until its max_lifetime ends.
Live view
ws_url = client.connect_url(os="windows", proxy=PROXY, vnc=True)
print(f"CDP: {ws_url}")
print(f"Live: {client.last_vnc_url}")
Errors
A launch can be refused for two different limits, and the SDK raises a different exception for each:
from rayobrowse import BrowserCreateError, ConcurrencyLimitError, RateLimitError
try:
ws_url = client.connect_url(os="windows", proxy=PROXY)
except ConcurrencyLimitError as e: # all your concurrent browsers are running
print(f"{e.active}/{e.limit} running, retry in {e.retry_after}s")
except RateLimitError as e: # too many launches in the last minute
print(f"Rate limited, retry in {e.retry_after}s")
except BrowserCreateError as e: # anything else, e.g. 401 for a bad key
print(f"Launch failed: {e}")
Documentation
Metadata
Release files for rayobrowse 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rayobrowse-2.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / rayobrowse-2.3.0-py3-none-any.whl
| Download URL | rayobrowse-2.3.0-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6aa7a4f1a996669ca4c91c565bae108e4f9da77b5b861c5e62df2b2f3ae1591a
|
|
BLAKE2b-256 checksum How to use checksums |
78a89db4ae3cfb1814357d746626450004a08e67290215a9d2da18c92c8280b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|