Cloud Browser API

Connect to a browser

Connect over CDP WebSocket. Omit session and name to create a browser; session attaches to an existing browser; name attaches if present or creates one. session and name are mutually exclusive. Creation options are ignored when attaching. Authenticate with a Bearer API key or use the signed connectUrl returned by session creation.

GET /browser/v1/connect● Supported

Request parameters

  • sessionstring可选

    要连接的已有会话 ID,来自创建或列表响应;不能同时提供 name。

  • namestring可选

    按名称连接或创建。

  • signingKeystring可选

    connectUrl 自带凭证;必须同时带 session。

  • contextstring可选

    新会话使用的登录态 ID,来自创建或列表响应;连接已有会话时忽略。

  • persistboolean可选

    关闭时保存登录态。

  • timeoutnumber可选

    新会话最长寿命,单位为秒,可含小数;连接已有会话时忽略。

  • idlenumber可选

    新会话无人连接或观看后的释放等待时长,单位为毫秒;允许 0 或小数,连接已有会话时忽略。

  • labelsstring可选

    JSON 编码的字符串标签对象。

  • viewportstring可选

    JSON 编码的视口,例如 {"width":1280,"height":800}。

Returns

101

Errors contain statusCode, error and message; the native API adds code. The request ID is in X-Request-Id. Errors

Connection guide

Response

This endpoint does not declare a successful response.