Skip to main content
POST
Interact with the browser session associated with a scrape job
Use this endpoint to continue interacting with the same browser state initialized from a previous scrape. Either code or prompt must be provided — not both. POST /v2/scrape/{jobId}/interact handles the full lifecycle:
  1. If no browser session exists for this scrape job yet, Firecrawl creates one at the same page state as the original scrape.
  2. When code is provided, Firecrawl runs it in the browser sandbox. When prompt is provided, an AI agent automates the task using natural language.
  3. Later POST /interact calls on the same jobId reuse the same live browser state.
When you are done, call DELETE /v2/scrape/{jobId}/interact to stop the session.

Path Parameters

Request Body

Response

Example Request (Code)

Example Response (Code)

Example Request (Prompt)

Example Response (Prompt)

Error Codes

For detailed usage with examples, see the Interact feature guide.

Authorizations

Authorization
string
header
required

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

Path Parameters

jobId
string<uuid>
required

The scrape job ID

Body

application/json
code
string
required

Code to execute in the scrape-bound 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
default:30

Execution timeout in seconds

Required range: 1 <= x <= 300
origin
string

Optional origin label used for execution telemetry

Response

Code executed successfully

success
boolean
cdpUrl
string | null

Raw Chrome DevTools Protocol (CDP) WebSocket URL for the browser session. Use it to connect directly with Playwright, Puppeteer, or any CDP client.

liveViewUrl
string | null

Read-only live view URL for the browser session

interactiveLiveViewUrl
string | null

Interactive live view URL (viewers can control the browser)

output
string | null

AI agent's final response (only present when using prompt)

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