Docs
Browser ›

Get browser

GET/v1/sandboxes/{id}/browser

Whether the sandbox's browser is turned on to be driven from outside it, whether it is running, and where it is reached. It changes nothing, and is answered whatever state the sandbox is in.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. const browser = await sandbox.browser.get();
Answer200 OK · BrowserState
  1. {
  2. "enabled": boolean,
  3. "enabledAt": string | null,
  4. "running": boolean,
  5. "headless": boolean | null,
  6. "cdpUrl": string | null,
  7. "localCdpUrl": string | null,
  8. }

Whether the browser is on, whether it has a window, and the address to drive it at while it runs.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Returns

200 Whether the browser is on, whether it has a window, and the address to drive it at while it runs.

BrowserState6 fields
enabled
boolean
Whether the browser is turned on for the sandbox.
More It stays so through a stop and a start, and a move to another server: Chrome is started again by itself, with nothing open in it.
enabledAt
stringnull
Since when it is on.
More Null when it is off.
running
boolean
Whether Chrome is running in the sandbox's machine now and its DevTools answer.
More False while it is off, while the sandbox is not running, in the moments after a start before it is up again, and while a Chrome that is on the desktop waits for the desktop to be turned on.
headless
booleannull
Whether Chrome has no window.
More False when it is on the desktop, where it is watched as it is driven. Null while it is off.
cdpUrl
stringnull
Where Chrome's DevTools are reached from outside the sandbox, over a WebSocket: what Playwright's connectOverCDP, Puppeteer's connect, browser-use and Stagehand are given.
More It needs no token and is hard to guess, and whoever has it has the whole browser, with what it is signed in to, so it is to be kept as a password is. It stays the same through a stop and a start, and is another each time the browser is turned on. Null while the browser is not running, and where GET /v1/policy says publicUrls is false.
localCdpUrl
stringnull
Where the same DevTools are reached from inside the sandbox, as by playwright-cli attach --cdp.
More Null while the browser is off.

Errors and other answers

404 Not found.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.