Execute Playwright code in an active cloud browser session.
| Header | Value |
|---|---|
Authorization | Bearer <API_KEY> |
Content-Type | application/json |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
code | string | Yes | - | Code to execute (1-100,000 characters) |
language | string | No | "node" | Language of the code: "python", "node", or "bash" (for agent-browser CLI commands) |
timeout | number | No | - | Execution timeout in seconds (1-300) |
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the code executed successfully |
stdout | string | Standard output from the code execution |
result | string | Standard output from the code execution |
stderr | string | Standard error output from the code execution |
exitCode | number | Exit code of the executed process |
killed | boolean | Whether the process was killed due to timeout |
error | string | Error message if execution failed (only present on failure) |
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The browser session ID
Code to execute in the browser sandbox
1 - 100000Language of the code to execute. Use node for JavaScript or bash for agent-browser CLI commands.
python, node, bash Execution timeout in seconds
1 <= x <= 300Code executed successfully
Standard output from the code execution
Standard output (alias for stdout)
Standard error output from the code execution
Exit code of the executed process
Whether the process was killed due to timeout
Error message if the code raised an exception