Launch a cloud browser and connect to it from your code.
Both Cloud paths use API V4. Choose whether Browser Use drives the browser or
your Playwright/Puppeteer code connects directly over CDP. For a local agent,
use the open-source library.Get an API key and
export it:
from browser_use_sdk.v4 import BrowserUsewith BrowserUse() as client: run = client.runs.create("Find the top Hacker News story") result = client.runs.wait_for_completion(run.id) print(result.result)
import { BrowserUse } from "browser-use-sdk/v4";const client = new BrowserUse();const run = await client.runs.create({ task: "Find the top Hacker News story",});const result = await client.runs.waitForCompletion(run.id);console.log(result.result);
curl https://api.browser-use.com/api/v4/runs \ -H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"task":"Find the top Hacker News story"}'
Closing Playwright, Puppeteer, or CDP does not stop the browser. Use
client.browsers.stop(browser.id) or call PATCH /api/v4/browsers/{id} with
{"action":"stop"}.
Copy for an LLM
Give your coding agent the compact API V4 context.
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.