Interact with a Scraped Page
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:
- If no browser session exists for this scrape job yet, Firecrawl creates one at the same page state as the original scrape.
- When
codeis provided, Firecrawl runs it in the browser sandbox. Whenpromptis provided, an AI agent automates the task using natural language. - Later
POST /interactcalls on the samejobIdreuse the same live browser state.
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
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The scrape job ID
Body
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
Response
Code executed successfully
Raw Chrome DevTools Protocol (CDP) WebSocket URL for the browser session. Use it to connect directly with Playwright, Puppeteer, or any CDP client.
Read-only live view URL for the browser session
Interactive live view URL (viewers can control the browser)
AI agent's final response (only present when using prompt)
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

