stablebrowse (Python)
Python client for the stablebrowse browser agent API.
Install
From PyPI (once published):
pip install stablebrowse
From source (for local development):
cd sdks/python
pip install -e .
Requires Python 3.9+. Depends on httpx.
Quick start
from stablebrowse import Stablebrowse
# Bearer token comes from either the constructor or the
# STABLEBROWSE_API_KEY environment variable.
client = Stablebrowse(api_key="sb_live_...")
# (Optional) upload per-end-user social-media credentials.
client.end_users("alice").credentials.set(
twitter_auth_token="...",
twitter_ct0="...",
)
# Sync-feeling submit. Polls internally until the task terminates.
result = client.tasks.run(
end_user_id="alice",
task="find the top AI tweets today",
)
print(result.result)
Async primitives
If you want to drive the poll loop yourself — for example, to push progress into your own queue, or to run many submissions in parallel with your own scheduler — use the raw methods:
submission = client.tasks.submit(end_user_id="alice", task="...")
while True:
task = client.tasks.get(submission.task_id)
if task.is_terminal:
break
time.sleep(2)
Multi-turn conversations
Pass the session_id you got from the first call to continue a conversation:
first = client.tasks.run(end_user_id="alice", task="who's trending on X?")
follow = client.tasks.run(
end_user_id="alice",
task="what about in music specifically?",
session_id=first.session_id,
)
The server builds previousContext from the last completed turn so the
agent has the earlier answer when it reasons about the follow-up.
End users and credentials
Each business scopes end-users by opaque identifier — "alice" inside your business is independent of any other business's "alice":
alice = client.end_users("alice")
alice.credentials.set(
tiktok_session_id="...",
tiktok_csrf_token="...",
)
status = alice.credentials.get()
assert status.platforms["tiktok"] is True
# Remove all creds
alice.credentials.delete()
# Or a specific subset
alice.credentials.delete(fields=["twitter_auth_token", "twitter_ct0"])
Field names are snake_case in Python and get translated to camelCase on the wire automatically.
API key management
Create and revoke keys in the dashboard under Settings → API Keys. Key lifecycle is dashboard-only by design — a leaked key can't mint more.
Design extraction
task = client.design.run(
end_user_id="alice",
url="https://example.com",
extractors=["images", "fonts", "colors", "icons", "tokens", "logo"],
enable_ip_rotation=True, # optional: route through the residential proxy pool
)
print(task.design)
Errors
Every exception derives from StablebrowseError:
TaskFailed—run()saw the task finish with status=failed. The failedTaskis on.task.TaskTimeout— the poll deadline expired before the task terminated. The still-runningTaskis on.taskso you can keep polling.StablebrowseError— every other HTTP or transport error..status_codeand.bodyare populated when the server returned structured JSON.
Configuration
The constructor reads a couple of env vars if you don't pass them:
STABLEBROWSE_API_KEY— bearer tokenSTABLEBROWSE_BASE_URL— override the API base, useful for pointing at beta or a local gateway
Metadata
Release files for stablebrowse 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stablebrowse-0.3.1.tar.gz | 9.5 kB | Without provenance | Details for stablebrowse-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stablebrowse-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for stablebrowse-0.3.1-py3-none-any.whl |
Total release size: 19.0 kB
Release files / stablebrowse-0.3.1.tar.gz
| Download URL | stablebrowse-0.3.1.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6132dcbda39d14efc696b7ecf131f9b7d8fbd9410e0b20dfa05f03753668dae7
|
|
BLAKE2b-256 checksum How to use checksums |
35c1327cef59237dfa92951c80ffad4e06907502fdf58a357e0200bdefe2261b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / stablebrowse-0.3.1-py3-none-any.whl
| Download URL | stablebrowse-0.3.1-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
107fb432ca929568bca8a99f9b9f9357b8f99af9dd7c7d265928ae25686c9668
|
|
BLAKE2b-256 checksum How to use checksums |
59053eb259075a6f72b5767a3de92bd71f45a3566fbe4680c7c6964ce8348d12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for stablebrowse 0.3.1
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.