A secure browser sandbox where agents can interact with the web.
For agent workflows, use Interact. Interact is the supported CLI/MCP path and can be driven with prompts or code after a scrape; MCP also supports opening from a URL directly.
Surface
Use it for
Entry point
Agent surface
Browser Sandbox
Standalone browser sessions for API/SDK users that need a sandbox, CDP URL, live view, or persistent session lifecycle
POST /v2/interact
API and SDKs; hidden CLI browser command is legacy
Interact
Acting on a scraped page; MCP can also open from a URL with firecrawl_interact URL mode
POST /v2/scrape/{scrapeId}/interact, CLI interact after scrape, or MCP firecrawl_interact
Recommended for CLI/MCP agent workflows
Firecrawl Browser Sandbox gives API and SDK users a secure browser environment where agents can interact with the web. Fill out forms, click buttons, authenticate, and more.
No local setup, no Chromium installs, no driver compatibility issues. Agent browser and playwright are pre-installed.Available via API, Node SDK, Python SDK, and Vercel AI SDK. The hidden firecrawl browser CLI command is legacy; CLI and MCP agent flows should use scrape + interact instead.To add Interact support to an AI coding agent (Claude Code, Codex, Open Code, Cursor, etc.), install the Firecrawl skill:
npx -y firecrawl-cli@latest init --all --browser
Each session runs in an isolated, disposable or persistent sandbox that scales without managing infrastructure.
# Install the Firecrawl CLInpm install -g firecrawl-cli# Shorthand - auto-launches a session, no "execute" neededfirecrawl browser "open https://news.ycombinator.com"firecrawl browser "snapshot"firecrawl browser "scrape"# Close when donefirecrawl browser close
# Launch with live view and custom TTLfirecrawl browser launch-session --stream --ttl 120 --ttl-inactivity 60# Launch and save session info to filefirecrawl browser launch-session -o session.json --json
Run Python, JavaScript, or bash code in your session. Output is returned via stdout; for Node.js, the last expression value is also available in result.
import { Firecrawl } from 'firecrawl';const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });const result = await firecrawl.browserExecute("YOUR_SESSION_ID", { code: 'await page.goto("https://example.com"); const title = await page.title(); console.log(title);', language: "node",});console.log(result);
Files downloaded inside a session can be captured and returned as base64. Use Playwright’s download API via the execute endpoint:
import base64async with page.expect_download() as download_info: await page.click('a#download-link') # Click the element that triggers the downloaddownload = download_info.valuepath = await download.path()# Optionally save to a known path# await download.save_as('/tmp/myfile.pdf')# Read and output file content as base64with open(path, "rb") as f: content = base64.b64encode(f.read()).decode() print(content)
// Get the download URL from the link elementconst href = await page.getAttribute('a#download-link', 'href');// Fetch the file in the browser context and convert to base64const b64 = await page.evaluate(async (url) => { const resp = await fetch(url); const blob = await resp.blob(); return new Promise((resolve) => { const reader = new FileReader(); reader.onloadend = () => resolve(reader.result.split(',')[1]); reader.readAsDataURL(blob); });}, href);process.stdout.write(b64);
The sandbox filesystem is ephemeral — downloaded files are lost when the session ends. To persist files, read their content within the session and save it to your own storage. Persistent profiles preserve browser state (cookies, localStorage) but not files on disk.
agent-browser is a headless browser CLI pre-installed in every sandbox. Instead of writing Playwright code, agents send simple bash commands. The CLI auto-injects --cdp so agent-browser connects to your active session automatically.
The firecrawl browser CLI examples below are for legacy Browser Sandbox sessions. For CLI/MCP agent workflows, prefer firecrawl interact or the MCP firecrawl_interact tool.
The fastest way to use browser. Both the shorthand and execute send commands to agent-browser automatically. The shorthand just skips execute and auto-launches a session if needed:
By default, each browser session starts with a clean slate. With profile, you can save and reuse browser state across sessions. This is useful for staying logged in and preserving preferences.To save or select a profile, use the profile parameter when creating a session.
# Launch with a profile (saves changes by default)firecrawl browser launch-session --profile my-profile# Launch with a profile in read-only modefirecrawl browser launch-session --profile my-profile --no-save-changes# Shorthand: launch with profile + execute in one stepfirecrawl browser --profile my-profile "open https://example.com"
Parameter
Default
Description
name
—
A name for the persistent profile. Sessions with the same name share storage.
saveChanges
true
When true, browser state is saved back to the profile on close. Set to false to load existing data without writing — useful when you need multiple concurrent readers.
Only one session can save to a profile at a time. If another session is already saving, you’ll get a 409 error. You can still open the same profile with saveChanges: false, or try again later.
The browser session state only saves when the session is closed. So we recommend closing the browser session when you are done with it so it can be reused. Once a session is closed, its session ID is no longer valid — you cannot reuse it. Instead, create a new session with the same profile name and use the new session ID returned in the response. To save and close it:
import { Firecrawl } from 'firecrawl';const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });await firecrawl.deleteBrowser("YOUR_SESSION_ID");
from firecrawl import Firecrawlapp = Firecrawl(api_key="fc-YOUR-API-KEY")app.delete_browser("YOUR_SESSION_ID")
# Close the active sessionfirecrawl browser close# Close a specific sessionfirecrawl browser close --session <id>
Every session returns a liveViewUrl in the response that you can embed to watch the browser in real time. Useful for debugging, demos, or building browser-powered UIs.
The response also includes an interactiveLiveViewUrl. Unlike the standard live view which is view-only, the interactive live view allows users to click, type, and interact with the browser session directly through the embedded stream. This is useful for building user-facing browser UIs, collaborative debugging, or any scenario where the viewer needs to control the browser.
Every session exposes a CDP WebSocket URL. The execute API and --bash flag cover most use cases, but if you need full local control you can connect directly.