Docs
Browser

Browser Create Session

POST/browser/sessions
AuthorizationBearer <token>

Enter your API key with the bc_ prefix

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

block_resources?array<>

Default

[  "media",  "font"]
country?string
idle_timeout_seconds?

Close after this long without browser activity: actions, navigation, CDP traffic, or live-view input. Reading the session does not count.

Range30 <= value <= 1800
Default300
max_credits?number
Range1 <= value
metadata?

Up to 10 string tags (keys: letters, digits, _ . -, max 40 chars) for finding this session later with ?tag=key:value.

profile?
proxy?string

auto starts each site direct and moves to datacenter, then residential, only when blocked. custom sends all traffic through proxy_url. Defaults to none on the free tier, or custom when proxy_url is set.

Default"auto"

Value in

  • "none"
  • "datacenter"
  • "residential"
  • "auto"
  • "custom"
proxy_url?string

Your own http, https or socks5 proxy, with optional credentials. Implies proxy custom. The host must be public and the port 80, 443 or 1024-65535. Traffic through it has no per-MB fee. Berrycrawl never stores or returns this URL.

Lengthlength <= 2048
record?boolean

Record a video of the active tab. The recording is saved as a session file when the browser closes.

Defaultfalse
start_url?string
timeout_seconds?number
Range30 <= value <= 3600
Default900
viewport?
zeroDataRetention?

true is rejected: ZERO_DATA_RETENTION_NOT_SUPPORTED

Defaultfalse

Response Body

application/json

curl -X POST "https://example.com/browser/sessions" \  -H "Content-Type: application/json" \  -d '{}'
{  "data": {    "cdp_url": "string",    "close_reason": "string",    "closed_at": "string",    "country": "string",    "created_at": "string",    "credits_charged": 0,    "expires_at": "string",    "id": "string",    "idle_timeout_seconds": 0,    "live_view_url": "string",    "metadata": {      "property1": "string",      "property2": "string"    },    "proxy": "none",    "record": true,    "route": "string",    "state": "string",    "usage": {      "active_ms": 0,      "credits_so_far": 0,      "direct_bytes": "string",      "proxied_bytes": "string"    }  },  "success": true}