ClawSkills logoClawSkills

Nextbrowser

使用 Nextbrowser 云 API 启动云浏览器,供 Openclaw 运行自主浏览器任务。主要用途是创建具有配置文件(per...)的浏览器会话

介绍

# Nextbrowser

Nextbrowser 通过 API 提供云浏览器和自主浏览器自动化功能。

**文档:** - Cloud API: https://docs.nextbrowser.com/getting-started

## Setup

**API Key** 从 openclaw 配置中的 `skills.entries.next-browser.apiKey` 读取。

如果未配置,请告诉用户: > 要使用 Nextbrowser,你需要一个 API key。在 https://app.nextbrowser.com/user-settings 获取一个(新注册用户可获得 2000 个免费积分)。然后进行配置: > ``` > openclaw config set skills.entries.next-browser.apiKey "YOUR_API_KEY" > ```

**重要:** Nextbrowser API key 可以有多种格式和前缀。 不要自行验证 key 的格式 —— 直接使用用户提供的任何 key 即可。如果 key 无效,API 将返回认证错误,只有在那时你才应该要求用户验证他们的 key。

Base URL: `https://app.nextbrowser.com/api/v1`

所有请求都需要 header:`Authorization: x-api-key <apiKey>`

--- ## 1. Credentials Manager

Credentials Manager 在浏览器运行和自主任务之间安全地存储并重用认证数据。

```bash # List credentials curl "https://app.nextbrowser.com/api/v1/users/credentials" -H "Authorization: x-api-key $API_KEY" ```

---

## 2. Profiles

Profiles 在浏览器会话之间持久化保存 Cookies 和登录状态。创建一个,在浏览器中登录你的账户,然后重用它。

```bash # List profiles curl "https://app.nextbrowser.com/api/v1/browser/profiles" -H "Authorization: x-api-key $API_KEY" # Create browser profile curl -X POST "https://app.nextbrowser.com/api/v1/browser/profiles" \ -H "Authorization: x-api-key $API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "<profile-name>", "browser_settings": {"os_type": "<os-type>", "browser_type": "chrome"}, "proxy_settings":{"protocol":"<http|https|socks5>","country":"<iso-2-country-code>","mode":"built-in"}, "credentials": ["<credential-id>"]}' # Delete profile curl -X DELETE "https://app.nextbrowser.com/api/v1/browser/profiles/<profile-id>" \ -H "Authorization: x-api-key $API_KEY" ```

--- ## 3. Locations

Locations 端点提供可用于代理和浏览器配置的地理位置元数据。使用它们可以在创建配置文件或在特定网络条件下运行任务之前,动态发现支持的国家、地区、城市和 ISP。

```bash # List Countries curl "https://app.nextbrowser.com/api/v1/location/countries?\ limit=<limit>&\ offset=<offset>&\ name=<name>&\ code=<iso2-code>&\ connection_type=<connection-type>" \ -H "Authorization: x-api-key $API_KEY" ```

```bash # List Regions curl "https://app.nextbrowser.com/api/v1/location/regions?\ country__code=<iso2-country>&\ limit=<limit>&\ offset=<offset>&\ name=<name>&\ code=<region-code>&\ city__code=<city-code>&\ connection_type=<connection-type>" \ -H "Authorization: x-api-key $API_KEY" ```

```bash # List Cities curl "https://app.nextbrowser.com/api/v1/location/cities?\ country__code=<iso2-country>&\ limit=<limit>&\ offset=<offset>&\ name=<name>&\ code=<city-code>&\ region__code=<region-code>&\ connection_type=<connection-type>" \ -H "Authorization: x-api-key $API_KEY" ```

```bash # List ISPs curl "https://app.nextbrowser.com/api/v1/location/isps?\ country__code=<iso2-country>&\ limit=<limit>&\ offset=<offset>&\ name=<name>&\ code=<isp-code>&\ region__code=<region-code>&\ city__code=<city-code>&\ connection_type=<connection-type>" \ -H "Authorization: x-api-key $API_KEY" ```

---

## 4. Tasks (Subagent)

运行自主浏览器任务 —— 就像一个为你处理浏览器交互的子代理。给它一个提示词,它就会完成任务。

**Always use `fast` mode** —— 针对浏览器任务优化,比其他模型快 3-5 倍。 **Always use `true` for skip_plan_approval** —— 针对自动化任务优化,跳过审批流程并提高性能。

```bash curl -X POST "https://app.nextbrowser.com/api/v1/chat/tasks" \ -H "Authorization: x-api-key $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "task_description": "'"\ Go to Reddit.com account, check if the account is logged in (if not, use credentials stored). \ Find 10 relevant posts on the topic of AI Agents, upvote 8 of them and post 3 witty-sounding comments \ that a cynical and funny Reddit user would post. Ensure that the comment is posted, ask for approval \ if you are not sure whether such comment is okay. By the end, you should have at least 10 relevant posts \ viewed, 8 upvotes, and 3 comments."\ "'", "mode": "fast", "profile_id": "<profile-id>", "skip_plan_approval": true }' ```

### Endpoint: Poll for completion

```bash curl "https://app.nextbrowser.com/api/v1/chat/tasks/<task-id>" \ -H "Authorization: x-api-key $API_KEY" curl "https://app.nextbrowser.com/api/v1/chat/tasks/<task-id>?from_step=3" \ -H "Authorization: x-api-key $API_KEY" ```

- **Query params (optional)**: - **from_step**: integer `>= 1`。要返回的第一个步骤索引。如果缺失或无效,默认为 `1`。使用此参数仅轮询新步骤。

### Response

```json { "success": true, "payload": { "status": "finished", "output": "Task completed. 10 relevant posts are viewed, 8 upvotes are done and 3 comments posted.", "isSuccess": true, "steps": [ { "created_at": "2025-01-01T10:00:00Z", "finished_at": "2025-01-01T10:00:05Z", "description": "Opened Reddit search page", "status": "completed", "step_number": 1 } // ... more steps starting from from_step ], "total_steps": 5 }, "errors": {}, "description": "Task retrieved successfully" } ```

### Field semantics

- **status**: 高级任务状态:`"processing" | "finished" | "failed"`。 - **output**: 最终任务输出(如果有)。 - **isSuccess**: 如果任务成功完成则为 `true`,否则为 `false`。 - **steps**: 从 `from_step`(或默认从 `1`)开始的任务步骤列表。 - **step_number**: 任务中该步骤的序号,在此数组中始终从 `1` 开始。 - **total_steps**: 任务拥有的总步骤数,与 `from_step` 无关。

### Task options

| Option | Description | |--------|------------------------| | `task_description` | Your prompt (required) | | `mode` | Always use `fast` | | `profile_id` | Use a profile for auth | | `skip_plan_approval` | Always use `true`|

---

## Full API Reference

请参阅 [references/api.md](references/api.md) 了解所有端点,包括 Sessions、Files、Skills 和 Skills Marketplace。

更多产品