Execute code or an AI prompt in the browser session bound to a scrape job.
code or prompt must be provided — not both.
POST /v2/scrape/{jobId}/interact handles the full lifecycle:
code is provided, Firecrawl runs it in the browser sandbox. When prompt is provided, an AI agent automates the task using natural language.POST /interact calls on the same jobId reuse the same live browser state.DELETE /v2/scrape/{jobId}/interact to stop the session.
| Parameter | Type | Required | Description |
|---|---|---|---|
jobId | string (UUID) | Yes | The scrape job ID from data.metadata.scrapeId in the scrape response |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
code | string | No | — | Code to execute in the browser sandbox (1–100,000 chars). Required if prompt is not set. |
prompt | string | No | — | Natural language task for the AI agent (1–10,000 chars). Required if code is not set. |
language | string | No | "node" | One of "python", "node", or "bash". Only used with code. |
timeout | number | No | 30 | Execution timeout in seconds (1–300). |
origin | string | No | — | Optional origin label used for telemetry. |
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the execution completed without errors |
liveViewUrl | string | Read-only live view URL for the browser session |
interactiveLiveViewUrl | string | Interactive live view URL (viewers can control the browser) |
output | string | AI agent’s final response (only present when using prompt) |
stdout | string | Standard output from the code execution |
result | string | Return value — last expression value for Node.js, final page snapshot for prompt |
stderr | string | Standard error output |
exitCode | number | Exit code of the execution (0 = success) |
killed | boolean | Whether the execution was terminated due to timeout |
error | string | Error message (only present on failure) |
| Status | Description |
|---|---|
402 | Insufficient credits for a browser session |
403 | Scrape job belongs to a different team |
404 | Scrape job not found |
409 | Replay context unavailable — rerun the scrape and try again |
410 | Browser session has already been destroyed |
429 | Maximum concurrent browser sessions reached |
502 | Browser service or AI agent execution failed |
503 | Browser feature not configured (self-hosted only) |
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The scrape job ID
Code to execute in the scrape-bound 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 <= 300Optional origin label used for execution telemetry
Code 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