创建登录态
POST
/browserbase/v1/contexts● 支持请求参数
projectIdstring可选The Project ID. Can be found in Settings. Optional - if not provided, the project will be inferred from the API key.
namestring可选Optional user-defined name for the Context. Leading and trailing whitespace is trimmed before storage. Names are unique within the project among active Contexts, compared case-insensitively.
返回
201
仅支持服务指南列出的能力;部分官方请求参数不可用。
错误含 statusCode、error、message;自有面另含 code。请求 ID 见 X-Request-Id。 错误
请求示例
curl
curl -X POST "https://api.deepraxis.com/browserbase/v1/contexts" \
-H "X-BB-API-Key: $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Python
import os, requests
response = requests.request("POST", f"https://api.deepraxis.com/browserbase/v1/contexts",
headers={"X-BB-API-Key": os.environ["PRAXIS_API_KEY"]},
json={}
)
print(response.status_code, response.text)TypeScript
const response = await fetch(`https://api.deepraxis.com/browserbase/v1/contexts`, {
method: "POST",
headers: { "X-BB-API-Key": `${process.env.PRAXIS_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({}),
});
console.log(response.status, await response.text());反检测、扩展和 Selenium 不可用;代理只接受 external 类型且需组织开放。region 和 solveCaptchas 接受但忽略;不提供区域选择或验证码代解。
响应
HTTP 201
The request has succeeded and a new resource has been created as a result.
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| publicKey | string | The public key to encrypt the user-data-directory. |
| cipherAlgorithm | string | The cipher algorithm used to encrypt the user-data-directory. AES-256-CBC is currently the only supported algorithm. |
| initializationVectorSize | integer | The initialization vector size used to encrypt the user-data-directory. Read more about how to use it. |