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

# Agent vs. Scrape Mode: Choosing the Right Task Mode

> Compare Figranium's Scrape and Agent task modes: browserless HTTP extraction versus full Playwright automation, with features, trade-offs, and API usage.

Figranium tasks run in one of two main modes. **Agent** mode is the primary and default method: it drives a real Playwright Chromium browser through a sequence of action blocks you define. **Scrape** mode is a lightweight alternative that fetches a page over HTTP and parses the HTML without launching a browser. This page compares the two so you can pick the right mode for each task.

<CardGroup cols={2}>
  <Card title="Agent (default)" icon="robot">
    A full browser runner built on Playwright. It executes your action blocks step by step, including clicks, typing, navigation, JavaScript, and control flow such as `If`, `While`, and `Loop`.
  </Card>

  <Card title="Scrape" icon="bolt">
    A lightweight, browserless runner for fast single-page data extraction. It fetches HTML with `got-scraping` (with proxy and user-agent rotation) and parses it with Cheerio.
  </Card>
</CardGroup>

<Note>
  Agent mode is not autonomous AI decision making. Every step and branch is defined by you and replays the same way on every run.
</Note>

## Feature comparison

| | Agent | Scrape |
| - | - | - |
| **Engine** | Playwright (Chromium) | `got-scraping` + Cheerio |
| **Launches a browser** | Yes | No |
| **Renders client-side JavaScript** | Yes | No, parses the raw HTTP response |
| **Action blocks and control flow** | Yes | No |
| **Extraction** | [Visual or JavaScript extraction](/docs/data-extraction) in the page context | CSS selector or extraction script |
| **Proxy and user-agent rotation** | Yes | Yes |
| [**Stealth plugin**](/docs/stealth-mode) | Yes | No |
| [**CAPTCHA solving**](/docs/captcha-solving) | Yes | No |
| [**Cookie-consent auto-dismissal**](/docs/stealth-mode#cookie-consent-auto-dismissal) | Yes, always on | No, there is no browser to render banners |
| [**Page translation**](/docs/page-translation) | Yes, opt-in per task | No, HTTP-only |
| **Network interception** | Yes | No |
| **Persistent profile (stateful runs)** | `data/browser-profile` | `data/browser-profile-scrape` |
| **Picks up [headful](/docs/headful-browser) cookies** | Yes | Yes |
| [**Stateless execution**](/docs/stateless-execution) | Supported | Supported |
| **Direct API endpoint** | `POST /agent` | `POST /scrape` |

## When to use Agent

Agent is the default for new tasks and the right choice for most workflows. Use it when the page needs a real browser or the workflow involves interaction.

* The content is loaded by client-side JavaScript or AJAX after the initial response.
* You need to log in, fill forms, paginate, or follow a multi-step flow.
* You need branching, loops, or [error handling](/docs/error-handling) between steps.
* The site uses bot detection, cookie banners, or CAPTCHAs.
* You want to run custom [JavaScript](/docs/javascript-execution) inside the page.

## When to use Scrape

Switch to Scrape mode when the data you need is already present in the page's initial HTML response.

* You are extracting content from a single, server-rendered page.
* You want the lowest resource usage and fastest runs, since no browser process starts.
* You do not need to click, type, scroll, or wait for elements to appear.
* The target site does not require CAPTCHA solving or browser fingerprint evasion.

<Tip>
  If a Scrape task returns empty fields because the content is rendered client-side, switch it back to Agent mode and add a **Wait for Selector** block before extraction.
</Tip>

## Switching modes

In the task editor, use the **Mode Selector** to switch between `Agent` and `Scraper`. Tasks created through the [REST API](/docs/rest-api) set the mode with the `mode` field, which accepts `agent`, `scrape`, or `headful`.

To run a one-off job without saving a task, call the direct execution endpoints:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST http://localhost:11345/scrape \
    -H "Content-Type: application/json" \
    -H "x-api-key: $FIGRANIUM_API_KEY" \
    -d '{ "url": "https://example.com", "selector": "h1" }'
  ```

  ```ts JavaScript SDK theme={null}
  const agentResult = await figranium.agent({ url: "https://example.com" });
  const scrapeResult = await figranium.scrape({ url: "https://example.com", selector: "h1" });
  ```
</CodeGroup>

See [ExecutionResource](/docs/sdk/js/resources/execution) for the full SDK reference.

## Related pages

<CardGroup cols={2}>
  <Card title="Action Blocks" icon="cube" href="/docs/action-blocks">
    The building blocks available in Agent mode.
  </Card>

  <Card title="Architecture" icon="sitemap" href="/docs/architecture">
    How the Agent and Scrape runners fit into Figranium.
  </Card>
</CardGroup>


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