POST /v1/browser/{session_id}/execute runs code or a prompt in a session you opened. In your code, page is the session’s page with Playwright-style methods. Every page call is asynchronous, so await it.
200. Check exitCode and error before you trust result. Running code does not raise the session price. See Pricing.
Request fields
Sendcode or prompt. A body with neither returns 400 invalidRequest.
url and zeroDataRetention are not accepted here. Open the page with page.goto, and set zero data retention when you open the session.
Response fields
Errors
- Code past
timeout:killed: trueanderrorThe code ran out of time. - The first call right after a session opens can return
503 internalError. Send it again. - A session that has ended:
410 notFound.