v97

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-31135175384.2 KB
Browser Playwright

Execute Playwright/TypeScript code against the browser

Execute arbitrary Playwright code in a fresh execution context against the browser. The code runs in the same VM as the browser, minimizing latency and maximizing throughput. It has access to 'page', 'context', and 'browser' variables. It can return a value, and this value is returned in the response.

post/browsers/{id}/playwright/execute

Path parameters

idstring required

Browser session ID

Request body

codestring required

TypeScript/JavaScript code to execute. The code has access to 'page', 'context', and 'browser' variables. It runs within a function, so you can use a return statement at the end to return a value. This value is returned as the result property in the response. Example: "await page.goto('https://example.com'); return await page.title();"

timeout_secinteger

Maximum execution time in seconds. Default is 60.

Response

Code executed successfully

successboolean required

Whether the code executed successfully

{"stackTrail":"components:schemas:ExecutePlaywrightResult:properties:result","oasType":"schema","type":"unknown","description":"The value returned by the code (if any)"}
errorstring

Error message if execution failed

stdoutstring

Standard output from the execution

stderrstring

Standard error from the execution