> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-cursor-proxy-indicator-and-text-6cda.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# BU Agent API (Experimental)

> BU Agent API (v3) — a next-generation AI browser agent for web scraping, data extraction, file manipulation, and multi-step workflows in a single API call.

## 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:

<CodeGroup>
  ```python Python theme={null}
  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())
  ```

  ```typescript TypeScript theme={null}
  import { BrowserUse } from "browser-use-sdk/v3";

  const client = new BrowserUse();
  const result = await client.run("Find the top 3 trending repos on GitHub today");
  console.log(result.output);
  ```
</CodeGroup>

### Structured output

<CodeGroup>
  ```python Python theme={null}
  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)
  ```

  ```typescript TypeScript theme={null}
  import { BrowserUse } from "browser-use-sdk/v3";
  import { z } from "zod";

  const Contact = z.object({
    name: z.string(),
    title: z.string(),
    company: z.string(),
  });

  const client = new BrowserUse();
  const result = await client.run(
    "Find the founding team of Browser Use on LinkedIn",
    { schema: Contact },
  );
  console.log(result.output);
  ```
</CodeGroup>

### 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.

<CodeGroup>
  ```python Python theme={null}
  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)
  ```

  ```typescript TypeScript theme={null}
  const workspace = await client.workspaces.create({ name: "my-workspace" });
  const result = await client.run("Save results to output.csv", { workspaceId: workspace.id });

  const files = await client.workspaces.files(workspace.id);
  for (const f of files.files) {
    console.log(f.path, f.size);
  }
  ```
</CodeGroup>

See the full [Workspaces guide](/cloud/guides/workspaces) for CRUD, file management, and more.

### Session messages

Retrieve the full message history for a session — useful for debugging or building custom UIs.

<CodeGroup>
  ```python Python theme={null}
  msgs = await client.sessions.messages(session_id, limit=50)
  for m in msgs.messages:
      print(f"[{m.role}] {m.data[:200]}")
  ```

  ```typescript TypeScript theme={null}
  const msgs = await client.sessions.messages(sessionId, { limit: 50 });
  for (const m of msgs.messages) {
    console.log(`[${m.role}] ${m.data.slice(0, 200)}`);
  }
  ```
</CodeGroup>

Use `after` and `before` cursors for pagination through large message histories.

<CardGroup cols={2}>
  <Card title="BU Agent API Reference" icon="code" href="/cloud/api-reference">
    Full endpoint reference.
  </Card>

  <Card title="Workspaces Guide" icon="folder" href="/cloud/guides/workspaces">
    Persistent file storage across sessions.
  </Card>

  <Card title="Agent Tasks" icon="play" href="/cloud/guides/tasks">
    Task guide.
  </Card>
</CardGroup>

<Note>
  The BU Agent API is experimental. The interface may change.
</Note>
