> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Anchor Browser is cloud browser infrastructure for AI agents and automation: browser sessions you control over CDP or REST, natural-language web tasks, versioned automation tasks, managed authentication into third-party web apps (identities with MFA), persistent volumes and profiles, recordings, live view, batch sessions, webhooks, and network options including residential proxies, extra stealth, and captcha solving for sites that block standard browsers. The for-agents page (https://docs.anchorbrowser.io/for-agents) covers authentication and the first API calls. API keys are created at https://app.anchorbrowser.io/api-keys. Append .md to any page URL for its Markdown version. The SDKs read the API key from ANCHORBROWSER_API_KEY, and REST calls send it in the anchor-api-key header. End every session you create with DELETE /v1/sessions/{id}, because a session is billed until it ends. Location targeting, captcha solving and managed authentication need the Starter plan, and extra stealth needs the Growth plan; on the Free plan, create a session with an empty body. Plans and limits are at https://docs.anchorbrowser.io/pricing. The hosted MCP server is https://api.anchorbrowser.io/v1/mcp.

# Firecrawl

> Research the public web with Firecrawl, then finish the signed-in steps in an Anchor cloud browser. Python and TypeScript examples.

[Firecrawl](https://www.firecrawl.dev/?utm_source=anchor) turns the public web into clean, structured data: search, scrape, crawl, map and extract, over one API with SDKs, a CLI and an MCP server.

The two products split the work cleanly:

* **Firecrawl reads the open web.** Search for pages, pull them as Markdown or typed JSON, crawl a whole site, extract fields against a schema. Fast, no session to manage.
* **Anchor does the part that needs a real, signed-in browser.** Sign in with stored credentials and MFA, re-authenticate when a session expires, then finish a multi-step task behind the login: fill a form, file a request, update a record.

This guide builds one agent that does both: Firecrawl finds a vendor and pulls its pricing, then an Anchor browser signs in to an internal portal and files a purchase request with the numbers Firecrawl found. No payment step, anywhere.

## Prerequisites

* Python 3.10 or higher, or Node.js 22 or higher
* A Firecrawl API key from [firecrawl.dev/app/api-keys](https://www.firecrawl.dev/app/api-keys?utm_source=anchor)
* An Anchor API key from the [Anchor dashboard](https://app.anchorbrowser.io/api-keys)
* An Anchor [identity](https://docs.anchorbrowser.io/essentials/authenticated-applications.md) for the app you sign in to. [Managed authentication](https://docs.anchorbrowser.io/essentials/managed-authentication.md) needs the Starter plan or higher.

> [!NOTE]
>
> This guide uses **Net Sweet** (`netsweet.co`), the demo app that ships with every Anchor account, and its `demo.admin` identity. You can run every step below against it with no third-party account. Find the identity ID under [Identities](https://app.anchorbrowser.io/identities).

![The Identities page in the Anchor dashboard showing the Net Sweet application and its demo.admin identity.](https://mintcdn.com/anchor-b3ec2715/glLlnMDzlmujKm1e/images/firecrawl-anchor/anchor-identities.png?fit=max\&auto=format\&n=glLlnMDzlmujKm1e\&q=85\&s=e04dfe5ba7a2ae0cda649af79c9be0a6)

In Firecrawl, open **API Keys** and click **Create**.

![The API Keys page in the Firecrawl dashboard, with the Create button outlined.](https://mintcdn.com/anchor-b3ec2715/glLlnMDzlmujKm1e/images/firecrawl-anchor/firecrawl-api-keys.png?fit=max\&auto=format\&n=glLlnMDzlmujKm1e\&q=85\&s=b271faaa93e21f8d2e5c863c1f215c9a)

In Anchor, create a key under **API Keys**.

![The API Keys page in the Anchor dashboard, with the Create key button outlined.](https://mintcdn.com/anchor-b3ec2715/glLlnMDzlmujKm1e/images/firecrawl-anchor/anchor-api-keys.png?fit=max\&auto=format\&n=glLlnMDzlmujKm1e\&q=85\&s=c7c7a1921019cfb257e8c6a959576544)

## Setup

1. **Set your API keys:**

```bash theme={null}
export FIRECRAWL_API_KEY="your-firecrawl-key"
export ANCHORBROWSER_API_KEY="your-anchor-key"
export ANCHOR_IDENTITY_ID="your-identity-id"
```

2. **Install dependencies:**

```bash Python theme={null}
pip install firecrawl anchorbrowser
```

```bash Node.js theme={null}
npm install firecrawl anchorbrowser
npm install -D tsx
npm pkg set type=module
```

You don't run `playwright install` or launch a browser locally. The browser runs in Anchor's cloud, and the SDK drives it over Anchor's API.

## Choose your browser power

Not every page needs the same browser. Pick the session configuration for the target and move up only when a site fights back. The task is identical in each tier; only the session changes.

| Tier | Session config | Plan | Use it for |
| - | - | - | - |
| **Light** | no proxy | Free | Public pages that don't block automation |
| **Standard** | agent-vpn + captcha solving | Starter | Geo-fenced pages, captchas, most signed-in apps |
| **Max** | agent-vpn + captcha solving + extra stealth | Growth | Sites with strong bot detection |

Agent-vpn is `session.proxy`. Captcha solving needs an active proxy or a browser profile, and extra stealth needs an active proxy. Set `session.timeout` so a forgotten session ends itself. The example below reads the tier from an env var (`ANCHOR_TIER=light|standard|max`, default `standard`).

> [!WARNING]
>
> If you call `perform-web-task` over REST, pass an existing session as the **`sessionId` query parameter**, not in the request body. In the body it is ignored and Anchor opens a second, unconfigured browser for the task. The SDK calls in this guide send it as a query parameter for you.

## Part 1: Research with Firecrawl

Search for the vendor, scrape its pricing page into typed JSON with a schema. No browser session yet.

```python Python theme={null}
import os

from firecrawl import Firecrawl

VENDOR = "Firecrawl"
firecrawl = Firecrawl(api_key=os.environ["FIRECRAWL_API_KEY"])

PRICING_SCHEMA = {
    "type": "object",
    "properties": {
        "plans": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {"type": "string"},
                    "monthly_price_usd": {"type": "number"},
                    "credits_per_month": {"type": "number"},
                },
                "required": ["name", "monthly_price_usd", "credits_per_month"],
            },
        }
    },
    "required": ["plans"],
}

results = firecrawl.search(f"{VENDOR} pricing", limit=3)
pricing_url = results.web[0].url
doc = firecrawl.scrape(pricing_url, formats=[{"type": "json", "schema": PRICING_SCHEMA}])
plans = doc.json["plans"]
print(f"{len(plans)} plans from {pricing_url}")
```

```typescript Node.js theme={null}
import { Firecrawl } from "firecrawl";

type Plan = { name: string; monthly_price_usd: number; credits_per_month: number };

const VENDOR = "Firecrawl";
const firecrawl = new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY });

const PRICING_SCHEMA = {
  type: "object",
  properties: {
    plans: {
      type: "array",
      items: {
        type: "object",
        properties: {
          name: { type: "string" },
          monthly_price_usd: { type: "number" },
          credits_per_month: { type: "number" },
        },
        required: ["name", "monthly_price_usd", "credits_per_month"],
      },
    },
  },
  required: ["plans"],
};

const results = await firecrawl.search(`${VENDOR} pricing`, { limit: 3 });
const first = results.web?.[0];
if (!first || !("url" in first) || !first.url) throw new Error("No search result");
const pricingUrl = first.url;

const doc = await firecrawl.scrape(pricingUrl, { formats: [{ type: "json", schema: PRICING_SCHEMA }] });
const plans = (doc.json as { plans: Plan[] }).plans;
console.log(`${plans.length} plans from ${pricingUrl}`);
```

## Part 2: Act on it with Anchor

Start a session signed in with your identity, then hand the chosen plan to `perform-web-task`. Anchor fills and submits the request in the portal, and the `finally` block ends the session so it stops billing.

The full, runnable script:

```python vendor_request.py theme={null}
import json
import os
import sys

from anchorbrowser import Anchorbrowser
from firecrawl import Firecrawl

VENDOR = sys.argv[1] if len(sys.argv) > 1 else "Firecrawl"
MIN_CREDITS = int(os.getenv("MIN_CREDITS", "50000"))
TIER = os.getenv("ANCHOR_TIER", "standard")
IDENTITY_ID = os.environ["ANCHOR_IDENTITY_ID"]

PRICING_SCHEMA = {
    "type": "object",
    "properties": {
        "plans": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {"type": "string"},
                    "monthly_price_usd": {"type": "number", "description": "Monthly price when billed yearly. 0 for free."},
                    "credits_per_month": {"type": "number"},
                },
                "required": ["name", "monthly_price_usd", "credits_per_month"],
            },
        }
    },
    "required": ["plans"],
}

RESULT_SCHEMA = {
    "type": "object",
    "properties": {
        "submitted": {"type": "boolean"},
        "confirmation": {"type": "string", "description": "The confirmation text or request ID shown after submitting"},
    },
    "required": ["submitted", "confirmation"],
}

PROXY = {"active": True, "type": "anchor_proxy", "country_code": "us"}
TIERS = {
    "light": {"session": {}, "browser": {}},
    "standard": {"session": {"proxy": PROXY}, "browser": {"captcha_solver": {"active": True}}},
    "max": {
        "session": {"proxy": PROXY},
        "browser": {"captcha_solver": {"active": True}, "extra_stealth": {"active": True}},
    },
}
if TIER not in TIERS:
    raise SystemExit(f'Unknown ANCHOR_TIER "{TIER}" (use light, standard, or max)')

firecrawl = Firecrawl(api_key=os.environ["FIRECRAWL_API_KEY"])
anchor = Anchorbrowser(api_key=os.environ["ANCHORBROWSER_API_KEY"])

results = firecrawl.search(f"{VENDOR} pricing", limit=3)
pricing_url = results.web[0].url
doc = firecrawl.scrape(pricing_url, formats=[{"type": "json", "schema": PRICING_SCHEMA}])
plans = doc.json["plans"]
print(f"firecrawl: {len(plans)} plans from {pricing_url}")

fits = [p for p in plans if p["credits_per_month"] >= MIN_CREDITS and p["monthly_price_usd"] > 0]
if not fits:
    raise SystemExit(f"No paid plan with at least {MIN_CREDITS} credits")
plan = min(fits, key=lambda p: p["monthly_price_usd"])
print("picked:", json.dumps(plan))

config = TIERS[TIER]
session = anchor.sessions.create_session(
    session={**config["session"], "timeout": {"max_duration": 10, "idle_timeout": 3}},
    browser=config["browser"],
    identities=[{"id": IDENTITY_ID}],
)
session_id = session.data.id
print(f"anchor: session {session_id} ({TIER} tier), signed in with identity")

prompt = f"""You are signed in to https://netsweet.co. Open Operations, then New Request, and file one request:
- Title: {VENDOR} {plan['name']} plan subscription
- Priority: Medium
- Department: Engineering (or the closest option)
- Description: {VENDOR} {plan['name']} plan, {int(plan['credits_per_month'])} credits per month at ${plan['monthly_price_usd']} per month (source: {pricing_url})
- Requester Name: Procurement Agent
- Email: procurement@example.com
- Budget: {plan['monthly_price_usd'] * 12:.0f}
- Target Date: any date next month
Leave Phone and Attachments empty. Accept the terms checkbox. Submit the form once, then report the confirmation shown."""

try:
    # Run the task in the signed-in session, passing the session ID.
    response = anchor.tools.perform_web_task(
        session_id=session_id,
        prompt=prompt,
        output_schema=RESULT_SCHEMA,
        max_steps=30,
    )
    data = response.data
    if data.status != "success":
        raise SystemExit(f"Anchor task ended with status {data.status}: {data.result}")
    print("result:", data.result)
    print(f"steps: {data.steps}, time: {data.executionTimeMs} ms")
finally:
    anchor.sessions.delete_session(session_id)
    print("ended session", session_id)
```

```typescript vendor-request.ts theme={null}
import { client, Sessions, Tools } from "anchorbrowser";
import { Firecrawl } from "firecrawl";

const VENDOR = process.argv[2] ?? "Firecrawl";
const MIN_CREDITS = Number(process.env.MIN_CREDITS ?? "50000");
const TIER = process.env.ANCHOR_TIER ?? "standard";
const IDENTITY_ID = process.env.ANCHOR_IDENTITY_ID;
if (!IDENTITY_ID) throw new Error("Set ANCHOR_IDENTITY_ID");

type Plan = { name: string; monthly_price_usd: number; credits_per_month: number };

const PRICING_SCHEMA = {
  type: "object",
  properties: {
    plans: {
      type: "array",
      items: {
        type: "object",
        properties: {
          name: { type: "string" },
          monthly_price_usd: { type: "number", description: "Monthly price when billed yearly. 0 for free." },
          credits_per_month: { type: "number" },
        },
        required: ["name", "monthly_price_usd", "credits_per_month"],
      },
    },
  },
  required: ["plans"],
};

const RESULT_SCHEMA = {
  type: "object",
  properties: {
    submitted: { type: "boolean" },
    confirmation: { type: "string", description: "The confirmation text or request ID shown after submitting" },
  },
  required: ["submitted", "confirmation"],
};

const PROXY = { active: true, type: "anchor_proxy", country_code: "us" } as const;
const TIERS = {
  light: { session: {}, browser: {} },
  standard: { session: { proxy: PROXY }, browser: { captcha_solver: { active: true } } },
  max: {
    session: { proxy: PROXY },
    browser: { captcha_solver: { active: true }, extra_stealth: { active: true } },
  },
};
if (!Object.hasOwn(TIERS, TIER)) throw new Error(`Unknown ANCHOR_TIER "${TIER}" (use light, standard, or max)`);

client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const firecrawl = new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY });

const results = await firecrawl.search(`${VENDOR} pricing`, { limit: 3 });
const first = results.web?.[0];
if (!first || !("url" in first) || !first.url) throw new Error("No search result");
const pricingUrl = first.url;

const doc = await firecrawl.scrape(pricingUrl, { formats: [{ type: "json", schema: PRICING_SCHEMA }] });
const plans = (doc.json as { plans: Plan[] }).plans;
console.log(`firecrawl: ${plans.length} plans from ${pricingUrl}`);

const fits = plans.filter((p) => p.credits_per_month >= MIN_CREDITS && p.monthly_price_usd > 0);
if (fits.length === 0) throw new Error(`No paid plan with at least ${MIN_CREDITS} credits`);
const plan = fits.reduce((a, b) => (a.monthly_price_usd <= b.monthly_price_usd ? a : b));
console.log("picked:", JSON.stringify(plan));

const config = TIERS[TIER as keyof typeof TIERS];
const session = await Sessions.createSession({
  body: {
    session: { ...config.session, timeout: { max_duration: 10, idle_timeout: 3 } },
    browser: config.browser,
    identities: [{ id: IDENTITY_ID }],
  },
});
const sessionId = session.data!.id!;
console.log(`anchor: session ${sessionId} (${TIER} tier), signed in with identity`);

const prompt = `You are signed in to https://netsweet.co. Open Operations, then New Request, and file one request:
- Title: ${VENDOR} ${plan.name} plan subscription
- Priority: Medium
- Department: Engineering (or the closest option)
- Description: ${VENDOR} ${plan.name} plan, ${plan.credits_per_month} credits per month at $${plan.monthly_price_usd} per month (source: ${pricingUrl})
- Requester Name: Procurement Agent
- Email: procurement@example.com
- Budget: ${plan.monthly_price_usd * 12}
- Target Date: any date next month
Leave Phone and Attachments empty. Accept the terms checkbox. Submit the form once, then report the confirmation shown.`;

try {
  // Run the task in the signed-in session. Pass sessionId as the query parameter.
  const response = (await Tools.performWebTask({
    query: { sessionId },
    body: { prompt, output_schema: RESULT_SCHEMA, max_steps: 30 },
  })) as unknown as { data: { status: string; result: string; steps: number; executionTimeMs: number } };
  const data = response.data;
  if (data.status !== "success") throw new Error(`Anchor task ended with status ${data.status}: ${data.result}`);
  console.log("result:", data.result);
  console.log(`steps: ${data.steps}, time: ${data.executionTimeMs} ms`);
} finally {
  await Sessions.deleteSession({ path: { session_id: sessionId } });
  console.log("ended session", sessionId);
}
```

Run it:

```bash Python theme={null}
python vendor_request.py Firecrawl
```

```bash Node.js theme={null}
npx tsx vendor-request.ts Firecrawl
```

## Expected output

This output is from the Python script. Session IDs differ on every run, and the agent may take a different number of steps.

```text theme={null}
firecrawl: 6 plans from https://www.firecrawl.dev/pricing
picked: {"name": "Standard", "monthly_price_usd": 83, "credits_per_month": 100000}
anchor: session <session-id> (standard tier), signed in with identity
result: {"submitted": true, "confirmation": "Request Submitted \u2014 Your operational request has been submitted successfully and is now pending review."}
steps: 13, time: 70086 ms
ended session <session-id>
```

Anchor signs in, fills the New Request form with the plan Firecrawl found, and submits it:

![The New Request form in the Net Sweet demo app, filled by Anchor with the plan name and price Firecrawl extracted. The Title and Description fields are outlined.](https://mintcdn.com/anchor-b3ec2715/glLlnMDzlmujKm1e/images/firecrawl-anchor/netsweet-request-form.png?fit=max\&auto=format\&n=glLlnMDzlmujKm1e\&q=85\&s=b4d0001960c08d9c6dcd471a33ab3b54)

![The Net Sweet Operations page with a Request Submitted confirmation toast, outlined.](https://mintcdn.com/anchor-b3ec2715/glLlnMDzlmujKm1e/images/firecrawl-anchor/netsweet-request-submitted.png?fit=max\&auto=format\&n=glLlnMDzlmujKm1e\&q=85\&s=83face0a4ab20e4c3a0734532d9d4931)

Every run shows up on the session's page in the Anchor dashboard, with its task steps, configuration, credits and a recording:

![An Anchor session page showing the two NetSweet task runs, session configuration, credits used and a live view of the browser. The task runs are outlined.](https://mintcdn.com/anchor-b3ec2715/glLlnMDzlmujKm1e/images/firecrawl-anchor/anchor-session.png?fit=max\&auto=format\&n=glLlnMDzlmujKm1e\&q=85\&s=536f5994eb9d4f9b4b0ef38026eedc50)

The Firecrawl search and scrape calls appear in **Activity Logs**:

![The Firecrawl Activity Logs page showing the SCRAPE and SEARCH calls for the vendor pricing page, outlined.](https://mintcdn.com/anchor-b3ec2715/glLlnMDzlmujKm1e/images/firecrawl-anchor/firecrawl-activity-logs.png?fit=max\&auto=format\&n=glLlnMDzlmujKm1e\&q=85\&s=37a761736ed490be3b436bfac84271fa)

## Use it from an MCP client instead

Both products run hosted MCP servers, so you can do the same thing from a prompt in Claude Code, Cursor or any MCP client, no glue code. Firecrawl's server is keyless for search and scrape; add a key for higher limits.

```bash theme={null}
claude mcp add --transport http firecrawl https://mcp.firecrawl.dev/v2/mcp
claude mcp add --transport http anchor https://api.anchorbrowser.io/v1/mcp
```

Then one prompt uses both: Firecrawl to research, Anchor to act.

```text theme={null}
Use Firecrawl to find Firecrawl's pricing and its plans. Then, with Anchor,
sign in to netsweet.co with my demo.admin identity and file a New Request for
the cheapest paid plan over 50,000 credits. Don't submit any payment.
```

Add your keys as described in [Firecrawl MCP](https://docs.firecrawl.dev/mcp-server?utm_source=anchor) and [Anchor's hosted MCP](https://docs.anchorbrowser.io/advanced/mcp.md).

## Next steps

* Move up a [session tier](#choose-your-browser-power) with [proxies](https://docs.anchorbrowser.io/advanced/proxy.md), [captcha solving](https://docs.anchorbrowser.io/advanced/captcha-solving.md) and [extra stealth](https://docs.anchorbrowser.io/essentials/stealth.md) for sites that block automated browsers
* Create an identity for your own app with [Managed Authentication](https://docs.anchorbrowser.io/essentials/managed-authentication.md), including MFA
* Return structured JSON from any task with [`output_schema`](https://docs.anchorbrowser.io/agentic-browser-control/ai-task-completion)
* Watch or debug runs with [session recordings](https://docs.anchorbrowser.io/essentials/recording.md) and live view
* Explore Firecrawl's [crawl](https://docs.firecrawl.dev/features/crawl?utm_source=anchor) and [extract](https://docs.firecrawl.dev/features/llm-extract?utm_source=anchor) for larger research jobs


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.