Skip to main content
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.
A failed run still answers 200. Check exitCode and error before you trust result. Running code does not raise the session price. See Pricing.

Request fields

Send code 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: true and error The 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.
A prompt raises the price of the whole session. Run code when you know the steps. To upload a file first, see Files.