> ## 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.

# Control a Browser Session

> Ways to drive a cloud browser session — natural language, your own code, REST endpoints, or OS-level primitives.

Once you have a [browser session](/quickstart/browser-sessions), you can control it in several ways. Pick the approach that matches how much logic you want Anchor to handle.

<CardGroup cols={2}>
  <Card title="Natural language" icon="message-bot" href="/agentic-browser-control/ai-task-completion">
    Send a plain-English instruction and let an AI agent navigate, click, and extract for you. Same capability via the SDK (`agent.task`) or the [Perform Web Task](/api-reference/ai-tools/perform-web-task) REST endpoint.
  </Card>

  <Card title="Your own code" icon="code" href="/quickstart/create-session">
    Connect with Playwright or Puppeteer over CDP and write the automation yourself. Full control over every step.
  </Card>

  <Card title="REST API" icon="screwdriver-wrench" href="#rest-api">
    Call HTTP endpoints for screenshots, page content, PDFs, and perform-web-task — no SDK required.
  </Card>

  <Card title="OS-level control" icon="computer-mouse" href="/advanced/os-level-control">
    Drive the session with mouse, keyboard, and screen coordinates. Used by computer-use agents and vision models.
  </Card>
</CardGroup>

## REST API

Anchor exposes browser actions as REST endpoints you can call from any language or agent framework. Pass an optional `sessionId` query parameter to run on an existing session; omit it and Anchor provisions a browser for the request.

### AI endpoints

| Endpoint                                                                           | What it does                                                                                                                     |
| ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [Perform Web Task](/api-reference/ai-tools/perform-web-task)                       | Natural-language instruction — the agent navigates, interacts, and returns a result. Same capability as `agent.task` in the SDK. |
| [Get Perform Web Task Status](/api-reference/ai-tools/get-perform-web-task-status) | Poll an async perform-web-task run by `workflow_id`.                                                                             |

See [Perform Web Task](/agentic-browser-control/ai-task-completion) for SDK usage, agent options, and [Async execution](/agentic-browser-control/async-perform-web-task) for the async flow.

### Page endpoints

| Endpoint                                                        | What it does                                                                                                            |
| --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| [Screenshot Webpage](/api-reference/tools/screenshot-webpage)   | Fully JavaScript-rendered PNG screenshot of a URL.                                                                      |
| [Get Webpage Content](/api-reference/tools/get-webpage-content) | LLM-ready Markdown (or HTML) of a rendered page. PDF URLs are supported — text is extracted the same as any other page. |
| [Get Page PDF](/api-reference/tools/get-page-pdf)               | Renders the page and returns a PDF file.                                                                                |

<Note>
  The **Screenshot Webpage** endpoint does not support PDF URLs. Use **Get Webpage Content** to extract text from PDFs.
</Note>

### Session-less fetch

| Endpoint                                          | What it does                                                                                                                      |
| ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| [Web Unlocker](/api-reference/tools/web-unlocker) | Fetch rendered content from bot-protected sites without managing a session. See the [Web Unlocker guide](/advanced/web-unlocker). |

See [API Quick Start](/quickstart/use-via-api) for authentication and your first REST call. To expose Anchor from Cursor, Claude, or other agent tools, see [MCP integration](/advanced/mcp).

## Compiled workflows

For repeatable, versioned flows — not one-off session control — see [Automation Tasks](/tasks/overview). Use [Which task type?](/tasks/which-task-type) to compare Perform Web Task with Automation Tasks.
