网淘吧来吧,欢迎您!

Nextbrowser技能使用说明

2026-03-29 新闻来源:网淘吧 围观:4
电脑广告
手机广告

Nextbrowser

Nextbrowser 通过 API 提供云浏览器和自动化浏览器操作。

文档:

Nextbrowser

设置

API 密钥从 openclaw 配置中读取,路径为skills.entries.next-browser.apiKey

如果未配置,请告知用户:

要使用 Nextbrowser,您需要一个 API 密钥。请在此处获取:https://app.nextbrowser.com/user-settings(新注册用户可获得 2000 免费积分)。然后进行配置:

openclaw config set skills.entries.next-browser.apiKey "YOUR_API_KEY"

重要提示:Nextbrowser 的 API 密钥可能有多种格式和前缀。 请勿自行验证密钥格式 - 直接使用用户提供的任何密钥即可。如果密钥无效,API 将返回身份验证错误,届时再请用户验证其密钥。

基础 URL:https://app.nextbrowser.com/api/v1

所有请求都需要包含以下请求头:授权:x-api-key <apiKey>


1. 凭据管理器

凭据管理器可在浏览器运行和自动化任务期间安全地存储并复用认证数据。

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

2. 配置文件

配置文件可在不同浏览器会话间保持Cookie和登录状态。创建一个配置文件后,在浏览器中登录您的账户即可重复使用。

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

# Start browser for profile (creates browser instance)
curl -X POST "https://app.nextbrowser.com/api/v1/browser/profiles/<profile-id>/start" \
  -H "Authorization: x-api-key $API_KEY"

# Get profile details (check status after start)
curl "https://app.nextbrowser.com/api/v1/browser/profiles/<profile-id>" \
  -H "Authorization: x-api-key $API_KEY"

# Stop browser for profile
curl -X PUT "https://app.nextbrowser.com/api/v1/browser/profiles/<profile-id>/stop" \
  -H "Authorization: x-api-key $API_KEY"

操作系统类型: browser_settings.os_type用于定义浏览器使用的操作系统指纹。支持的值为windowslinuxmacosandroid。如未提供,则默认值为linux

重要提示:创建新配置文件(或重新创建配置文件,例如要更改国家/地区)后,您必须调用start端点为其创建浏览器实例。如果配置文件中没有正在运行的浏览器,任务将会失败。

启动/停止流程:调用/start后,轮询GET /browser/profiles/<profile-id>直到状态变为active。只有在那之后才能继续执行任务,或在使用完毕后调用/stop


3. 地理位置

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

# 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"
# 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"
# 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"
# 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. 任务(子代理)

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

始终使用fast模式。- 针对浏览器任务进行优化,比其他模型快3-5倍。始终使用true作为skip_plan_approval的值- 为自动化任务优化,跳过审批并提升性能。

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,
    "send_email_notification": false
  }'

端点:停止聊天会话和任务

chat-session-id 在 - POST /api/v1/chat/tasks 的响应中返回

curl -X PUT "https://app.nextbrowser.com/api/v1/chat/sessions/<chat-session-id>/stop" \
  -H "Authorization: x-api-key $API_KEY"

端点:轮询完成状态

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"
  • 查询参数(可选)
    • from_step:整数>= 1。要返回的第一个步骤索引。默认为1(如果缺失或无效)。使用此参数仅轮询新的步骤。

响应

{
  "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"
}

字段语义

  • status:高级任务状态:"processing" | "finished" | "failed"
  • 输出:最终任务输出(如果可用)。
  • isSuccesstrue如果任务成功完成,否则为false
  • steps:任务步骤列表,从from_step开始(或默认从1开始)。
  • step_number:步骤在任务中的顺序编号,在此数组中始终从1开始。
  • total_steps:任务的总步骤数,与from_step无关。

任务选项

选项描述
任务描述您的提示(必填)
模式始终使用快速
配置文件ID使用配置文件进行身份验证
跳过计划审批始终使用
发送邮件通知如果,任务完成时将发送邮件通知。

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第326257名访客 今日有221篇新文章/评论