> ## 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. AI agents should start at https://docs.anchorbrowser.io/for-agents, then get an API key with Agent Access at https://docs.anchorbrowser.io/quickstart/agent-access — no dashboard account required. Read those two pages before authentication or API calls.

# Action Index

> Cached, proven web actions your agent can reuse to finish tasks faster, cheaper, and more reliably.

The action index is a cache of proven web actions on real websites, like searching jobs on Walmart or finding products on Amazon. Anchor has already worked out how to do each one, so the agent doesn't have to rediscover it on every run.

When your agent lands on a site with cached actions, it can finish a whole step, such as "search with these filters", in a single call. Without the index, it clicks through the page one element at a time.

You can use it in two ways:

* **Inside a web task**: set `use_action_index_tools: true` on [Perform Web Task](/agentic-browser-control/ai-task-completion) and the agent picks the right action itself.
* **Directly**: look up the actions for a site and run one by name, with no AI agent involved.

## Benefits

<CardGroup cols={2}>
  <Card title="Higher success rate" icon="circle-check">
    Cached actions already know how a site's search, filters, and pagination work, so the agent stops getting lost on complex pages.
  </Card>

  <Card title="Fewer tokens" icon="coins">
    One action replaces a long loop of screenshots, clicks, and retries, so each task costs less.
  </Card>

  <Card title="Faster results" icon="gauge-high">
    Fewer steps per task and fewer failed runs to repeat.
  </Card>

  <Card title="Smaller models, top results" icon="arrow-trend-up">
    Open and low-cost models gain the most, so you can switch to a cheaper model without losing accuracy.
  </Card>
</CardGroup>

## Use the index in a web task

Set `use_action_index_tools` to `true`. The agent sees only the actions for the domain it is on, and falls back to normal browsing for everything else.

<CodeGroup>
  ```javascript node.js theme={null}
  import { client } from 'anchorbrowser';

  client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });

  const { data: response } = await client.post({
    url: '/v1/tools/perform-web-task',
    body: {
      url: 'https://cookpad.com/',
      prompt: 'Find recipes for chocolate chip cookies without nuts and list the first five titles.',
      agent: 'browser-use',
      use_action_index_tools: true,
    },
  });

  console.log(response.data.result);
  // Names of the cached actions the agent ran
  console.log(response.data.action_index_tools_used);
  ```

  ```python python theme={null}
  import os
  from anchorbrowser import Anchorbrowser

  anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))

  response = anchor_client.post(
      '/v1/tools/perform-web-task',
      body={
          'url': 'https://cookpad.com/',
          'prompt': 'Find recipes for chocolate chip cookies without nuts and list the first five titles.',
          'agent': 'browser-use',
          'use_action_index_tools': True,
      },
      cast_to=object,
  )

  print(response['data']['result'])
  # Names of the cached actions the agent ran
  print(response['data'].get('action_index_tools_used'))
  ```
</CodeGroup>

`action_index_tools_used` appears only when the agent ran at least one action. Add `?includeTokens=true` to the URL to also get token `usage` and compare runs with and without the index.

<Note>
  When you omit `use_action_index_tools`, it defaults to `true` on free plans and `false` on paid plans. An explicit `true` or `false` always wins. It works with every agent except [Jev](/agentic-browser-control/computer-use-agents/jev), which accepts the flag and ignores it.
</Note>

## Run an action directly

Use the index without an agent when you already know what you want to do on a site.

<Steps>
  <Step title="Find actions for a domain">
    `GET /v1/actions-index/search` returns the active actions for a domain, with their input and output schemas.

    <CodeGroup>
      ```javascript node.js theme={null}
      const { data: actions } = await client.get({
        url: '/v1/actions-index/search',
        query: { domain: 'cookpad.com' },
      });

      for (const action of actions) {
        console.log(action.name, '-', action.description);
        console.log(action.inputSchema);
      }
      ```

      ```python python theme={null}
      actions = anchor_client.get('/v1/actions-index/search?domain=cookpad.com', cast_to=object)

      for action in actions:
          print(action['name'], '-', action['description'])
          print(action['inputSchema'])
      ```
    </CodeGroup>

    An empty list means the domain has no actions yet. Use Perform Web Task for that site instead.
  </Step>

  <Step title="Execute the action">
    `POST /v1/actions-index/by-name/{name}/execute` runs the cached action in an Anchor browser. Pass `input` that matches the action's `inputSchema`.

    <CodeGroup>
      ```javascript node.js theme={null}
      const { data: run } = await client.post({
        url: '/v1/actions-index/by-name/cookpad-search-recipes/execute',
        body: {
          input: {
            search_query: 'chocolate chip cookies',
            excluded_keywords: 'nuts',
            country_code: 'us',
            max_results: 5,
          },
        },
      });

      console.log(run.success, run.output);
      console.log('Session:', run.sessionId);
      ```

      ```python python theme={null}
      run = anchor_client.post(
          '/v1/actions-index/by-name/cookpad-search-recipes/execute',
          body={
              'input': {
                  'search_query': 'chocolate chip cookies',
                  'excluded_keywords': 'nuts',
                  'country_code': 'us',
                  'max_results': 5,
              },
          },
          cast_to=object,
      )

      print(run['success'], run['output'])
      print('Session:', run['sessionId'])
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "name": "cookpad-search-recipes",
      "sessionId": "25cc5a42-2024-4214-87fd-5612fb693309",
      "success": true,
      "output": {
        "recipe_titles": "[\"Chewy Chocolate Chip Cookies\", \"Brown Butter Chocolate Chip Cookies\", ...]"
      }
    }
    ```

    Without a `sessionId`, Anchor creates a browser at the action's domain and returns its id. The session closes after two idle minutes, so you can chain more actions or a web task on it right away.
  </Step>
</Steps>

### Actions that need a signed-in account

Actions with `authRequired: true` must run in a session that is already signed in. Create the session with an [identity](/essentials/managed-authentication) and pass its id:

<CodeGroup>
  ```javascript node.js theme={null}
  const { data: run } = await client.post({
    url: `/v1/actions-index/by-name/${actionName}/execute`,
    body: { sessionId, input: { /* fields from inputSchema */ } },
  });
  ```

  ```python python theme={null}
  run = anchor_client.post(
      f'/v1/actions-index/by-name/{action_name}/execute',
      body={'sessionId': session_id, 'input': {}},  # fields from inputSchema
      cast_to=object,
  )
  ```
</CodeGroup>

## API reference

| Endpoint | What it does |
| - | - |
| `GET /v1/actions-index/search?domain=` | Active actions for a domain, plus actions that work on any site |
| `GET /v1/actions-index/by-name/{name}` | One action by name |
| `POST /v1/actions-index/by-name/{name}/execute` | Runs an action. Body: `input`, optional `sessionId` |
| `GET /v1/actions-index/` | All actions. Filters: `status`, `domain`, `authRequired` |

## Use it from MCP

The [hosted MCP servers](/advanced/mcp) expose the same index as `search_action_index`, `get_action_index`, and `execute_action_index` tools. `/v1/mcp/actions/{domain}` turns every action for a site into its own tool.


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