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

# Tools

> SDK reference for the Tools resource (TypeScript & Python)

## Perform Web Task

`POST /v1/tools/perform-web-task` — performWebTask

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Tools } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Tools.performWebTask({
    body: {
      prompt: 'string'
    }
  });
  console.log(result);
  ```

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

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.tools.perform_web_task(
      prompt="string",
  )
  print(result)
  ```
</CodeGroup>

## Get Perform Web Task Status

`GET /v1/tools/perform-web-task/{workflowId}/status` — getPerformWebTaskStatus

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Tools } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Tools.getPerformWebTaskStatus({
    path: {
      workflowId: 'your-workflowId'
    }
  });
  console.log(result);
  ```

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

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.tools.get_perform_web_task_status(
      "your-workflow-id",
  )
  print(result)
  ```
</CodeGroup>

## Execute Code Snippet

`POST /v1/tools/execute-code` — executeCode

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Tools } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Tools.executeCode({
    query: {
      sessionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'
    },
    body: {
      code: 'string'
    }
  });
  console.log(result);
  ```

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

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.tools.execute_code(
      session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      code="string",
  )
  print(result)
  ```
</CodeGroup>

## Web Unlocker

`POST /v1/tools/fetch/webpage` — fetchWebpage

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Tools } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Tools.fetchWebpage({
    body: {
      url: 'string'
    }
  });
  console.log(result);
  ```

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

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.tools.fetch_webpage(
      url="string",
  )
  print(result)
  ```
</CodeGroup>

## Screenshot Webpage

`POST /v1/tools/screenshot` — screenshotWebpage

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Tools } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Tools.screenshotWebpage({
    body: {}
  });
  console.log(result);
  ```

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

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.tools.screenshot_webpage()
  print(result)
  ```
</CodeGroup>

## Get Page PDF

`POST /v1/tools/page-pdf` — createPagePdf

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Tools } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Tools.createPagePdf({
    body: {
      url: 'https://example.com'
    }
  });
  console.log(result);
  ```

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

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.tools.create_page_pdf(
      url="https://example.com",
  )
  print(result)
  ```
</CodeGroup>
