browser-use

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Browser Use

Browser Use

Browser Use provides cloud browsers and autonomous browser automation via API.
Docs:
Browser Use 通过API提供云浏览器与自动化浏览器操作服务。
文档:

Setup

配置

API Key is read from clawdbot config at
skills.entries.browser-use.apiKey
.
If not configured, tell the user:
To use Browser Use, you need an API key. Get one at https://cloud.browser-use.com (new signups get $10 free credit). Then configure it:
clawdbot config set skills.entries.browser-use.apiKey "bu_your_key_here"
Base URL:
https://api.browser-use.com/api/v2
All requests need header:
X-Browser-Use-API-Key: <apiKey>

API密钥从Clawdbot配置中的
skills.entries.browser-use.apiKey
读取。
如果未配置,请告知用户:
clawdbot config set skills.entries.browser-use.apiKey "bu_your_key_here"
基础URL:
https://api.browser-use.com/api/v2
所有请求都需要添加请求头:
X-Browser-Use-API-Key: <apiKey>

1. Browser Sessions (Primary)

1. 浏览器会话(主要功能)

Spin up cloud browsers for Clawdbot to control directly. Use profiles to persist logins and cookies.
为Clawdbot启动可直接控制的云浏览器。使用配置文件来持久化登录状态和Cookie。

Create browser session

创建浏览器会话

bash
undefined
bash
undefined

With profile (recommended - keeps you logged in)

使用配置文件(推荐 - 保持登录状态)

curl -X POST "https://api.browser-use.com/api/v2/browsers"
-H "X-Browser-Use-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"profileId": "<profile-uuid>", "timeout": 60}'
curl -X POST "https://api.browser-use.com/api/v2/browsers"
-H "X-Browser-Use-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"profileId": "<profile-uuid>", "timeout": 60}'

Without profile (fresh browser)

不使用配置文件(全新浏览器)

curl -X POST "https://api.browser-use.com/api/v2/browsers"
-H "X-Browser-Use-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"timeout": 60}'

**Response:**
```json
{
  "id": "session-uuid",
  "cdpUrl": "https://<id>.cdp2.browser-use.com",
  "liveUrl": "https://...",
  "status": "active"
}
curl -X POST "https://api.browser-use.com/api/v2/browsers"
-H "X-Browser-Use-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"timeout": 60}'

**响应:**
```json
{
  "id": "session-uuid",
  "cdpUrl": "https://<id>.cdp2.browser-use.com",
  "liveUrl": "https://...",
  "status": "active"
}

Connect Clawdbot to the browser

将Clawdbot连接到浏览器

bash
gateway config.patch '{"browser":{"profiles":{"browseruse":{"cdpUrl":"<cdpUrl-from-response>"}}}}'
Now use the
browser
tool with
profile=browseruse
to control it.
bash
gateway config.patch '{"browser":{"profiles":{"browseruse":{"cdpUrl":"<cdpUrl-from-response>"}}}}'
现在使用
browser
工具并指定
profile=browseruse
即可控制该浏览器。

List/stop browser sessions

列出/停止浏览器会话

bash
undefined
bash
undefined

List active sessions

列出活跃会话

curl "https://api.browser-use.com/api/v2/browsers" -H "X-Browser-Use-API-Key: $API_KEY"
curl "https://api.browser-use.com/api/v2/browsers" -H "X-Browser-Use-API-Key: $API_KEY"

Get session status

获取会话状态

curl "https://api.browser-use.com/api/v2/browsers/<session-id>" -H "X-Browser-Use-API-Key: $API_KEY"
curl "https://api.browser-use.com/api/v2/browsers/<session-id>" -H "X-Browser-Use-API-Key: $API_KEY"

Stop session (unused time is refunded)

停止会话(未使用的时长将退款)

curl -X PATCH "https://api.browser-use.com/api/v2/browsers/<session-id>"
-H "X-Browser-Use-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"status": "stopped"}'

**Pricing:** $0.06/hour (Pay As You Go) or $0.03/hour (Business). Max 4 hours per session. Billed per minute, refunded for unused time.

---
curl -X PATCH "https://api.browser-use.com/api/v2/browsers/<session-id>"
-H "X-Browser-Use-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"status": "stopped"}'

**定价:** 按需付费模式每小时0.06美元,企业版每小时0.03美元。每个会话最长4小时。按分钟计费,未使用时长可退款。

---

2. Profiles

2. 配置文件

Profiles persist cookies and login state across browser sessions. Create one, log into your accounts in the browser, and reuse it.
bash
undefined
配置文件可在多个浏览器会话间持久化Cookie和登录状态。创建一个配置文件,在浏览器中登录您的账户,之后即可重复使用。
bash
undefined

List profiles

列出配置文件

curl "https://api.browser-use.com/api/v2/profiles" -H "X-Browser-Use-API-Key: $API_KEY"
curl "https://api.browser-use.com/api/v2/profiles" -H "X-Browser-Use-API-Key: $API_KEY"

Create profile

创建配置文件

curl -X POST "https://api.browser-use.com/api/v2/profiles"
-H "X-Browser-Use-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"name": "My Profile"}'
curl -X POST "https://api.browser-use.com/api/v2/profiles"
-H "X-Browser-Use-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"name": "My Profile"}'

Delete profile

删除配置文件

curl -X DELETE "https://api.browser-use.com/api/v2/profiles/<profile-id>"
-H "X-Browser-Use-API-Key: $API_KEY"

**Tip:** You can also sync cookies from your local Chrome using the Browser Use Chrome extension.

---
curl -X DELETE "https://api.browser-use.com/api/v2/profiles/<profile-id>"
-H "X-Browser-Use-API-Key: $API_KEY"

**提示:** 您也可以使用Browser Use Chrome扩展程序从本地Chrome同步Cookie。

---

3. Tasks (Subagent)

3. 任务(子代理)

Run autonomous browser tasks - like a subagent that handles browser interactions for you. Give it a prompt and it completes the task.
Always use
browser-use-llm
- optimized for browser tasks, 3-5x faster than other models.
bash
curl -X POST "https://api.browser-use.com/api/v2/tasks" \
  -H "X-Browser-Use-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "Go to amazon.com and find the price of the MacBook Air M3",
    "llm": "browser-use-llm"
  }'
运行自动化浏览器任务——就像一个为您处理浏览器交互的子代理。只需提供提示,它就能完成任务。
请始终使用
browser-use-llm
——针对浏览器任务优化,速度比其他模型快3-5倍。
bash
curl -X POST "https://api.browser-use.com/api/v2/tasks" \
  -H "X-Browser-Use-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "Go to amazon.com and find the price of the MacBook Air M3",
    "llm": "browser-use-llm"
  }'

Poll for completion

轮询任务完成状态

bash
curl "https://api.browser-use.com/api/v2/tasks/<task-id>" -H "X-Browser-Use-API-Key: $API_KEY"
Response:
json
{
  "status": "finished",
  "output": "The MacBook Air M3 is priced at $1,099",
  "isSuccess": true,
  "cost": "0.02"
}
Status values:
pending
,
running
,
finished
,
failed
,
stopped
bash
curl "https://api.browser-use.com/api/v2/tasks/<task-id>" -H "X-Browser-Use-API-Key: $API_KEY"
响应:
json
{
  "status": "finished",
  "output": "The MacBook Air M3 is priced at $1,099",
  "isSuccess": true,
  "cost": "0.02"
}
状态值:
pending
(待处理)、
running
(运行中)、
finished
(已完成)、
failed
(失败)、
stopped
(已停止)

Task options

任务选项

OptionDescription
task
Your prompt (required)
llm
Always use
browser-use-llm
startUrl
Starting page
maxSteps
Max actions (default 100)
sessionId
Reuse existing session
profileId
Use a profile for auth
flashMode
Even faster execution
vision
Visual understanding

选项描述
task
您的任务提示(必填)
llm
请始终使用
browser-use-llm
startUrl
起始页面
maxSteps
最大操作步数(默认100)
sessionId
复用现有会话
profileId
使用配置文件进行身份验证
flashMode
更快的执行速度
vision
视觉识别能力

Full API Reference

完整API参考

See references/api.md for all endpoints including Sessions, Files, Skills, and Skills Marketplace.
请查看references/api.md获取所有端点的信息,包括会话、文件、技能和技能市场。