> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-larsen-v1-unified-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Live preview & recording

> Watch the agent's browser live, embed it in your app, and get an MP4 recording after the run.

Every run's browser can be watched live and is recorded. Both the live view and the recording live on the **browser** the run used — you get the `browserId` from the run, then read them off the browser.

## Watch a run live

Start a run, get its `browserId` from `GET /runs/{id}` (it appears once the browser is provisioned), then read the browser's `liveViewUrl`.

<CodeGroup>
  ```python Python theme={null}
  from browser_use import BrowserUse

  client = BrowserUse()
  run = client.agents.browser_use.runs.create(task="Check how many GitHub stars browser-use has")

  # browser_id appears on the run once provisioned
  run = client.agents.browser_use.runs.get(run.id)
  browser = client.browsers.get(run.browser_id)
  print(browser.live_view_url)   # open this to watch live
  ```

  ```bash curl theme={null}
  # 1. get the run → browserId (null until provisioned)
  curl "https://api.browser-use.com/api/v1/agents/browser-use/runs/RUN_ID" \
    -H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY"
  # → { "browserId": "br_123", ... }

  # 2. the browser carries the live view url
  curl "https://api.browser-use.com/api/v1/browsers/br_123" \
    -H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY"
  # → { "liveViewUrl": "https://live.browser-use.com?wss=...", ... }
  ```
</CodeGroup>

A [standalone browser](/cloud/create-browser) returns `liveViewUrl` immediately on `POST /browsers` (it's provisioned synchronously).

## Embed it in your app

```html theme={null}
<iframe
  src="{LIVE_VIEW_URL}"
  style="width: 100%; aspect-ratio: 16/9; border: none; border-radius: 8px;"
  allow="autoplay"
></iframe>
```

The live view is hosted on `live.browser-use.com`. If your app sets a Content Security Policy, allow it in `frame-src`:

```
Content-Security-Policy: frame-src 'self' https://live.browser-use.com;
```

Customize with query params on the URL: `?theme=light` (default `dark`), `?ui=false` (hide browser chrome).

## Recording

Every browser records automatically. Fetch a fresh, expiring MP4 URL on demand from the browser — no flag to enable.

<CodeGroup>
  ```python Python theme={null}
  rec = client.browsers.recording(run.browser_id)
  print(rec.url)   # presigned MP4
  ```

  ```bash curl theme={null}
  curl "https://api.browser-use.com/api/v1/browsers/BROWSER_ID/recording" \
    -H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY"
  # → { "url": "https://.../recording.mp4?..." }
  ```
</CodeGroup>

To find the `BROWSER_ID` for a run, read `browserId` off `GET /runs/{id}` (as above). See [Manage a browser](/cloud/manage-browser) for the full browser API.

<Warning>
  Recording URLs are presigned and **expire after 1 hour**. Download or serve the MP4 promptly; save it to your own storage if you need it later. A run that never opened a browser has no recording.
</Warning>
