clearcote (Python SDK)
A Playwright drop-in for Clearcote — the
open, reproducible, anti-fingerprint Chromium build. launch() returns a standard Playwright
Browser, so migrating is a one-line import change.
The verified Clearcote binary is auto-downloaded and SHA-256 checked on first use, then cached —
no zips or paths to manage. Or run the same code on a hosted Clearcote browser with
launch(cloud=True): see Local or cloud.
What's new — without a licence key the SDK now downloads the open build Chromium 151 (v0.1.0-pre.25, 151.0.7922.108), SDK clearcote 0.64.0. version="150" and "149" still resolve.
Platform: Clearcote ships Windows x64 and Linux x64 binaries, plus a macOS arm64 (Apple
Silicon) PRO build; launch() runs on all of them and the SDK auto-downloads the right one for your OS. On Linux the persona is Linux-native (Linux
GPU/voices/audio-device values) and DRM uses the Linux CDM. On an Apple Silicon Mac
launch() runs a native macOS build: the PRO build with a licence key, and without one the open macOS build
(Chromium 150 from v0.1.0-pre.24, a major behind Windows and Linux). Both are a Chromium.app, unsigned: the SDK
clears its quarantine flag and passes --use-mock-keychain. Its fonts and canvas text metrics stay the Mac's own, so keep
platform="macos" (the default there); another platform warns unless a fingerprint_profile captured on that OS
supplies them. On an Intel Mac, launch() runs the
Docker image through Docker Desktop instead (SDK 0.40.0+; docker=True or
CLEARCOTE_DOCKER=1 does the same on any OS, an Apple Silicon Mac included). On a minimal Linux host, install the browser's runtime libs (e.g.
apt-get install -y libnss3 libnspr4 libgbm1 libasound2 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libxfixes3 libxext6 libpango-1.0-0 libcairo2 libx11-6 libxcb1 libexpat1 libdbus-1-3) and pass args=["--no-sandbox"] (or
chown root:root chrome-sandbox && chmod 4755 chrome-sandbox) in containers.
Running as root in a container? Run as a normal user (the official Docker image does) or add
--cap-add=SYS_NICE: the open build is compiled with debug assertions, and a root container that
refuses Chromium's process-priority call stops it at start.
Install
pip install clearcote
playwright is pulled in as a dependency. You do not need to run playwright install
(Clearcote uses its own browser binary, not Playwright's bundled Chromium).
Usage
from clearcote import launch
browser = launch(
fingerprint="user-7423", # per-eTLD+1 seed: same seed => same identity, different => unlinkable
platform="windows",
timezone="America/New_York",
headless=False,
)
page = browser.new_page()
page.goto("https://abrahamjuliot.github.io/creepjs/")
# ... standard Playwright (sync API) from here ...
browser.close()
Already using Playwright? Swap p.chromium.launch(...) for launch(...) from clearcote — the
returned object is a normal Playwright Browser. (One shared Playwright driver is started lazily
and stopped at interpreter exit.)
Async API (clearcote.async_api)
Inside an asyncio event loop, use the async API — it mirrors the sync one and returns Playwright
async objects (the sync API raises "Sync API inside the asyncio loop"):
import asyncio
from clearcote.async_api import launch
async def main():
browser = await launch(
fingerprint="user-7423",
platform="windows",
timezone="America/New_York",
)
page = await browser.new_page()
await page.goto("https://abrahamjuliot.github.io/creepjs/")
# ... standard Playwright (async API) from here ...
await browser.close()
asyncio.run(main())
Same options as the sync launch (fingerprint/persona/proxy/geoip/profile/canvas_bridge/
humanize/…). clearcote.async_api exposes launch, launch_persistent_context, launch_agent,
run_agent_task, executable_path, download, plus Profile (use launch(profile="name")). Each
launched browser owns its Playwright driver and stops it on await browser.close().
Light stealth (light_stealth=True)
When the full seed-derived persona is more than a target needs, light_stealth spoofs only a
coherent, seed-derived bundle of the safe metadata axes — hardware_concurrency, device_memory,
color_depth, device_pixel_ratio, max_touch_points — via native override switches, leaving
rendering (canvas/WebGL/audio/fonts), TLS and the real browser version untouched. Screen dimensions
stay real by default (opt-in), since a faked screen that can't be reconciled with the real render
surface is a reliable block trigger. It never engages the --fingerprint persona machinery.
browser = launch(light_stealth=True, fingerprint="my-seed") # coherent metadata, rendering left real
Or set any native override directly (no seed needed) — an explicit value always wins over the persona:
browser = launch(hardware_concurrency=8, device_memory=8, device_pixel_ratio=1.25, max_touch_points=0)
Native overrides: hardware_concurrency, device_memory, color_depth, device_pixel_ratio,
max_touch_points, and (opt-in) screen_width / screen_height / avail_width / avail_height.
Needs the Clearcote 149.0.7827.114 (v0.1.0-pre.22) build or newer.
This computer instead of the persona (real_computer)
For one identity per real desktop: show this computer's own screen, touch points and display language instead of
the persona's generated values. Graphics card, processor, memory and noise stay the persona's.
browser = launch(fingerprint="user-7423", real_computer=True) # all three parts
other = launch(fingerprint="user-7423", real_computer={"screen": True}) # just the screen
screen: the primary display (size, work area, device_pixel_ratio), read from the operating system.
touch: navigator.maxTouchPoints as this computer reports it (Windows; 0 on macOS; Linux keeps the persona's).
languages: the system display language, expanded the way Chrome writes it (en-GB -> en-GB,en-US,en).
Behind a proxy with geoip on, the proxy's exit keeps deciding the languages.
A value you set yourself (screen_width, max_touch_points, accept_language) wins. It is off by default because
every profile on one computer then shares these values, which makes profiles easier to link, and servers and
containers have no real display (the launch then keeps the generated value and says so once). Not available for
cloud=True or Docker launches (real_computer=False is accepted there). The first launch in a process reads the
computer once (about 2 s on Windows).
Standing CDP endpoint (serve())
Run Clearcote as a stealthy CDP endpoint that any existing automation attaches to unchanged —
Playwright's connect_over_cdp, puppeteer.connect, or browser-use / Crawl4AI / Stagehand. Where
launch() spawns a Playwright-owned browser, serve() launches the binary directly — so
--enable-automation is never added and navigator.webdriver stays false; the port binds to
loopback (127.0.0.1) behind an origin allowlist.
from clearcote import serve
srv = serve(fingerprint="seed-123", platform="windows") # same persona/proxy/geoip options as launch()
print(srv.cdp_url) # http://127.0.0.1:<port>
from playwright.sync_api import sync_playwright
browser = sync_playwright().start().chromium.connect_over_cdp(srv.cdp_url) # your code, unchanged
# ... or puppeteer.connect / browser-use / Crawl4AI / Stagehand, pointed at srv.cdp_url ...
srv.close() # or: `with serve(...) as srv:`
Or from the shell:
clearcote-serve --port 9222 --fingerprint seed-123 --platform windows # prints http://127.0.0.1:9222
The returned Server exposes .cdp_url, .ws_url(), and .close(), and works as a context manager.
Headless, serve() gives the browser a real-size display (the persona's, or one drawn from real
desktops) and maximizes its window onto the work area before any client attaches, so every page,
tab and popup reports a window that fits its screen. Pass window_size={"width": ..., "height": ...}
for a smaller window (clamped to the work area), or your own --window-size / --screen-info in
args to opt out. On an engine with persona windows a seeded serve() opens the persona's own window
instead (see Window geometry); window_size still wins.
Drive it from an AI agent (MCP). Point Claude Desktop / Cursor / Cline at the
clearcote-mcp server
(pip install clearcote-mcp or npx -y clearcote-mcp) — ~20 tools over one shared stealth browser,
persona set via CLEARCOTE_* env.
Many identities on one endpoint (serve_multiplex, clearcote serve)
One port, one browser per identity, chosen by the connection URL:
# in another shell: clearcote serve --port 9222 --idle-timeout 300
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
a = p.chromium.connect_over_cdp("http://127.0.0.1:9222?fingerprint=acct-1&timezone=Europe/Berlin")
b = p.chromium.connect_over_cdp("http://127.0.0.1:9222?fingerprint=acct-2&proxy=socks5%3A%2F%2Fu%3Ap%40host%3A1080&geoip=true")
- Query options:
fingerprint, timezone, locale, proxy, geoip, plus any fingerprint option in kebab-case (platform, hardware-concurrency, allow-third-party-cookies, ...). Unknown options are rejected (400).
- The same identity reuses its browser. Asking for a running identity with different options returns 409 — close it first.
GET / lists running browsers; POST /fingerprint/<id>/close stops one; --idle-timeout <s> closes a browser after its last client disconnects; --max-browsers caps them (default 16).
- Behind a reverse proxy, WebSocket URLs honour
X-Forwarded-Host / X-Forwarded-Proto; add the public name with --allow-host.
- Binds
127.0.0.1 by default. Requests a web page could make (cross-site fetches, foreign Origin, a Host that isn't an IP / localhost / allowed) are refused.
In code: clearcote.serve_multiplex(port=9222, idle_timeout=300, data_dir="./profiles").
clearcote command line
clearcote install [--version 152] [--channel preview]
clearcote info [--quick] [--json] [--proxy <url>] # alias: doctor
clearcote bench [--concurrency 3] [--url <url>] [--proxy <url>] [--duration 30] [--json]
clearcote login [key] # validates the key, saves it to ~/.clearcote/license.key
clearcote logout
clearcote clear-cache
clearcote serve [--port 9222] ...
clearcote connect [<code>] # start the helper for the web profile manager (app.clearcotelabs.com)
clearcote cloud run|sessions|stop|events|recording|profile sync|webhooks ... # the hosted API, see Local or cloud
connect starts the Clearcote Helper in that terminal, so the web profile manager at https://app.clearcotelabs.com can launch your profiles on this computer. Copy the command with its code from the profile manager's Connect window and that tab connects by itself. The first run downloads the helper release this SDK pins and checks its SHA-256; Ctrl+C closes the helper and its browsers.
info never downloads: it reports the SDK, this machine (CPU, RAM, VM or not, and whether there is a GPU Chromium can draw with), the cached builds, which engine features the binary supports, a launch test (skipped with --quick), licence seats, fonts and missing system libraries.
bench answers "why is my CPU at 100 %" and "how many browsers can I run": it starts --concurrency browsers (headless, temporary profiles, deleted afterwards), loads --url in each for --duration seconds, through --proxy if you give one, and prints what each browser costs in CPU threads and RAM on this machine, page timings (DOMContentLoaded, load, network idle), errors, about how many browsers the machine runs at once, and what to change. It runs fewer browsers than asked when free RAM looks too small (--force runs them all). Each browser holds a licence seat while it runs. Paste the output into a support request; proxy credentials are never printed.
Windows: when a cached build cannot start from the cache (spawn UNKNOWN, "the side-by-side configuration is incorrect"; this happens when the SDK runs inside an MSIX-packaged app, whose writes to %LOCALAPPDATA% Windows redirects), launches use one copy of that build in ~/.clearcote/recovered/ instead, made once and reused by every later launch from Python or Node. clear-cache removes those copies too.
Engine options (PRO 152 r22+)