Skip to main content
Firecrawl Browser Sandbox gives your agents a secure, fully managed browser environment. No local setup, no Chromium installs, no driver compatibility issues. Agent browser and playwright are pre-installed. Each session runs in an isolated, disposable sandbox that scales without managing infrastructure. Available via API, CLI (Bash / agent-browser, Python, Node), Node SDK, Python SDK, Vercel AI SDK, and MCP Server. To add browser support to an AI coding agent (Claude Code, Codex, Open Code, Cursor, etc.), install the Firecrawl skill:
npx skills add firecrawl/cli
You can also install the Firecrawl CLI or let the agent install it for you via the above:
npm install -g firecrawl-cli

Quick Start

Create a session, execute code, and close it:
// npm install @mendable/firecrawl-js
import Firecrawl from '@mendable/firecrawl-js';

const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

// 1. Launch a session
const session = await firecrawl.browser();
console.log(session.cdpUrl); // wss://cdp-proxy.firecrawl.dev/cdp/...

// 2. Execute code
const result = await firecrawl.browserExecute(session.id, {
  code: `
    await page.goto("https://news.ycombinator.com");
    const title = await page.title();
    console.log(title);
  `,
  language: "node",
});
console.log(result.result); // "Hacker News"

// 3. Close
await firecrawl.deleteBrowser(session.id);
  • No Driver Installation - No Chromium binary, no playwright install, no driver compatibility issues
  • Python, JavaScript & Bash - Send code via API, CLI, or SDK and get results back. All three languages run remotely in the sandbox
  • agent-browser - Pre-installed CLI with 40+ commands. AI agents write simple bash commands instead of Playwright code
  • Playwright loaded - Playwright comes pre-installed in the sandbox. Agents can write Playwright code if they prefer.
  • CDP Access - Connect your own Playwright instance over WebSocket when you need full control
  • Live View - Watch sessions in real time via embeddable stream URL

Launch a Session

Returns a session ID, CDP URL, and live view URL.
import Firecrawl from '@mendable/firecrawl-js';

const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

const session = await firecrawl.browser({
  ttl: 120,
  activityTtl: 60,
});

console.log(session.id);
console.log(session.cdpUrl);      // wss://cdp-proxy.firecrawl.dev/cdp/...
console.log(session.liveViewUrl); // https://liveview.firecrawl.dev/...
Response
{
  "success": true,
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "cdpUrl": "wss://cdp-proxy.firecrawl.dev/cdp/550e8400-e29b-41d4-a716-446655440000",
  "liveViewUrl": "https://liveview.firecrawl.dev/550e8400-e29b-41d4-a716-446655440000"
}

Execute Code

import Firecrawl from '@mendable/firecrawl-js';

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);
Response
{
  "success": true,
  "result": "Example Domain"
}

agent-browser (Bash Mode)

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.

Shorthand

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:
firecrawl browser "open https://example.com"
firecrawl browser "snapshot"
firecrawl browser "click @e5"

CLI

The explicit form uses execute. Commands are sent to agent-browser automatically — you don’t need to type agent-browser or use --bash:
firecrawl browser execute "open https://example.com"
firecrawl browser execute "snapshot"

API & SDK

Use language: "bash" to run agent-browser commands via the API or SDKs:
curl -X POST "https://api.firecrawl.dev/v2/browser/YOUR_SESSION_ID/execute" \
  -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "agent-browser snapshot",
    "language": "bash"
  }'

Session Management

List Sessions

import Firecrawl from '@mendable/firecrawl-js';

const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

const { sessions } = await firecrawl.listBrowsers();
console.log(sessions);

// Filter by status
const { sessions: active } = await firecrawl.listBrowsers({ status: "active" });
console.log(active);
Response
{
  "success": true,
  "sessions": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "status": "active",
      "cdpUrl": "wss://cdp-proxy.firecrawl.dev/cdp/550e8400-e29b-41d4-a716-446655440000",
      "liveViewUrl": "https://liveview.firecrawl.dev/550e8400-e29b-41d4-a716-446655440000",
      "createdAt": "2025-01-15T10:30:00Z",
      "lastActivity": "2025-01-15T10:35:00Z"
    }
  ]
}

TTL Configuration

Sessions have two TTL controls:
ParameterDefaultDescription
ttl300s (5 min)Maximum session lifetime (30-3600s)
activityTtl120s (2 min)Auto-close after inactivity (10-3600s)

Close a Session

import Firecrawl from '@mendable/firecrawl-js';

const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });

await firecrawl.deleteBrowser("YOUR_SESSION_ID");

Live View

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.
Response
{
  "success": true,
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "cdpUrl": "wss://cdp-proxy.firecrawl.dev/cdp/550e8400-...",
  "liveViewUrl": "https://liveview.firecrawl.dev/550e8400-..."
}
<iframe src="LIVE_VIEW_URL" width="100%" height="600" />

Connecting via CDP

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.
import Firecrawl from '@mendable/firecrawl-js';
import { chromium } from "playwright-core";

const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });
const session = await firecrawl.browser();

const browser = await chromium.connectOverCDP(session.cdpUrl);
const context = browser.contexts()[0];
const page = context.pages()[0] || (await context.newPage());

await page.goto("https://example.com");
console.log(await page.title());

await browser.close();
await firecrawl.deleteBrowser(session.id);

When to Use Browser

Use CaseRight Tool
Extract content from a known URLScrape
Search the web and get resultsSearch
Navigate pagination, fill forms, click through flowsBrowser
Multi-step workflows with interactionBrowser
Parallel browsing across many sitesBrowser (each session is isolated)

Use Cases

  • Competitive intelligence - Browse competitor sites, navigate search forms and filters, extract pricing and features into structured data
  • Knowledge base ingestion - Navigate help centers, docs, and support portals that require clicks, pagination, or authentication
  • Market research - Launch parallel browser sessions to build datasets from job boards, real estate listings, or legal databases

Pricing

Pricing is straightforward: 2 credits per browser minute. Free users get 5 hours of free usage.

Rate limits

For the initial launch, we allow all plans up to have up to 20 concurrent browser sessions.

API Reference


Have feedback or need help? Email help@firecrawl.com or reach out on Discord.