Skip to main content

solari-browser (Python)

Python SDK for Solari Browser — managed, stealth-hardened remote Chromium as an API, driven over the Playwright wire protocol (or raw CDP). A faithful port of the TypeScript @solarisdk/browser package; class, method, and field names match it one-for-one (snake_case where TS uses camelCase).

The browser runs remotely on Solari's pool — pip install pulls the driver only; you do not run patchright install chromium locally.

Feature coverage across all five languages is on the SDK feature matrix.

Install

pip install solari-browser

Quickstart

import asyncio, os
from solari_browser import Solari

async def main():
    solari = Solari(api_key=os.environ["SOLARI_API_KEY"])
    browser = await solari.launch(stealth=True)   # managed, stealth-hardened Chromium
    page = await browser.new_page()
    await page.goto("https://example.com")
    print(await page.title())
    await browser.close()

asyncio.run(main())

Sessions

Drive a session yourself instead of launch():

solari = Solari(api_key=os.environ["SOLARI_API_KEY"])
session = await solari.sessions.create(stealth=True, proxy="smart")
# ... connect over the session's CDP/WS endpoint ...
await solari.close()

Solari(...) accepts api_key, region (default us-west), and base_url (default https://api.getsolari.com).

Get and list sessions

view = await solari.sessions.get(session.id)   # raw dict: status, kind, userMetadata, endpoints while active
page = await solari.sessions.list(limit=50, metadata={"job": "nightly-42"})
# page.sessions, page.next_cursor (None on the last page)

list never returns the websocket endpoints (they are bearer capabilities): call get for a single session's. Pass page.next_cursor as cursor= for the next page.

Every REST error carries the gateway's code when it sends one, so you can branch on e.code whichever call failed: "ReplayPending" (a replay still uploading; wait and call again), "SessionNotFound", "InvalidSessionId", "PlanLimitExceeded" and so on.

Timeout, keep-alive and metadata

session = await solari.sessions.create(
    session_timeout_ms=600_000,       # end earlier than the plan maximum, in ms (at least 60 000)
    keep_alive=True,                  # keep it if the client drops: held until session_timeout_ms after creation (1 h if unset) or release
    user_metadata={"job": "nightly-42"},  # stored with the session
)

Every duration option is in milliseconds (timeout_ms, backoff_ms, session_timeout_ms, probe_timeout_ms). session_timeout_ms is rounded up to whole seconds for the gateway (1001 ms is 2 s); the gateway refuses anything under 60 s; None or 0 leaves the plan maximum, and a negative, fractional or non-int value raises SolariError before any request. launch() accepts the same options.

Edit a profile

solari.profiles.edit(id) opens the profile editor, where a person signs in once and the result is saved into the profile. It returns a handle; give its url to whoever should sign in, or open it yourself.

editor = await solari.profiles.edit("prof_123", reason="Sign in to Acme")
print(editor.url)  # open this in a browser

await editor.wait_for_save(timeout_s=600)  # the person clicks Save in the editor page
# or drive it from code once they are done:
await editor.save_and_close()  # save and close the editor
await editor.exit()            # close it WITHOUT saving
print(await editor.status())

The link works for 30 minutes and the editor starts when the person clicks "Open editor" on the page. After that the editor stops by itself and these calls raise SolariError with status 404 (link expired) or 409 (editor not running). There is no save-and-keep-editing: save_and_close() saves and closes.

Docs

Full reference and language guides: https://getsolari.com

Metadata

Release files for solari-browser 0.6.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solari-browser 0.6.4
File Size Uploaded Provenance Actions
solari_browser-0.6.4.tar.gz 34.6 kB Without provenance Details for solari_browser-0.6.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for solari-browser 0.6.4
File Interpreter ABI Platform Actions
solari_browser-0.6.4-py3-none-any.whl Python 3 none any Details for solari_browser-0.6.4-py3-none-any.whl

Total release size: 58.9 kB

Release files / solari_browser-0.6.4.tar.gz

Download URL solari_browser-0.6.4.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b92df32c17415135daecf5eba157abf582bf18d415e4dc92186b85bbb19b19a4
BLAKE2b-256 checksum
How to use checksums
a702293b574060af4b6472e1df81754430c71f551a1e6370990262ee49f120cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / solari_browser-0.6.4-py3-none-any.whl

Download URL solari_browser-0.6.4-py3-none-any.whl
Size 24.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67f9362c5560e6d1e3d0379ebd5afa8ad406d3cdf0c6a8e43e6aff21ad955208
BLAKE2b-256 checksum
How to use checksums
5e506d7e7a011cf8cebc70b1fa6073ff9f33ba7b698ea06429fb5dc0e8b32a7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for solari-browser 0.6.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page