scalebrowser — Python SDK
Official Python SDK for the Scalebrowser daemon: a typed REST client plus a direct-CDP driver (nodriver-style) for the self-hosted browser infrastructure that gives each AI agent its own browser.
The driver plane is direct-CDP, not Playwright/Puppeteer: anti-bot stacks
block the Playwright control plane regardless of how good the browser patches
are. start_profile returns a cdp_ws endpoint and this SDK speaks the Chrome
DevTools Protocol over it directly. Credentials never leave the daemon and are
never logged by the SDK.
Install
pip install scalebrowser
Requires Python ≥ 3.10 and depends on httpx, websockets, pydantic v2. The
SDK is MIT-licensed; the daemon it talks to is a separate, licensed product.
Quickstart (sync)
from scalebrowser import ScalebrowserClient, CreateProfileBody
sb = ScalebrowserClient(base_url="http://127.0.0.1:8787", token="…")
profile = sb.create_profile(CreateProfileBody(name="acct-01"))
# start → direct-CDP connect → navigate → humanized click → stop
with sb.launch(profile.id, headless=True) as page:
page.navigate("https://example.com")
print(page.evaluate("document.title"))
page.humanize_click(120, 240) # routed through the daemon trusted-input (G8)
sb.close()
Quickstart (async)
import asyncio
from scalebrowser import AsyncScalebrowserClient
async def main():
async with AsyncScalebrowserClient(token="…") as sb:
started = await sb.start_profile(profile_id, headless=True) # StartProfileResult
async with await sb.connect_cdp(started, profile_id) as page:
await page.navigate("https://example.com")
title = await page.evaluate("document.title")
await page.humanize_click(120, 240)
await sb.stop_profile(profile_id)
asyncio.run(main())
REST surface
Every /v1 endpoint is a typed method on the client, under the same name in
both the sync and the async client:
- Profiles —
list_profiles,get_profile,create_profile,update_profile,delete_profile,start_profile,stop_profile - Bulk —
bulk_create_profiles,bulk_start,bulk_stop,bulk_delete,bulk_assign_proxy - Groups / Presets —
list_groups/create_group/get_group/update_group/delete_group,list_presets/create_preset/get_preset/update_preset/delete_preset,get_persona_constraints. A preset isconfig(what the profiles do:geo_mode,proxy_id, …) plusconstraints(what they are:country, which pins the persona's language, timezone and voices). Both are typed (PresetConfig/PresetConstraints) and the daemon refuses an unknown key with a 400 — read the valid regions fromget_persona_constraints()rather than hardcoding them. - Proxies —
list_proxies/create_proxy/get_proxy/update_proxy/delete_proxy/check_proxy, pluscheck_proxy_config(probe a config before saving it; passidto reuse an existing proxy's stored credentials) - Extensions —
list_extensions,attach_extension,detach_extension, plus the daemon-wide library (upload_extension,get_library_extension,delete_library_extension). An attached package IS loaded into the browser at launch, under the canonical Web-Store id its own key derives - Credentials —
list_credentials,put_credential,reveal_credential(needs the vault password),export_credentials,import_credentials - Cookies —
reveal_cookies, the one route a cookie VALUE leaves through, behind the same vault password - Sessions —
export_session,import_session - Mailboxes —
list_inboxes,create_inbox,update_inbox,delete_inbox,get_inbox_bindings,bind_inbox,unbind_inbox— where a profile's confirmation codes arrive - Passkeys —
list_passkeys,delete_passkey. Metadata only: the private key has no field and no endpoint - Agent runs —
list_runs,get_run,list_run_steps,get_run_shot,get_activity. Read-only, all of it - Interruptions —
list_interruption_locks,set_interruption_lock,list_interruption_rules,set_interruption_rule,delete_interruption_rule— who may answer when the browser asks something - Artifacts —
put_artifact(hand the daemon a file to upload later),get_artifact(fetch a screenshot, download or saved PDF as bytes) - Input / Metrics / Account / Events —
send_input,get_metrics,get_account,health,ready,events()
async for event in sb_async.events(): # SSE lifecycle stream (Bearer-authenticated)
print(event.type) # typed: profile_started / profile_crashed / …
Errors map the daemon contract: ApiError(status, code, message) with codes
4001–4010 (ApiError.is_auth_error for 401 / 4010); NetworkError when the
daemon is unreachable; CdpError for protocol-level failures.
Direct-CDP driver
CdpSession (async) / SyncCdpSession give you:
send(method, params)— any CDP command, awaited byidnavigate(url),evaluate(expr, isolated=False)— never callsRuntime.enable(a detection leak); isolated worlds viacreate_isolated_world()on(method, cb)/events()— subscribe to CDP eventshumanize_move/click/type/scroll— humanized OS-level input via the daemon
Tests
pip install -e ".[dev]"
pytest # unit tests (mock REST + a real fake-CDP ws server)
SCALEBROWSER_E2E=1 pytest tests/test_e2e.py # against a real daemon
Contract assumptions
- Default base URL
http://127.0.0.1:8787; Bearer token always. - The trusted-input body beyond
{action, humanize}(coordinates,button,delta_x/y,text) is an SDK convention — seecdp.py. - Two endpoints are optional and answer 404 on a daemon without them, which the
SDK treats as information rather than as an error:
get_metrics()then derives running counts from profile state, andget_account()returnslicensed=False, which is what "self-hosted, no control plane" means. - Every method is present on BOTH clients under the same name. The sync client is a hand-written mirror over one background event loop; there is no duplicated endpoint logic.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scalebrowser-0.3.0.tar.gz.
File metadata
- Download URL: scalebrowser-0.3.0.tar.gz
- Upload date:
- Size: 50.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c388840e96d6adb7bb97d2af6ecfa5a864fba32d485434f20be9489d2c35e71f
|
|
| MD5 |
ed154ec8512bad689fe0cdf75a2ab198
|
|
| BLAKE2b-256 |
4594614b888bbdbeefa660b35927b7a19e489d5a0a1b162ef977d41eb37b72c6
|
Provenance
The following attestation bundles were made for scalebrowser-0.3.0.tar.gz:
Publisher:
sdk-publish.yml on blackdiamond6390/scalebrowser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scalebrowser-0.3.0.tar.gz -
Subject digest:
c388840e96d6adb7bb97d2af6ecfa5a864fba32d485434f20be9489d2c35e71f - Sigstore transparency entry: 2565480636
- Sigstore integration time:
-
Permalink:
blackdiamond6390/scalebrowser@b132db62cf44e5c00da2c83b323bdd0cb02cadec -
Branch / Tag:
refs/tags/sdk-v0.3.0 - Owner: https://github.com/blackdiamond6390
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
sdk-publish.yml@b132db62cf44e5c00da2c83b323bdd0cb02cadec -
Trigger Event:
push
-
Statement type:
File details
Details for the file scalebrowser-0.3.0-py3-none-any.whl.
File metadata
- Download URL: scalebrowser-0.3.0-py3-none-any.whl
- Upload date:
- Size: 42.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ad6c460014519b30618b2bf229a0257a2b1b8f1e0bfd08f7a3714826a7d511e
|
|
| MD5 |
75af05ed226a54edc0de106c5e954d75
|
|
| BLAKE2b-256 |
5517db4ed49facedbbed7c116b2e52e2674e5ea0725013665f4eebb208c9fdde
|
Provenance
The following attestation bundles were made for scalebrowser-0.3.0-py3-none-any.whl:
Publisher:
sdk-publish.yml on blackdiamond6390/scalebrowser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scalebrowser-0.3.0-py3-none-any.whl -
Subject digest:
4ad6c460014519b30618b2bf229a0257a2b1b8f1e0bfd08f7a3714826a7d511e - Sigstore transparency entry: 2565480784
- Sigstore integration time:
-
Permalink:
blackdiamond6390/scalebrowser@b132db62cf44e5c00da2c83b323bdd0cb02cadec -
Branch / Tag:
refs/tags/sdk-v0.3.0 - Owner: https://github.com/blackdiamond6390
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
sdk-publish.yml@b132db62cf44e5c00da2c83b323bdd0cb02cadec -
Trigger Event:
push
-
Statement type: