Skip to main content

What is it?

A completely new agent built from scratch. Think Claude Code for the browser: web scraping, data extraction, file manipulation, and complex multi-step workflows. Example: “Here’s a CSV with 50 people. For each person, find their LinkedIn profile, extract their current title and company, and return an enriched CSV.” The BU Agent handles the entire pipeline in a single task.

Quick start

Same package, different import path:
import asyncio
from browser_use_sdk.v3 import AsyncBrowserUse

async def main():
    client = AsyncBrowserUse()
    result = await client.run("Find the top 3 trending repos on GitHub today")
    print(result.output)

asyncio.run(main())

Structured output

from browser_use_sdk.v3 import AsyncBrowserUse
from pydantic import BaseModel

class Contact(BaseModel):
    name: str
    title: str
    company: str

client = AsyncBrowserUse()
result = await client.run(
    "Find the founding team of Browser Use on LinkedIn",
    output_schema=Contact,
)
print(result.output)

Workspaces

Workspaces are persistent file storage that lives across sessions. Attach a workspace to a task and the agent can read and write files in it.
workspace = await client.workspaces.create(name="my-workspace")
result = await client.run("Save results to output.csv", workspace_id=str(workspace.id))

files = await client.workspaces.files(str(workspace.id))
for f in files.files:
    print(f.path, f.size)
See the full Workspaces guide for CRUD, file management, and more.

Session messages

Retrieve the full message history for a session — useful for debugging or building custom UIs.
msgs = await client.sessions.messages(session_id, limit=50)
for m in msgs.messages:
    print(f"[{m.role}] {m.data[:200]}")
Use after and before cursors for pagination through large message histories.
The BU Agent API is experimental. The interface may change.