Skip to main content
POST
Execute code in an interact session

Headers

Request Body

Response

Example Request

Example Response (Success)

Example Response (Error)

Are you an AI agent that needs a Firecrawl API key? See firecrawl.dev/agent-onboarding/SKILL.md for automated onboarding instructions.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

sessionId
string
required

The interact session ID

Body

application/json
code
string
required

Code to execute in the browser sandbox

Required string length: 1 - 100000
language
enum<string>
default:node

Language of the code to execute. Use node for JavaScript or bash for agent-browser CLI commands.

Available options:
python,
node,
bash
timeout
integer

Execution timeout in seconds

Required range: 1 <= x <= 300

Response

Code executed successfully

success
boolean
stdout
string | null

Standard output from the code execution

result
string | null

Standard output (alias for stdout)

stderr
string | null

Standard error output from the code execution

exitCode
integer | null

Exit code of the executed process

killed
boolean

Whether the process was killed due to timeout

error
string | null

Error message if the code raised an exception