# Anchor Browser Docs
> ## 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 create an API key at https://app.anchorbrowser.io/api-keys. Read the for-agents page before authentication or API calls.
# Action Index
Source: https://docs.anchorbrowser.io/advanced/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
> [card] Higher success rate
>
> Cached actions already know how a site's search, filters, and pagination work, so the agent stops getting lost on complex pages.
> [card] Fewer tokens
>
> One action replaces a long loop of screenshots, clicks, and retries, so each task costs less.
> [card] Faster results
>
> Fewer steps per task and fewer failed runs to repeat.
> [card] Smaller models, top results
>
> Open and low-cost models gain the most, so you can switch to a cheaper model without losing accuracy.
## 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.
```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'))
```
`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.
## Run an action directly
Use the index without an agent when you already know what you want to do on a site.
**1. Find actions for a domain**
`GET /v1/actions-index/search` returns the active actions for a domain, with their input and output schemas.
```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'])
```
An empty list means the domain has no actions yet. Use Perform Web Task for that site instead.
**2. 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`.
```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'])
```
```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.
### 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:
```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,
)
```
## 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.
# Ad Blocker
Source: https://docs.anchorbrowser.io/advanced/adblocker
Block ads, trackers, and unwanted content in your browser sessions
Ad blocking is enabled by default in Anchor Browser. It blocks ads, trackers, and malicious content to improve page load times and create cleaner automation.
> [!NOTE]
>
> Ad blocking is enabled by default. Disable it only if you need to test ad-related functionality.
## Quick Start
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
// Optional: ad blocking is enabled by default, so this configuration is not required
body: {
browser: {
adblock: {
active: true // Set to false to disable ad blocking
}
}
}
});
console.log("Session:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
# Optional: ad blocking is enabled by default, so this configuration is not required
browser={
"adblock": {
"active": True # Set to False to disable ad blocking
}
}
)
print("Session:", session.data.id)
```
## Disabling Ad Blocker
To disable ad blocking for a session, set `active: false` in the adblock configuration:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
adblock: {
active: false // Disables ad blocking for this session
}
}
}
});
console.log("Session:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
browser={
"adblock": {
"active": False # Disables ad blocking for this session
}
}
)
print("Session:", session.data.id)
```
## Related Features
* [Popup Blocker](/advanced/popup-blocker) - Block cookie banners and consent dialogs
* [Captcha Solving](/advanced/captcha-solving) - Solve CAPTCHAs that may appear when ad blocking is detected
# Anchor VPN
Source: https://docs.anchorbrowser.io/advanced/anchor-vpn
Integrated VPN egress that is secure, reliable, and fast - beyond what proxy setups can offer.
Anchor VPN routes all outbound browser traffic through Anchor's own VPN infrastructure, giving each session a consistent egress path and a stable, dedicated client IP.
Unlike commodity proxy setups, it is built to be **secure**, **reliable**, and **fast** - because the path is owned and operated by Anchor end-to-end.
| **Anchor VPN** | **Market Standard** |
| :- | :- |
| ✅ Always get the same IP address | 🔴 Randomized IP addresses |
| ✅ High speed, cloud hosted IPs | 🔴 Variable speed, hosted on personal edge devices |
| ✅ The IP address only belongs to you | 🔴 IP address is used by unkown amount of users at the same time |
| ✅ Used only for enterprise automation | 🔴 Used for scraping, bot operation, malicious activity |
| ✅ Built for enterprise AI workloads | 🔴 Built for scraping, retrofitted for AI |
> [!NOTE]
>
> Anchor VPN is a premium feature enabled by the Anchor team upon request. It can be scoped to an entire project or to a specific identity. [Contact the Anchor team](mailto:support@anchorbrowser.io?subject=Anchor%20VPN%20enablement) to get started.
## Why it matters
Unstable IPs, low-reputation shared exits, and slow proxy hops are the root cause of most browser automation failures at scale. They lead to session drops, failed auth, elevated risk scores, and sluggish page loads - all of which compound when you're running many sessions. Anchor VPN addresses all three at once.
## Secure
Your assigned egress IP is used by you alone. It is not shared with other customers in a multi-tenant pool where unrelated traffic degrades the address's reputation and broadens the blast radius of any incident.
There is no third-party proxy operator sitting between the browser and the internet. Traffic stays on Anchor-operated infrastructure under Anchor's security program, so no outside vendor can observe, log, or mishandle your sessions.
## Reliable
Which egress IP you use - and whether the same IP is reused across sessions - is driven by your Anchor VPN configuration. Once an assignment is active, all HTTP(S) traffic follows it. There is no routine mid-session rotation for load-spreading; downstream sites see a steady origin for the lifetime of the assignment.
Exits are health- and latency-monitored. If a node goes unhealthy, failover is policy-driven and designed to minimize geographic jumps rather than silently dumping you onto a random replacement.
## Fast
Traffic leaves the browser through exits provisioned for Anchor sessions - not through oversubscribed shared proxy endpoints that add latency on every request. The stack is tuned for interactive pages and APIs: TLS optimization, connection reuse, and direct peering.
Because the IP stays stable, you also avoid the hidden performance tax of proxy churn: fewer captchas, fewer re-auth flows, and less wall-clock time lost to recovery loops that fire every time the origin IP changes.
## How it works
Consistent routing is applied at the browser networking layer before requests are dispatched.
| Component | Role |
| - | - |
| **Session router** | Applies your VPN configuration - selecting an exit and, where enabled, reusing an egress IP across sessions |
| **Exit node pool** | Regionally grouped endpoints monitored for health and latency |
| **Routing policy engine** | Enforces assignment rules, stickiness settings, and failover behavior |
Behavior depends on how Anchor VPN is configured for your project or identity. The system is designed to preserve geographic coherence, avoid gratuitous IP rotation, and keep a stable client origin for as long as your configuration dictates.
## Get started
Anchor VPN is enabled by the Anchor team upon request. [Contact us](mailto:support@anchorbrowser.io?subject=Anchor%20VPN%20enablement) to enable it for your project or identity.
## Related capabilities
> [card] [Proxy](/advanced/proxy)
>
> Country, region, and city targeting with Anchor's built-in proxy.
> [card] [Bring Your Own Proxy](/advanced/bring-your-own-proxy)
>
> Route sessions through your own HTTP, HTTPS, or SOCKS5 server.
> [card] [Dedicated Sticky IP](/advanced/dedicated-sticky-ip)
>
> A fixed IP reserved per profile across sessions.
# Async execution
Source: https://docs.anchorbrowser.io/advanced/async-automation-tasks
Run automation tasks asynchronously and poll for results.
By default, task execution is **synchronous** — the API call waits for the task to complete before returning results. For long-running tasks, you can use **asynchronous execution** to start the task and check results later.
## Running tasks asynchronously
When you set `async: true`, the API returns immediately with a confirmation that the task has started. You can then poll for execution results using the task execution history endpoint.
```typescript node.js theme={null}
import { TasksLegacy } from 'anchorbrowser';
// Run the task asynchronously
const execution = await TasksLegacy.runAdhocTask({
body: {
taskId: taskId,
version: '1',
async: true, // Enable async execution
inputs: {
ANCHOR_TARGET_URL: 'https://example.com',
ANCHOR_MAX_PAGES: '10'
}
}
});
console.log('Task execution started:', execution.data);
// Response: { async: true, success: true, message: 'Task execution started', taskId: '...' }
```
```python python theme={null}
# Run the task asynchronously
execution = client.tasks_legacy.run_adhoc_task(
task_id=task_id,
version="1",
async_=True, # Enable async execution
inputs={
"ANCHOR_TARGET_URL": "https://example.com",
"ANCHOR_MAX_PAGES": "10"
}
)
print(f"Task execution started: {execution.data}")
# Response: {'async': True, 'success': True, 'message': 'Task execution started', 'taskId': '...'}
```
## Checking execution results
After starting an async task, you can check its execution status and results by querying the task's execution history endpoint:
```typescript node.js theme={null}
import { TasksLegacy } from 'anchorbrowser';
// Get execution results
const results = await TasksLegacy.listTaskExecutions({
path: { taskId },
query: { page: 1, limit: 1, version: 1 }
});
console.log('Execution results:', results.data);
```
```python python theme={null}
# Get execution results
results = client.tasks_legacy.list_task_executions(
task_id,
# status="success", # Optional: filter by status (success, failure, timeout, cancelled)
page="1",
limit="1",
version="1", # Optional: filter by version
)
print(f"Execution results: {results.data}")
```
**Example response:**
```json theme={null}
{
"data": {
"results": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "success",
"executionTime": 5234,
"output": "{\"success\": true, \"message\": \"Task completed successfully\"}",
"errorMessage": null,
"startTime": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 1,
"total": 1,
"totalPages": 1
}
}
}
```
> [!WARNING]
>
> Async task executions have a maximum duration of **3 hours**. Tasks that exceed this limit will be automatically cancelled.
>
> **Note:** Tasks must be deployed (not just in draft) to appear in the execution results list.
## Polling for results
For async tasks, you can implement polling to wait for completion:
```typescript node.js theme={null}
import { TasksLegacy } from 'anchorbrowser';
// Poll for task completion
async function waitForTaskCompletion(taskId: string, maxAttempts: number = 60) {
for (let i = 0; i < maxAttempts; i++) {
const results = await TasksLegacy.listTaskExecutions({
path: { taskId },
query: { page: 1, limit: 1 }
});
const latestResult = results.data?.results?.[0];
if (latestResult) {
if (latestResult.status === 'success' || latestResult.status === 'failure') {
return latestResult;
}
}
// Wait 2 seconds before next poll
await new Promise(resolve => setTimeout(resolve, 2000));
}
throw new Error('Task execution timeout');
}
// Usage
const execution = await TasksLegacy.runAdhocTask({
body: {
taskId: taskId,
version: '1',
async: true,
inputs: { ANCHOR_TARGET_URL: 'https://example.com' }
}
});
const result = await waitForTaskCompletion(taskId);
console.log('Task completed:', result);
```
```python python theme={null}
import time
# Poll for task completion
def wait_for_task_completion(task_id: str, max_attempts: int = 60):
for _ in range(max_attempts):
results = client.tasks_legacy.list_task_executions(task_id, page="1", limit="1")
latest_result = results.data.results[0] if results.data and results.data.results else None
if latest_result:
if latest_result.status in ("success", "failure"):
return latest_result
# Wait 2 seconds before next poll
time.sleep(2)
raise Exception('Task execution timeout')
# Usage
execution = client.tasks_legacy.run_adhoc_task(
task_id=task_id,
version="1",
async_=True,
inputs={"ANCHOR_TARGET_URL": "https://example.com"}
)
result = wait_for_task_completion(task_id)
print(f"Task completed: {result}")
```
# Batch Browser Sessions
Source: https://docs.anchorbrowser.io/advanced/batch-browser-sessions
Create and manage multiple browser sessions simultaneously for large-scale automation tasks
> [!NOTE]
>
> For a single session use [Create a Session](/quickstart/create-session). See [Browser Sessions](/quickstart/browser-sessions#how-to-create) for when to choose batch vs sync or async.
Create up to 5,000 browser sessions in a single API call for large-scale automation, web scraping, and load testing.
## Quick Start
### 1. Create a Batch
```javascript theme={null}
const response = await fetch('https://api.anchorbrowser.io/v1/batch-sessions', {
method: 'POST',
headers: {
'anchor-api-key': process.env.ANCHOR_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
count: 10,
configuration: {
browser: {
headless: { active: true },
viewport: { width: 1440, height: 900 }
},
session: {
timeout: { idle_timeout: 10, max_duration: 300 }
}
},
metadata: {
project: 'web-scraping'
}
})
});
const batch = await response.json();
const batchId = batch.data.batch_id;
console.log('Batch ID:', batchId);
```
### 2. Monitor Progress
```javascript theme={null}
const response = await fetch(`https://api.anchorbrowser.io/v1/batch-sessions/${batchId}`, {
headers: { 'anchor-api-key': process.env.ANCHOR_API_KEY }
});
const status = await response.json();
console.log(`Progress: ${status.data.progress.percentage}%`);
console.log(`Completed: ${status.data.completed_requests}/${status.data.total_requests}`);
```
### 3. Use Sessions
```javascript theme={null}
import { chromium } from 'playwright';
const sessions = status.data.sessions.filter(s => s.status === 'completed');
for (const session of sessions) {
const browser = await chromium.connectOverCDP(session.cdp_url);
const page = await browser.contexts()[0].newPage();
await page.goto('https://example.com');
// ... your automation logic
await browser.close();
}
```
## Polling Strategy
```javascript theme={null}
async function waitForBatchCompletion(batchId, maxWaitMinutes = 10) {
const maxWaitMs = maxWaitMinutes * 60 * 1000;
let checkInterval = 5000;
const startTime = Date.now();
while (Date.now() - startTime < maxWaitMs) {
const response = await fetch(`https://api.anchorbrowser.io/v1/batch-sessions/${batchId}`, {
headers: { 'anchor-api-key': process.env.ANCHOR_API_KEY }
});
const data = await response.json();
if (data.data.status === 'completed') return data.data.sessions;
if (data.data.status === 'failed') throw new Error(`Batch failed: ${data.data.error}`);
await new Promise(resolve => setTimeout(resolve, checkInterval));
checkInterval = Math.min(checkInterval * 1.5, 30000);
}
throw new Error(`Batch did not complete within ${maxWaitMinutes} minutes`);
}
```
## Parameters
**count** `number` *required*
Number of browser sessions to create (1-1000)
**configuration** `object`
Session configuration that applies to all sessions in the batch
**metadata** `object`
Optional key-value pairs for batch identification
## Status States
**Batch States**: `pending` → `processing` → `completed` / `failed`
**Session States**: `pending` → `processing` → `completed` / `failed`
## Available Endpoints
* `POST /v1/batch-sessions` - Create batch sessions
* `GET /v1/batch-sessions/{batch_id}` - Get batch status
> [!NOTE]
>
> Additional endpoints for listing, canceling, and retrying batches are planned for future releases.
## Limits
* **Maximum batch size**: 1,000 sessions
* **Session lifetime**: Up to 24 hours
* Large batches may take several minutes to provision
# Bring Your Own Keys (BYOK)
Source: https://docs.anchorbrowser.io/advanced/bring-your-own-key
Use your own LLM provider keys to power AI-driven browser automations
Bring Your Own Keys (BYOK) lets you connect your own LLM provider - OpenAI, Anthropic, Google, Azure, or any OpenAI-compatible endpoint - to power Anchor's AI browser automations. You store your provider keys on a project, then **opt in per request** by referencing a key. When you don't reference a key, Anchor uses its default model as usual.
**Why use BYOK?**
* **Model choice** - pick the provider that works best for each task
* **Data privacy** - LLM requests go directly to your provider, not through Anchor's inference layer
* **Rate limits** - manage your own provider rate limits
## How it works
* You can store **one or more keys per project**. Each key has a **key name** (a short slug you choose, e.g. `my-anthropic-key`) so you can keep several keys - even for the same provider - side by side.
* BYOK is **opt-in per request**. A session or web task uses one of your keys only when it explicitly passes that key's name. Otherwise it uses Anchor's default model.
* Your key isn't tied to a single model. The model is chosen **per request** (you can pass a model name), and if you don't pass one, the provider's default for that agent is used.
* Your keys are **encrypted at rest** and never returned by the API - only a reference to them is stored.
> [!NOTE]
>
> BYOK currently supports **`perform-web-task`** and **sessions** - not Tasks. If you need BYOK for Tasks, [contact support](mailto:support@anchorbrowser.io).
## Supported providers
| Provider | API value | Example models |
| - | - | - |
| OpenAI | `openai` | gpt-4o, gpt-5.4, o3 |
| Anthropic | `anthropic` | claude-sonnet-4-6, claude-opus-4-7 |
| Google (AI Studio) | `google` | gemini-2.5-pro, gemini-2.5-flash |
| Google Vertex AI | `vertex` | gemini-2.5-pro, gemini-2.5-flash |
| Azure OpenAI | `azure` | Any deployed Azure OpenAI model |
| Custom / OpenAI-compatible | `custom` | Any endpoint that follows the OpenAI chat completions API |
Azure and custom endpoints require a **base URL**. Vertex AI uses a **service-account JSON** (not an API key) and an optional **region**.
## Setup (Dashboard)
**1. Open BYOK in Project Settings**
In the Dashboard, go to **Project Settings** and scroll to the **BYOK** section (below Members).
**2. Add a key**
1. Click **Add Key**
2. Select your provider
3. Give the key a **key name** (e.g. `my-anthropic-key`) - this is how you'll reference it later
4. Paste your API key (or service-account JSON for Vertex)
5. For Azure or custom endpoints, enter the **base URL**; for Vertex, optionally set a **region**
6. Click **Verify & Save** - Anchor makes a quick live test call to confirm the credential works before storing it
**3. Add more keys (optional)**
Repeat for any other providers or keys you want available in this project. They'll appear in a table, sorted by provider.
## Using BYOK
Reference a key by its **key name** (`key_slug`) on the request. This works in two places:
### On a session
Pass `key_slug` when creating a session. Every action in that session then uses your key:
```json theme={null}
POST /v1/sessions
{
"key_slug": "my-anthropic-key"
}
```
Optional fields:
* `provider` - a safety check; if set, it must match the stored provider for that key (guards against typos).
* `model` - a specific model name to use; omit it to use the provider's default.
```json theme={null}
POST /v1/sessions
{
"key_slug": "my-anthropic-key",
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
```
### On a web task
Pass `key_slug` to `perform-web-task`. If you don't pass a `sessionId`, Anchor creates a session on the fly using your key. If you pass an existing `sessionId`, the key applies **just to that task** - it doesn't change the session's saved model.
```json theme={null}
POST /v1/tools/perform-web-task
{
"prompt": "Find the price of the product on this page",
"key_slug": "my-openai-key"
}
```
> **No key\_slug = Anchor default.** Leave `key_slug` out and the request uses Anchor's default model.
## Registering keys via the REST API
You can also manage keys without the Dashboard.
**When creating a project** - include a `model` object:
```json theme={null}
POST /v1/projects
{
"name": "My project",
"model": {
"provider": "openai",
"key_slug": "my-openai-key",
"credentials": "sk-...",
"base_url": null
}
}
```
**Adding or updating a key on an existing project:**
```json theme={null}
PUT /v1/projects/{projectId}/byom
{
"model": {
"provider": "anthropic",
"key_slug": "my-anthropic-key",
"credentials": "sk-ant-..."
}
}
```
In both cases Anchor verifies the credential with a live test call before saving. `base_url` is required for `azure` and `custom`; for `vertex`, put the service-account JSON in `credentials` and optionally add `location`.
## FAQs
> [accordion] Do I have to use my key on every request?
>
> No. BYOK is opt-in: a request uses your key only when it includes `key_slug`. Anything without it uses Anchor's default model.
> [accordion] Does BYOK work with Tasks?
>
> Not currently. BYOK applies to sessions and `perform-web-task` only. If you need BYOK for Tasks, [contact support](mailto:support@anchorbrowser.io).
> [accordion] Can I keep several keys in one project?
>
> Yes. Each key has its own key name, and you can store several — even for the same provider. You pick which one to use per request.
> [accordion] Which model does my key use?
>
> The one you pass as `model` on the request. If you don't pass a model, the provider's default for that agent is used. Make sure your key has access to whichever model ends up being used — for example, computer-use agents need a computer-use-capable model.
> [accordion] Does BYOK affect pricing?
>
> With BYOK, LLM requests go directly to your provider, so you pay your provider for token usage. Anchor's standard browser usage charges still apply.
> [accordion] Is my API key stored securely?
>
> Yes. Keys are encrypted at rest and never returned by the API — only a reference is stored. You re-enter the key whenever you change a configuration.
# Bring Your Own Proxy
Source: https://docs.anchorbrowser.io/advanced/bring-your-own-proxy
Use your own HTTP, HTTPS, or SOCKS5 proxy servers with Anchor Browser sessions.
Anchor Browser lets you use your own proxy servers, giving you complete control over your proxy infrastructure. This is particularly useful when you have existing proxy solutions or need to comply with specific network policies.
## Configuration
To use your own proxy, set `type` to `"custom"` and provide:
* **`active`**: Set to `true` to enable the proxy
* **`type`**: Set to `"custom"` to indicate you're using your own proxy
* **`server`**: The full proxy URL in the format `protocol://hostname:port`
* **`username`**: Your proxy authentication username (if required)
* **`password`**: Your proxy authentication password (if required)
## Supported protocols
Anchor Browser supports the following proxy protocols:
* **HTTP Proxy**: Standard HTTP proxy with optional authentication (e.g., `http://proxy.example.com:8080`)
* **HTTPS Proxy**: Secure HTTPS proxy connections (e.g., `https://proxy.example.com:443`)
* **SOCKS5 Proxy**: SOCKS5 proxy for enhanced privacy and flexibility (e.g., `socks5://proxy.example.com:1080`)
## Examples
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const response = await Sessions.createSession({
body: {
session: {
proxy: {
active: true,
type: 'custom',
server: 'https://proxy.example.com:443', // Supported protocols: http, https, socks5
username: 'myUser',
password: 'myPassword',
}
}
}
});
console.log('Session created:', response.data);
```
```python python theme={null}
import os
import json
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
response = anchor_client.sessions.create_session(
session={
'proxy': {
'active': True,
'type': 'custom',
'server': 'https://proxy.example.com:443', # Supported protocols: http, https, socks5
'username': 'myUser',
'password': 'myPassword',
}
}
)
print('Session created:')
print(response.data)
```
For Anchor's built-in proxy with country, region, and city targeting, see [Proxy](/advanced/proxy).
# Embedded Browser Live UI
Source: https://docs.anchorbrowser.io/advanced/browser-live-view
Embed interactive browser sessions directly into your application
## Overview
Anchor Browser offers a live view feature that allows you to embed an interactive frame of a website as a web element. The `live_view_url` is received when creating a session.
## Headful Mode (Default)
Headful mode provides a single URL to view the full chrome view, including the address bar. This ensures the presented tab is always the active tab and provides the best user experience.

To create a browser in headful mode, [create a session](/quickstart/create-session) with `browser.headless.active` set to `false` (the default):
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
// Initialize the client
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
// For explicit headfull session configuration (optional, default to false)
const config = {
browser: {
headless: {
active: false
}
}
};
const session = await Sessions.createSession({ body: config });
const liveViewUrl = session.data.live_view_url;
console.log(`Live view URL: ${liveViewUrl}`);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
# Initialize the client
client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
# For explicit headfull session configuration (optional, default to False)
config = {
"headless": {
"active": False
}
}
session = client.sessions.create_session(browser=config)
print(f"Live view URL: {session.data.live_view_url}")
```
Then, use the `live_view_url` from the response to embed the live view directly into an iframe:
```html theme={null}
```
## Advanced Embedding Configuration
### Embed in Fullscreen View (Hide Navigation Bar)
To use the fullscreen view, replace the live view URL with the following:
```html theme={null}
```
### Disable Browser Interactivity
To prevent the end user from interacting with the browser, add the `style="pointer-events: none;"` attribute to the iframe:
```html theme={null}
```
> [!NOTE]
>
> This feature is available for both headful and headless modes.
### Single-Use Live View URL
To generate a live view URL that can only be used once, set `one_time_url` to `true`. After the first viewer connects and disconnects, the URL becomes permanently invalid.
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
live_view: {
one_time_url: true
}
}
}
});
const liveViewUrl = session.data.live_view_url;
console.log(`Single-use live view URL: ${liveViewUrl}`);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = client.sessions.create_session(
session={
"live_view": {
"one_time_url": True
}
}
)
print(f"Single-use live view URL: {session.data.live_view_url}")
```
> [!WARNING]
>
> `one_time_url` requires a headful browser. It cannot be used with headless mode.
### Scoped Access Tokens
To hand a session to an end user without sharing its session id, set `session.scoped_access.active` to `true`. The create response then carries three URLs, each with its own `token` and no session id:
| Field | The token holder can |
| - | - |
| `live_view_read_only_url` | Watch the browser. Mouse, keyboard and clipboard input is ignored. |
| `live_view_url` | Watch and interact with the browser. |
| `cdp_url` | Control the browser over CDP. |
A read-only viewer and an interactive viewer can watch the same session at the same time. A live view token only opens the live view: it cannot connect over CDP or call the browser's APIs.
On a scoped session the session id is no longer a credential on its own: connecting to CDP or the live view with only `?sessionId=` is refused. Connect with a token (`?token=`), or with the session id and a token (`?sessionId=...&token=...`). Any other session switches to tokens the same way as soon as you mint a token for it (see below); sessions that never use tokens keep working with the session id alone.
If the session also sets `live_view.read_only`, no live view can interact: `live_view_url` is the same read-only URL as `live_view_read_only_url`, and `cdp_url` keeps full control.
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
scoped_access: {
active: true
}
}
}
});
console.log(`Read-only live view: ${session.data.live_view_read_only_url}`);
console.log(`Interactive live view: ${session.data.live_view_url}`);
console.log(`CDP: ${session.data.cdp_url}`);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = client.sessions.create_session(
session={
"scoped_access": {
"active": True
}
}
)
print(f"Read-only live view: {session.data.live_view_read_only_url}")
```
To mint more token URLs for any running headful session, for example one per end user, call `POST /v1/sessions/{session_id}/tokens`. Pass `scopes` to choose which URLs to mint, or omit it for every URL the session can serve (no `live_view_url` on a `one_time_url` session). Every call returns new tokens:
```bash theme={null}
curl -X POST "https://api.anchorbrowser.io/v1/sessions/$SESSION_ID/tokens" \
-H "anchor-api-key: $ANCHOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scopes": ["live_view_read_only"]}'
```
To revoke one, pass the `token` from its URL. The URL stops opening new connections; a connection that is already open stays until it closes:
```bash theme={null}
curl -X DELETE "https://api.anchorbrowser.io/v1/sessions/$SESSION_ID/tokens/$TOKEN" \
-H "anchor-api-key: $ANCHOR_API_KEY"
```
> [!WARNING]
>
> Tokens stop working when the session ends. `scoped_access` requires a headful cloud browser, cannot be combined with `one_time_url`, and is not accepted by batch or async session creation: for those, mint tokens with `POST /v1/sessions/{session_id}/tokens` once the session is running.
>
> Minting a token on a session without `scoped_access` makes it token-only from then on: connections that are already open stay up, but new connections with only `?sessionId=` are refused, so include `cdp` in `scopes` if your own code still connects. Revoking the tokens does not restore session id access.
## Remote OS cursor
By default, live view draws a cursor at **your** mouse. To paint the remote OS pointer into the stream instead (needed to watch OS-level mouse APIs), append `show_cursor=1` to `live_view_url`:
```
https://live.anchorbrowser.io/inspector.html?sessionId=&show_cursor=1
```
## Headless Mode
To obtain the browser live session URL in headless mode, start by [creating a session](/api-reference/browser-sessions/start-browser-session):
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
// Initialize the client
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const config = {
browser: {
headless: {
active: true
}
}
};
const session = await Sessions.createSession({ body: config });
const liveViewUrl = session.data.live_view_url;
console.log(`Live view URL: ${liveViewUrl}`);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
# Initialize the client
client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
config = {
"headless": {
"active": True
}
}
session = client.sessions.create_session(browser=config)
print(f"Live view URL: {session.data.live_view_url}")
```

> [!WARNING]
>
> The live\_view\_url currently points to the browser default first page.
Then, use the **create-session** response to embed the live view URL directly into an iframe:
```html theme={null}
```
# CA Certificates
Source: https://docs.anchorbrowser.io/advanced/ca-certificates
Install custom CA certificates to trust internal services and private PKI in browser sessions.
## Common use cases
| Use case | Description |
| - | - |
| **Internal services** | Access private dashboards and endpoints using certificates signed by your organization's CA |
| **Dev/staging environments** | Connect to environments with self-signed or private CA certificates |
| **mTLS authentication** | Validate server certificate chains in mutual TLS setups |
| **QA/testing** | Run automated tests with temporary CAs or simulated certificate chains |
| **Enterprise networks** | Support environments with custom trust policies or air-gapped infrastructure |
## Managing certificates
Certificates are managed at the team level. Upload a certificate once, then reference it by name in any session.
### Upload a certificate
```javascript node.js theme={null}
import { client, Certificates } from 'anchorbrowser';
import fs from 'fs';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const certificate = await Certificates.createCertificate({
body: {
file: fs.createReadStream('/path/to/your-ca.crt'),
name: 'my-internal-ca',
description: 'CA for internal services',
},
});
console.log('Certificate uploaded:', certificate);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
with open('/path/to/your-ca.crt', 'rb') as f:
certificate = anchor_client.post(
'/v1/certificates',
body={
'file': f,
'name': 'my-internal-ca',
'description': 'CA for internal services',
},
)
print('Certificate uploaded:', certificate)
```
| Parameter | Required | Description |
| - | - | - |
| `file` | Yes | Certificate file (`.crt`, `.pem`, `.cer`, `.der`) |
| `name` | Yes | Unique identifier (alphanumeric, hyphens, underscores) |
| `description` | No | Optional description (max 1000 characters) |
### List certificates
```javascript node.js theme={null}
import { client, Certificates } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const certificates = await Certificates.listCertificates();
console.log('Certificates:', certificates);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
certificates = anchor_client.get('/v1/certificates')
print('Certificates:', certificates)
```
### Delete a certificate
```javascript node.js theme={null}
import { client, Certificates } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const response = await Certificates.deleteCertificate({
path: {
name: 'my-internal-ca',
},
});
console.log('Deleted:', response);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
response = anchor_client.delete('/v1/certificates/my-internal-ca')
print('Deleted:', response)
```
## Using a certificate
After uploading a certificate, reference it by name when creating a session:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
ca_cert: {
active: true,
name: 'my-internal-ca',
},
},
},
});
console.log('Session:', session.data.id);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
session = anchor_client.sessions.create_session(
browser={
'ca_cert': {
'active': True,
'name': 'my-internal-ca',
},
},
)
print('Session:', session.data.id)
```
## Related capabilities
> [card] [Proxy](/advanced/proxy)
>
> Route traffic through proxies for network control.
> [card] [Authentication](/essentials/managed-authentication)
>
> Persistent identity for seamless access to applications.
# Captcha Solving
Source: https://docs.anchorbrowser.io/advanced/captcha-solving
### Visual CAPTCHA solving
Anchor browser solves CAPTCHA challenges using a vision-based approach, along with extension-based fallbacks. The vision-based approach imitates human behavior to solve any CAPTCHA (including Cloudflare) without multiple challenges.
> [!NOTE]
>
> CAPTCHA solving requires either an active proxy or a configured browser profile (the profile may carry its own egress IP and stable identity).
For the full list of available options, view the [interactive api documentation](/api-reference)
### Enable CAPTCHA solving
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
captcha_solver: {
active: true
}
},
session: {
proxy: {
active: true // Required
}
}
}
});
console.log("Session created with CAPTCHA solver:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
browser= {
"captcha_solver": {
"active": True
}
},
session= {
"proxy": {
"active": true # Required
}
}
)
print("Session created with CAPTCHA solver:", session.data.id)
```
#### Configure Text-based CAPTCHA solving
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
captcha_solver: {
active: true,
image_selector: 'ol_capcha img',
input_selector: 'ol-captcha input'
}
},
session: {
proxy: {
active: true // Required
}
}
}
});
console.log("Session created with text-based CAPTCHA solver:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
browser={
"captcha_solver": {
"active": True,
"image_selector": 'ol_capcha img',
"input_selector": 'ol-captcha input'
}
},
session= {
"proxy": {
"active": true # Required
}
}
)
print("Session created with text-based CAPTCHA solver:", session.data.id)
```
# Cloudflare Web Bot Auth
Source: https://docs.anchorbrowser.io/advanced/cloudflare-web-bot-auth
Authenticate browser sessions with Cloudflare Web Bot Auth
Anchor Browser supports Cloudflare Web Bot Auth HTTP message signing for browser sessions. This allows you to identify as Anchor Browser to websites that require Cloudflare's web bot authentication, enabling access to protected content and avoiding bot detection.

## How It Works
1. **Session Creation**: Create a browser session with web bot auth enabled
2. **HTTP Message Signing**: All HTTP requests are automatically signed as Anchor Browser
3. **Authentication**: Cloudflare validates the signatures
4. **Access Granted**: Successfully authenticated requests can access protected content
## Using Web Bot Auth
### How Authentication Works
When you enable web bot auth, Anchor Browser automatically identifies all HTTP requests to websites using our registered identity. This allows you to access protected content that requires Cloudflare's web bot authentication without any additional configuration.
### Browser Configuration
```typescript theme={null}
{
"browser": {
"web_bot_auth": {
"active": boolean // Enable/disable web bot auth (default: false)
}
}
}
```
### SDK Examples
Enable web bot auth by setting the `web_bot_auth.active` flag to `true` in your session configuration:
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
# Initialize the client
client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
# Session configuration with web bot auth enabled
config = {
"web_bot_auth": {
"active": True
}
}
# Create session with web bot auth
session = client.sessions.create_session(browser=config)
print(f"Session created: {session.data.id}")
print(f"CDP URL: {session.data.cdp_url}")
print(f"Live view URL: {session.data.live_view_url}")
```
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
// Initialize the client
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
// Session configuration with web bot auth enabled
const config = {
browser: {
web_bot_auth: {
active: true
}
}
};
// Create session with web bot auth
const session = await Sessions.createSession({ body: config });
console.log('Session created:', session);
```
## Testing
You can test your web bot auth configuration by visiting [https://webbotauth.io/test](https://webbotauth.io/test) in a browser session with web bot auth enabled. This site will show you whether your requests are being properly signed and authenticated.
## Read More
* [Cloudflare Verified Bots Blog](https://blog.cloudflare.com/verified-bots-with-cryptography/)
* [HTTP Message Signatures (RFC 9421)](https://datatracker.ietf.org/doc/html/rfc9421)
* [Web Bot Auth IETF Draft](https://datatracker.ietf.org/doc/html/draft-meunier-web-bot-auth-architecture)
* [WebBotAuth.io](https://webbotauth.io)
# Dedicated Sticky IP
Source: https://docs.anchorbrowser.io/advanced/dedicated-sticky-ip
Reserve a fixed IP address for a specific profile.
A **Dedicated Sticky IP** ensures that a specific profile uses by default the same IP address, reserved exclusively for that profile. This is helpful when IP consistency is required across sessions.
> [!NOTE]
>
> [Extra Stealth](/essentials/stealth) mode is automatically enabled for all sessions using a Dedicated Sticky IP profile.
**1. Create a profile with a dedicated sticky IP**
Use the [Create Profile API](https://docs.anchorbrowser.io/api-reference/profiles/create-profile?playground=open) to create a profile with a dedicated sticky IP by setting `dedicated_sticky_ip` to `true`:
```javascript node.js theme={null}
import { client, Profiles } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const profile = await Profiles.createProfile({
body: {
name: 'my-sticky-profile',
dedicated_sticky_ip: true,
},
});
console.log('Profile created:', profile.data);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
profile = anchor_client.profiles.create_profile(
name="my-sticky-profile",
dedicated_sticky_ip=True,
)
print("Profile created:", profile.data)
```
This allocates a dedicated IP that is not shared with other profiles.
**2. Start a session using the profile**
Start a browser session with the profile. Set `persist` to `true` so the browser state (cookies, localStorage, etc.) is saved when the session ends.
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
profile: {
name: 'my-sticky-profile',
persist: true,
},
},
},
});
console.log('Session created:', session.data);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
browser={
"profile": {
"name": "my-sticky-profile",
"persist": True,
}
}
)
print("Session created:", session.data)
```
The session will automatically use the reserved sticky IP and Extra Stealth mode.
**3. Do your work in the session**
Connect to the session via live view, CDP, or the session view in the dashboard. Log in to accounts, configure settings, or perform any actions you need.
When you're done, close the session. The profile state (cookies, localStorage, etc.) will be persisted automatically because `persist` was set to `true`.
**4. Start future sessions with the same profile**
Any new session started with this profile will use the same dedicated sticky IP and have all the saved browser state from previous sessions.
**5. Override the IP with your own proxy (optional)**
To override the default sticky IP, set the `proxy` field when using the [Start Browser Session API](https://docs.anchorbrowser.io/api-reference/browser-sessions/start-browser-session). See [Bring Your Own Proxy](/advanced/bring-your-own-proxy) for configuration details.
## Mac hardware
Sessions that run on Mac hardware (`session.hardware: "mac"`) can use a profile with a dedicated sticky IP once the capability is enabled for your project. Nothing changes in the request: the session restores the profile before it is ready, routes through the profile's dedicated IP, and persists the profile when it ends.
> [!NOTE]
>
> On Mac hardware the saved state is written when the session ends (`DELETE` the session, let it time out, or close the browser over CDP). `GET /v1/profiles/{name}` reports `status: "ready"` once the new state is stored; poll it before starting the next session on the same profile if you depend on the latest state. Until the capability is enabled for your project, Mac sessions that use a profile answer `400` with `browser.profile is not available on hardware 'mac'`, preceded by `profile-managed sticky proxies are not available on hardware 'mac'` when the profile has a dedicated sticky IP; the `(set by your project's enforced configuration)` suffix only says the refused setting came from your project's enforced configuration.
# Demonstrations API
Source: https://docs.anchorbrowser.io/advanced/demonstrations-api
Send a shareable link so someone can demonstrate a task and Anchor generates production-ready automation from it.
Send a shareable link so someone can demonstrate a task in a live browser. Anchor captures every event and compiles it into deterministic, repeatable code with an AI fallback — the same outcome as [creating a task from a demonstration](/tasks/creating-a-task#create-from-a-demonstration) in the UI.
Use this when the person who knows the flow isn't at the keyboard in your Anchor workspace.
## How it works
1. **Create** a demonstration session via API — you get back a `share_url`
2. **Send** the link to the person who will demonstrate the task
3. They open it, see a live browser, and **perform the task**
4. They click **Finish Demonstration** — the demonstration is submitted
5. Anchor **compiles the captured events** into a task
6. **Poll** the status endpoint until it reaches `completed` — you get `task_id` and `tool_id`
## API Endpoints
### Create a demonstration
```javascript node.js theme={null}
import { client } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const { data: demo } = await client.post({
url: '/v1/demonstrations/',
body: {
task_name: 'Download invoice report',
task_description: 'Navigate to Reports, select the monthly invoice report, and download it as PDF',
user_name: 'John',
},
});
console.log('Share URL:', demo.share_url);
console.log('Session ID:', demo.session_id);
console.log('Task ID:', demo.task_id);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
demo = anchor_client.post(
'/v1/demonstrations/',
body={
'task_name': 'Download invoice report',
'task_description': 'Navigate to Reports, select the monthly invoice report, and download it as PDF',
'user_name': 'John',
},
cast_to=object,
)
print('Share URL:', demo['share_url'])
print('Session ID:', demo['session_id'])
print('Task ID:', demo['task_id'])
```
**Request body:**
| Field | Type | Required | Description |
| - | - | - | - |
| `task_name` | string | Yes | Name for the task being demonstrated |
| `task_description` | string | Yes | Natural language description of what the task does — helps Anchor interpret the demonstration |
| `identity_id` | string | No | Pre-authenticate the browser with a saved identity |
| `identity_skip_validation` | boolean | No | Skip identity validation (default: `true`) |
| `user_name` | string | No | Display name shown in the demonstration UI ("Thanks, John!") |
| `session_config` | object | No | Override browser session settings (start URL, proxy, timeouts, etc.) |
**Response:**
```json theme={null}
{
"session_id": "abc123-...",
"live_view_url": "https://connect.anchorbrowser.io/...",
"share_url": "https://app.anchorbrowser.io/demonstrate?token=eyJ...",
"share_token": "eyJ...",
"share_expires_at": "2026-04-15T09:00:00.000Z",
"task_id": "task-uuid-..."
}
```
> [!NOTE]
>
> The `share_url` is a signed JWT link valid for 1 hour. The customer does not need an Anchor account — the token contains the session and team context.
### Get demonstration status
Poll this endpoint to track progress after the demonstration is submitted.
```javascript node.js theme={null}
const { data: status } = await client.get({ url: `/v1/demonstrations/${sessionId}` });
console.log(status);
```
```python python theme={null}
status = anchor_client.get(f'/v1/demonstrations/{session_id}', cast_to=object)
print(status)
```
**Response:**
```json theme={null}
{
"session_id": "abc123-...",
"status": "completed",
"hektor_project_id": "proj-uuid-...",
"task_id": "task-uuid-...",
"task_version_id": "ver-uuid-...",
"tool_id": "tool-uuid-...",
"created_at": "2026-04-15T07:32:12.865Z"
}
```
**Status values:**
| Status | Description |
| - | - |
| `recording` | Browser session is live — demonstration in progress |
| `processing` | Demonstration complete — Anchor is compiling the task |
| `completed` | Task generated — `task_id` and `tool_id` are available |
| `failed` | Task generation failed |
| `stopped` | Session was stopped before completing |
### Complete demonstration
Called automatically when the user clicks **Finish Demonstration**. Can also be called programmatically via `POST .../recording/complete`.
```javascript node.js theme={null}
const { data: result } = await client.post({
url: `/v1/demonstrations/${sessionId}/recording/complete`,
});
console.log(result);
```
```python python theme={null}
result = anchor_client.post(f'/v1/demonstrations/{session_id}/recording/complete', cast_to=object)
print(result)
```
**Response:**
```json theme={null}
{
"session_id": "abc123-...",
"status": "processing",
"hektor_project_id": "proj-uuid-...",
"task_id": "task-uuid-..."
}
```
This endpoint:
1. Ends the browser session and uploads the captured events
2. Waits for demonstration artifacts to be stored
3. Submits them for task generation
4. Returns immediately with `status: "processing"`
### Stop demonstration
Stop a demonstration without generating a task. Useful for cleanup.
```javascript node.js theme={null}
const { data: result } = await client.post({ url: `/v1/demonstrations/${sessionId}/stop` });
console.log(result);
```
```python python theme={null}
result = anchor_client.post(f'/v1/demonstrations/{session_id}/stop', cast_to=object)
print(result)
```
**Response:**
```json theme={null}
{
"success": true
}
```
## End-to-end example
```javascript node.js theme={null}
import { client } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
// 1. Create demonstration
const { data: demo } = await client.post({
url: '/v1/demonstrations/',
body: {
task_name: 'Download invoice report',
task_description: 'Go to Reports > Invoices, select this month, download PDF',
identity_id: 'your-identity-id',
user_name: 'Sarah',
},
});
console.log(`Send this link to your customer: ${demo.share_url}`);
const sessionId = demo.session_id;
// 2. Poll until completed
let status;
while (true) {
status = (await client.get({ url: `/v1/demonstrations/${sessionId}` })).data;
console.log(`Status: ${status.status}`);
if (['completed', 'failed', 'stopped'].includes(status.status)) break;
await new Promise((r) => setTimeout(r, 5000));
}
// 3. Use the generated task
if (status.status === 'completed') {
console.log(`Task ID: ${status.task_id}`);
console.log(`Tool ID: ${status.tool_id}`);
}
```
```python python theme={null}
import os
import time
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
# 1. Create demonstration
demo = anchor_client.post(
'/v1/demonstrations/',
body={
'task_name': 'Download invoice report',
'task_description': 'Go to Reports > Invoices, select this month, download PDF',
'identity_id': 'your-identity-id',
'user_name': 'Sarah',
},
cast_to=object,
)
print(f"Send this link to your customer: {demo['share_url']}")
session_id = demo['session_id']
# 2. Poll until completed
while True:
status = anchor_client.get(f'/v1/demonstrations/{session_id}', cast_to=object)
print(f"Status: {status['status']}")
if status['status'] in ('completed', 'failed', 'stopped'):
break
time.sleep(5)
# 3. Use the generated task
if status['status'] == 'completed':
print(f"Task ID: {status['task_id']}")
print(f"Tool ID: {status['tool_id']}")
```
## Identity pre-authentication
Pass an `identity_id` to pre-authenticate the browser before the link is opened. The user will see the target application already logged in and can start the demonstration immediately.
```json theme={null}
{
"task_name": "Export quarterly report",
"task_description": "Navigate to the reports section and export Q1 data",
"identity_id": "7f0db4ad-74ca-42e5-896e-3f0daea36c13"
}
```
> [!TIP]
>
> If identity authentication fails (expired credentials, site unreachable), the session still starts — the user can log in manually during the demonstration. Set `identity_skip_validation: true` (default) to ensure this behavior.
## Share URL and the demonstration UI
The `share_url` opens a full-screen demonstration interface with:
* **Live browser** — interact with the actual website
* **Live Browser Events panel** — clicks, typing, and navigation as they happen
* **Finish Demonstration** — submits the demonstration and starts task generation
When the user finishes, they see a confirmation screen. If the share URL was opened as a popup (via `window.open`), the parent window receives a `demonstration-complete` postMessage with the `task_id`, `task_version_id`, and `tool_id`.
## Session configuration
Override default session settings:
```json theme={null}
{
"task_name": "My task",
"task_description": "Task description",
"session_config": {
"browser": {
"start_url": "https://app.example.com/dashboard"
},
"session": {
"timeout": {
"max_duration": 60,
"idle_timeout": 30
}
}
}
}
```
Default demonstration timeouts are `max_duration: 30` minutes and `idle_timeout: 30` minutes.
# Email MFA
Source: https://docs.anchorbrowser.io/advanced/email-otp
Email-based MFA for identity creation, reauthentication, and agent sessions.
Anchor supports one-time password (OTP) as its email MFA method. Each identity is assigned a dedicated mailbox — simply configure a forwarding rule with your email provider to route OTP codes to Anchor during identity creation, reauthentication, and agent sessions.
### Step 1: Add Email MFA as an authentication method
1. Go to the [Identities](https://app.anchorbrowser.io/identities) page and select your identity.
2. Choose **Preset authentication** — the available authentication flows will appear below.
3. Click the **Add flow** button to create a new authentication flow.
4. Enter a name for the flow and click **Add**.
5. Select the **Email MFA** checkbox under **Authentication Methods**. Include any other authentication methods needed for this login flow.
6. Click **Save Changes** in the top-right corner.
### Step 2: Create an identity that uses the Email MFA authentication method
After creating the Email MFA authentication method:
1. Create a new identity.
2. In the credentials window, choose the Email MFA authentication method.
3. You will receive a dedicated mailbox (for example, `zesty-vale7820@mfa.anchorbrowser.io`).
4. Set up a forwarding rule from your mailbox to your dedicated mailbox.
5. Optionally, test the forwarding flow using the detailed instructions.
### Forwarding setup details
Official help for forwarding in common mail clients:
* [Gmail](https://support.google.com/mail/answer/10957)
* [Outlook](https://support.microsoft.com/en-us/office/use-rules-to-automatically-forward-messages-45aa9664-4911-4f96-9663-ece42816d746)
## API Reference
Use the mailbox and identity email APIs to provision an inbox, attach it to an identity, verify forwarding, and read OTP emails programmatically. All endpoints require the `anchor-api-key` header.
### Typical flow
1. Create an [authentication flow](/api-reference/applications/create-authentication-flow) that includes `email_mfa` in `methods`.
2. [Create a mailbox](/api-reference/identities/create-mailbox) to get a dedicated forwarding address.
3. [Create an identity](/api-reference/identities/create-identity) and pass the mailbox `id` as `mailboxId`, plus `authOptionId` for the flow you created.
4. [Send a probe email](/api-reference/identities/send-mailbox-probe) to verify delivery.
5. [List](/api-reference/identities/list-identity-emails) or [read](/api-reference/identities/get-identity-email) emails to retrieve OTP codes.
**Endpoints**
| Method | Path | Description |
| - | - | - |
| `POST` | `/v1/mailboxes` | Create a detached mailbox before identity creation |
| `GET` | `/v1/mailboxes/{mailboxId}/emails` | List emails received by a mailbox |
| `POST` | `/v1/mailboxes/{mailboxId}/send-probe` | Send a test email to verify forwarding |
| `POST` | `/v1/identities/{identityId}/email` | Enable or return the identity's mailbox |
| `GET` | `/v1/identities/{identityId}/email` | Get the identity's mailbox details |
| `DELETE` | `/v1/identities/{identityId}/email` | Detach and delete the identity's mailbox |
| `GET` | `/v1/identities/{identityId}/email/emails` | List emails in the identity's mailbox |
| `GET` | `/v1/identities/{identityId}/email/emails/{emailId}` | Get full email content (text and HTML) |
### Example: provision mailbox and create identity
```javascript node.js theme={null}
import { client, Applications, Identities } from 'anchorbrowser';
// 1. Create an auth flow with Email MFA
const authFlow = await Applications.createAuthFlow({
path: { applicationId },
body: {
name: 'Login with Email MFA',
methods: ['username_password', 'email_mfa'],
},
});
// 2. Create a detached mailbox
const { data: mailbox } = await client.post({ url: '/v1/mailboxes', body: {} });
console.log('Forwarding address:', mailbox.address);
// 3. Create the identity and attach the mailbox
const identity = await Identities.createIdentity({
body: {
name: 'Work Account',
source: 'https://example.com/login',
authOptionId: authFlow.id,
mailboxId: mailbox.id,
credentials: [
{ type: 'username_password', username: 'user@example.com', password: 'secret' },
],
},
});
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
auth_flow = anchor_client.applications.create_auth_flow(
application_id=application_id,
name="Login with Email MFA",
methods=["username_password", "email_mfa"],
)
mailbox = anchor_client.post("/v1/mailboxes", body={}, cast_to=object)
print("Forwarding address:", mailbox["address"])
identity = anchor_client.identities.create_identity(
name="Work Account",
source="https://example.com/login",
credentials=[
{"type": "username_password", "username": "user@example.com", "password": "secret"},
],
extra_body={"authOptionId": str(auth_flow.id), "mailboxId": mailbox["id"]},
)
```
### Example: test forwarding and read OTP emails
After setting up your email forwarding rule, send a probe to confirm delivery, then poll for incoming messages. Use the `since` query parameter to fetch only emails received after a given ISO timestamp.
```javascript node.js theme={null}
const identityId = 'IDENTITY_ID';
const mailboxId = 'MAILBOX_ID';
// Send a probe email to verify forwarding
await client.post({ url: `/v1/mailboxes/${mailboxId}/send-probe`, body: {} });
// List recent emails for the identity
const since = new Date(Date.now() - 5 * 60 * 1000).toISOString();
const { data: emails } = await client.get({
url: `/v1/identities/${identityId}/email/emails`,
query: { since },
});
// Read full content of the newest email
if (emails.length > 0) {
const { data: email } = await client.get({
url: `/v1/identities/${identityId}/email/emails/${emails[0].id}`,
});
console.log(email.subject, email.body_text);
}
```
```python python theme={null}
import os
from datetime import datetime, timedelta, timezone
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
identity_id = 'IDENTITY_ID'
mailbox_id = 'MAILBOX_ID'
anchor_client.post(f'/v1/mailboxes/{mailbox_id}/send-probe', body={}, cast_to=object)
since = (datetime.now(timezone.utc) - timedelta(minutes=5)).isoformat()
emails = anchor_client.get(
f'/v1/identities/{identity_id}/email/emails',
query={'since': since},
cast_to=object,
)
if emails:
email = anchor_client.get(
f'/v1/identities/{identity_id}/email/emails/{emails[0]["id"]}',
cast_to=object,
)
print(email['subject'], email['body_text'])
```
> [!NOTE]
>
> During identity creation and agent sessions, Anchor automatically reads OTP codes from the mailbox. Use the list and get email endpoints when you need to handle codes in your own integration.
### Related API docs
> [card] [Create Mailbox](/api-reference/identities/create-mailbox)
>
> Provision a dedicated forwarding address
> [card] [Enable Identity Mailbox](/api-reference/identities/enable-identity-mailbox)
>
> Attach a mailbox to an existing identity
> [card] [List Identity Emails](/api-reference/identities/list-identity-emails)
>
> Poll for forwarded OTP emails
> [card] [Send Mailbox Probe](/api-reference/identities/send-mailbox-probe)
>
> Verify forwarding is working
# Browser Extensions
Source: https://docs.anchorbrowser.io/advanced/extensions
Upload and use custom browser extensions in your sessions
Anchor allows you to upload and use Chrome extensions in your browser sessions. This lets you add ad blockers, privacy tools, or any other extension to enhance your browsing automation.
For uploading, listing, and managing extensions, see the [interactive API documentation](/api-reference/extensions).
## Getting Extensions from Chrome Web Store
To use extensions from the Chrome Web Store, you'll need to download and inspect their files:
### Download Extension Files
1. **Install CRX Extractor/Downloader** - Add this extension to your browser to download .zip files
2. **Navigate to the extension** you want on the Chrome Web Store
3. **Click the CRX Extractor icon** and download the .zip file
4. **Extract the ZIP** to inspect the contents
### Inspect Extension Contents
Once extracted, you'll see the extension's files:
* `manifest.json` - Contains extension metadata and permissions
* `background.js` or `service_worker.js` - Background scripts
* `content_scripts/` - Scripts that run on web pages
* `popup.html` - Extension popup interface
* `icons/` - Extension icons
### Repackage for Upload
After inspecting (and optionally modifying) the files:
1. **Select all files and folders** in the extracted directory
2. **Create a new ZIP file** containing all the extension files
3. **Upload this ZIP** to AnchorBrowser using the SDK
## Extension Requirements
Your extension ZIP file must contain a valid `manifest.json` with basic extension information like name and version.
### Example Manifest
```json theme={null}
{
"manifest_version": 3,
"name": "My Extension",
"version": "1.0.0",
"description": "Extension description",
"permissions": ["activeTab", "storage"],
"background": {
"service_worker": "background.js"
},
"content_scripts": [{
"matches": [""],
"js": ["content.js"]
}]
}
```
## Code Example
```javascript node.js theme={null}
import { client, Extensions, Sessions } from 'anchorbrowser';
import fs from 'fs';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const extension = await Extensions.uploadExtension({
body: {
file: new File([fs.readFileSync('./my-extension.zip')], 'my-extension.zip'),
name: 'My Custom Extension'
}
});
const extensionId = extension.data.id;
console.log("ExtensionId:", extensionId);
const session = await Sessions.createSession({
body: {
browser: {
extensions: [extensionId]
}
}
});
console.log("Session:", session);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
with open('./my-extension.zip', 'rb') as file:
extension = anchor_client.extensions.upload_extension(file=file,name='My Custom Extension')
extensionId = extension.data.id
print("ExtensionId:", extensionId)
session = anchor_client.sessions.create_session(browser={
"extensions": [extensionId]
})
print("Session:", session)
```
## Limitations
* Maximum extension size: 50MB per ZIP file
* Extensions must be valid Chrome extensions
# File Download
Source: https://docs.anchorbrowser.io/advanced/file-download
Anchor Browser supports two methods for downloading files during your browser sessions:
1. **Traditional Downloads**: Files are downloaded to the browser instance and then stored by Anchor for retrieval
> [!NOTE]
>
> To download PDF files directly instead of viewing them in the browser, set `pdf_viewer` to `false` when creating your session.
2. **P2P Downloads**: Files are captured directly in the browser using peer-to-peer technology, available instantly without waiting for Anchor storage
## Traditional File Downloads
The following examples demonstrate how to download a file using the traditional method and retrieve it from the browser session.
**1. Create a browser session**
Use the [create session](api-reference/browser-sessions/start-browser-session) API to create a new browser session.
To enable automatic PDF downloads, include the following `browser` configuration:
```tsx node.js theme={null}
browser: {
pdf_viewer: {
active: false
}
}
```
```python python theme={null}
"browser": {
"pdf_viewer": {
"active": False
}
}
```
**2. Browse and download a file**
Use the following example to perform a file download
```tsx node.js theme={null}
await page.goto("https://browser-tests-alpha.vercel.app/api/download-test");
await Promise.all([page.waitForEvent("download"), page.locator("#download").click()]); // The download has completed
```
```python python theme={null}
await page.goto("https://browser-tests-alpha.vercel.app/api/download-test")
async with page.expect_download() as download_info:
await page.locator("#download").click()
download = await download_info.value
```
**3. Fetch the file from the browser session**
You can retrieve the downloaded file from the browser session using the [get session downloads](/api-reference/browser-sessions/list-session-downloads) API
## Keep downloads across sessions
Downloads are normally stored per session. To keep them in a folder your team owns, mount a [volume](/advanced/volumes) into the session: every download then lands in the volume's `downloads/` folder, and any later session that mounts the same volume sees it.
## P2P Downloads
For real-time download notifications and direct file streaming without waiting for Anchor storage, see the [P2P Download Guide](/advanced/p2p-downloads). Files are available immediately when the download completes — no polling required.
# File Upload
Source: https://docs.anchorbrowser.io/advanced/file-upload
Anchor Browser allows you to upload files during your browser sessions, enabling you to interact with web applications/forms that require files as input.
The following examples demonstrate how to upload a file, either from your local development environment or one downloaded during the browser session.
## Using a local file
### Playwright example
```tsx node.js theme={null}
await page.goto('https://browser-tests-alpha.vercel.app/api/upload-test')
const input = await page.$("#fileUpload")
await input.setInputFiles('/tmp/my-files/google.png'); // Reference the local file path
```
```python python theme={null}
page.goto('https://browser-tests-alpha.vercel.app/api/upload-test')
input = page.locator("#fileUpload")
input.set_input_files('/tmp/my-files/google.png') # Reference the local file path
```
# Code Tasks
Source: https://docs.anchorbrowser.io/advanced/legacy-tasks
Write task automation as TypeScript, or hand-edit workflow JSON for fine-grained control.
> [!NOTE]
>
> Most **Automation Tasks** start from a [prompt or demonstration](/tasks/creating-a-task). **Code Tasks** are for authoring automation directly — as TypeScript you upload with the SDK, or as workflow JSON you edit by hand when you need precise control.
## Overview
Code Tasks cover two related paths:
| Path | When to use it |
| - | - |
| **TypeScript tasks** | You write a `.ts` file, upload it with the v1 Tasks SDK, and run it in Anchor's task sandbox. |
| **Workflow JSON** | You already have an Automation Task (from a prompt, demonstration, or generation) and need to edit its segment graph via API — for selector fixes, branching, or changes the UI editor can't express. |
For the standard create-from-prompt or demonstration flow, start with [Creating a Task](/tasks/creating-a-task) and [Run a Task](/tasks/run-a-task). Use this page when you are writing or editing code yourself.
## Writing TypeScript task code
For reliable execution, **follow these guidelines:**
* Write your **code in TypeScript.**
* **Export** a single **default async function.**
* In that function, **return** whatever your workflow requires as **output** (e.g., status, messages, domain data).
> [!NOTE]
>
> Tasks can receive values as inputs. **All input names must be prefixed with `ANCHOR_`**
### Basic Task Example
```typescript typescript theme={null}
import { client, createBrowser } from 'anchorbrowser';
// Initialize the Anchor client with your API key
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
// Export the main function as the default export
export default async function run() {
// Create a new browser instance
const { browser } = await createBrowser();
const page = browser.contexts()[0].pages()[0];
// Access input values
const targetUrl = process.env.ANCHOR_TARGET_URL;
const maxPages = parseInt(process.env.ANCHOR_MAX_PAGES || '10');
// Implement your automation logic
await page.goto(targetUrl);
console.log(`Scraping up to ${maxPages} pages from ${targetUrl}`);
// Always close the browser when done
await browser.close();
// Return a result object with success status and message
return {
success: true,
message: 'Task completed successfully'
};
}
```
### Using the SDK
Upload and run a TypeScript Code Task with the v1 Tasks SDK:
**1. Save your typescript code as a .ts file**
> [!WARNING]
>
> Make sure it follows the guidelines from above.
**2. Get the base64 version of the file**
Run the script to show your base64 file version
```bash terminal theme={null}
# Convert your TypeScript file to base64
base64 -i your-task.ts
```
Copy the output for later.
**3. Create your Code Task in Anchor**
```typescript node.js theme={null}
import { client, TasksLegacy } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
// Create a new task
const task = await TasksLegacy.createTask({
body: {
name: 'example-task',
language: 'typescript',
description: 'A task to scrape product information from e-commerce sites',
code: "" // Replace with the output of the last step.
}
});
const taskId = task.data.id
console.log('Task created:', taskId);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
client = Anchorbrowser(
api_key=os.environ.get("ANCHORBROWSER_API_KEY")
)
# Create a new task
task = client.tasks_legacy.create_task(
name="example-task",
language="typescript",
description="A task to scrape product information from e-commerce sites",
code="" # Replace with the output of the last step.
)
# Save the id for later
task_id = task.data.id
print(f"Task created: {task_id}")
```
**4. Run the Code Task**
```typescript node.js theme={null}
// Run the task with inputs
const execution = await TasksLegacy.runAdhocTask({
body: {
taskId: taskId,
version: 'draft',
inputs: {
ANCHOR_TARGET_URL: 'https://example.com',
ANCHOR_MAX_PAGES: '10'
}
}
});
console.log('Task execution started:', execution.data);
```
```python python theme={null}
# Run the task with inputs
execution = client.tasks_legacy.run_adhoc_task(
task_id=task_id,
version="draft",
inputs={
"ANCHOR_TARGET_URL": "https://example.com",
"ANCHOR_MAX_PAGES": "10"
}
)
print(f"Task execution started: {execution.data}")
```
> [!NOTE]
>
> By default, the browser session is automatically closed when the task ends. Set `cleanupSessions: false` to keep the session open after task execution.

**5. Deploy the Code Task**
```typescript node.js theme={null}
// Deploy the task to make it available for production use
const deployment = await TasksLegacy.deployTask({
path: { taskId },
body: {
code: "", // Replace with the base64 encoded code
language: 'typescript',
description: 'Optional description for this version'
}
});
console.log('Task deployed:', deployment.data);
```
```python python theme={null}
# Deploy the task to make it available for production use
deployment = client.tasks_legacy.deploy_task(
task_id=task_id,
code="", # Replace with the base64 encoded code
language="typescript",
description="Optional description for this version"
)
print(f"Task deployed: {deployment.data}")
```
For long-running TypeScript task runs, see [Async execution](/advanced/async-automation-tasks).
## Support
For additional help with Code Tasks:
* [Run a Task](/tasks/run-a-task) — execute Automation Tasks via the v2 API
* Contact Anchor Browser support at [support@anchorbrowser.io](mailto:support@anchorbrowser.io)
## Manually editing workflow JSON
> [!NOTE]
>
> Use this when you already have an Automation Task and need to edit the underlying workflow document via API — for example after [self-healing](/advanced/self-healing) produces a draft, or for changes too detailed for the UI editor. See [Automation Tasks Overview](/tasks/overview#the-workflow-page) for the equivalent workflow in the dashboard.
A workflow is a JSON document describing an ordered graph of **segments** that run against a browser session. Each segment can run deterministic Playwright code, an AI agent, or both. Segment outputs flow forward by parameter name into a shared state, and the workflow's final output is read from that state at the end.
This section covers the JSON schema for hand-editing and the API flow for saving and publishing those edits.
### API process for editing a workflow
**1. Get the task ID**
Use the `task_id` returned when you created the task, or from a completed [demonstration](/advanced/demonstrations-api) status response.
**2. Read the current workflow JSON**
```bash theme={null}
GET /v1/task/{taskId}/latest
```
The `code` field is base64-encoded. Decode it to get the raw workflow JSON.
**3. Edit and save as draft**
Edit the decoded JSON using the schema reference below, re-encode it to base64, then save:
```bash theme={null}
POST /v1/task/{taskId}/draft
{
"code": "",
"language": "workflow"
}
```
**4. Publish the draft**
```bash theme={null}
POST /v2/tasks/{taskId}/publish-draft
```
### Top-level shape
```json theme={null}
{
"name": "string",
"startSegmentName": "string",
"inputParameters": [ /* Parameter[] */ ],
"outputParameters": [ /* Parameter[] */ ],
"segments": [ /* Segment[] */ ]
}
```
| Field | Description |
| - | - |
| `name` | Human-readable workflow name. |
| `startSegmentName` | The `name` of the segment that runs first. Must match one of `segments[].name`. |
| `inputParameters` | Values supplied by the caller at run time. |
| `outputParameters` | Values returned at the end of the run, read from the shared state by name. |
| `segments` | The segments that make up the graph. |
### Parameter
```json theme={null}
{
"name": "snake_case_key",
"type": "string",
"required": true,
"description": "What this is, in plain language.",
"defaultValue": null,
"options": null
}
```
| Field | Default | Notes |
| - | - | - |
| `name` | — | The state key. Outputs flow forward by name — an output named `foo` becomes the input `foo` of any later segment that declares it. |
| `type` | — | One of `string`, `number`, `boolean`, `secret`, `file`. `secret` is a string that is masked in logs. `file` carries a base64 data URI; the runtime writes it to a temp path before Playwright `setInputFiles`. |
| `required` | `true` | Required parameters must be present and non-null. For optional parameters, see [Optionality](#optionality-the-most-common-gotcha). |
| `description` | `null` | Read by the AI agent when present. Be concrete and action-oriented. |
| `defaultValue` | `null` | Applied before validation when the value is missing/empty. |
| `options` | `null` | If set, the value must be one of the listed strings (renders a dropdown). Treated as a string at runtime regardless of `type`. |
A minimal parameter is `{ "name": "...", "type": "..." }` — the rest take their defaults.
> [!NOTE]
>
> Use `secret` for credentials, tokens, API keys. Use `file` for user-uploaded attachments — declare it as a workflow input, reference it as `{{parameter_name}}` in prompts and `parameters.parameter_name` in deterministic code. Do not use `string` for binary uploads.
### Segment
```json theme={null}
{
"name": "snake_case_action_name",
"type": "ui",
"prompt": "Plain-English instruction for the agent.",
"inputParameters": [],
"outputParameters": [],
"deterministic": "async (page, parameters) => { /* ... */ return {}; }",
"next": "next_segment_name",
"router": null
}
```
A segment only sees parameters it **declares in `inputParameters`**. The shared state is global, but the segment's `parameters` object at runtime contains only the values the segment opted into. If you forget to declare an input, `parameters.foo` is `undefined`, even if an earlier segment produced `foo`.
#### Segment types
| Type | When to use | `deterministic` | `prompt` | AI fallback if deterministic throws |
| - | - | - | - | - |
| `ui` | DOM interaction, navigation, visible-page extraction (the default) | recommended | required | yes |
| `network` | Reading data out of recorded API responses | required | required | yes |
| `logic` | Deterministic-only control flow / hard errors / invariant checks | required | must be `null` | **no** — segment hard-fails |
| `agent` | Subjective judgment ("best", "most relevant", visual selection) | must be `null` | required | n/a — agent is the only mode |
Rules of thumb:
* Default to `ui`. Reach for `network` only when the response payload is the source of truth (the user said "from API", or UI parsing is brittle).
* Use `logic` when you specifically want **no [AI fallback](/advanced/self-healing#ai-fallback)** — for example, throwing "no results" errors or post-filter validation.
* Use `agent` when deterministic code can't reliably encode the decision.
#### `deterministic`
`deterministic` is a **JSON string** containing a stringified async arrow function — not a live function. Two valid signatures:
```js theme={null}
async (page, parameters) => { /* Playwright */ return { /* outputs */ }; }
async (page, parameters, networkResponses) => { /* network segments */ }
```
* `page` is a Playwright page bound to the active session.
* `parameters` contains all declared `inputParameters` for this segment.
* `networkResponses` (network segments only) — see [Network segments](#network-segments) below.
* The function **must return an object** — use `{}` if there are no outputs.
* Throw on missing/invalid required values; never return `null` placeholders.
Because the function is serialized as a JSON string, escape internal double quotes and keep it on a single line. For example, the function body `await page.goto('https://example.com'); return {};` becomes:
```json theme={null}
"deterministic": "async (page, parameters) => { await page.goto('https://example.com'); return {}; }"
```
#### `prompt`
Plain English for the AI agent. Reference parameters as `{{parameter_name}}` for runtime substitution. Describe the goal in terms of logical actions, not selectors:
* ✅ `"Search Amazon for {{search_query}} and submit."`
* ❌ `"Click button[aria-label=Search], fill input#q, press Enter."`
For `ui`/`network` segments, the prompt is also used as [AI fallback](/advanced/self-healing#ai-fallback) if the deterministic step throws — write it as if it might run on its own.
#### `next` and `router`
* **Linear:** `"next": "next_segment"`.
* **Terminal:** `"next": null` (workflow ends after this segment).
* **Branching:** `"next": ["segment_a", "segment_b"]` plus `"router": "(parameters) => parameters.x ? 'segment_a' : 'segment_b'"`.
> [!WARNING]
>
> The router function receives **only this segment's `outputParameters`** (its own output object), not the merged shared state. If you want to route on a value, that value **must** be declared as an `outputParameter` of the same segment whose `router` reads it.
### Data flow
State is a single flat map keyed by parameter `name`. After a segment runs, its `outputParameters` are merged into that map and made available to every later segment whose `inputParameters` declare the same name. The workflow's `outputParameters` are read from the same map at the end.
Implications:
* Two segments with the same output name **overwrite** each other.
* A segment only reads parameters it explicitly declares in `inputParameters` — declaring an input is opt-in even though the underlying state is shared.
* A router only reads its own segment's outputs — see the warning above.
* If a downstream segment treats an input as `required: true`, the producing segment's output should also be `required: true`, and its deterministic code must throw (not return `null`/empty) when the value is unavailable.
* Demonstration values and static URLs belong **inside the prompt**, not as parameters.
### Network segments
For `type: "network"` segments, the deterministic function receives a third argument — `networkResponses` — containing all responses recorded during the session.
Each entry has fields like `requestUrl`, `method`, `status`, `headers`, and a body. The body field name varies by recorder version, so always read it with the canonical fallback:
```js theme={null}
const rawPayload = entry?.responseBody ?? entry?.body;
```
Match responses with stable predicates (pathname/method/status), not full URL string equality:
```json theme={null}
"deterministic": "async (page, parameters, networkResponses) => { const matches = (networkResponses || []).filter(e => String(e?.requestUrl || '').includes('/api/data') && String(e?.method || '').toUpperCase() === 'GET' && Number(e?.status) === 200); if (!matches.length) throw new Error('Expected /api/data GET 200 response not found'); const last = matches[matches.length - 1]; const rawPayload = last?.responseBody ?? last?.body; if (rawPayload == null) throw new Error(\"Missing required output 'result' from response payload\"); const json = typeof rawPayload === 'string' ? JSON.parse(rawPayload) : rawPayload; return { result: JSON.stringify(json) }; }"
```
Do not use `page.waitForResponse` inside a workflow segment — `networkResponses` is the deterministic source of truth.
### Reliability patterns
These are the highest-leverage rules for hand-written deterministic code.
#### Split navigation from interaction
Always put `page.goto(url)` in its own segment. Element waits, fills, and clicks belong in the next segment.
* ❌ `nav_open_and_fill_search` — navigation + interaction in one segment
* ✅ `nav_to_search_page` → `fill_search_form`
The page load is handled automatically by the browser; do not call `page.waitForLoadState('networkidle')` after `page.goto`. The next segment handles waiting for specific elements to appear. Splitting them makes segments reusable and resilient to timing issues.
#### Click and input stability
For any element that may be off-screen or in a virtual list, use the canonical pattern:
```js theme={null}
const el = page.locator('selector');
await el.waitFor({ state: 'attached', timeout: 30000 });
await el.scrollIntoViewIfNeeded();
await el.click();
```
* `state: 'attached'` waits for DOM presence even when the element is off-screen. The default `state: 'visible'` breaks on virtual lists.
* For text inputs (`input`, `textarea`, contenteditable), click/focus first, then `fill()` or `type()`.
#### Selector quality
Prefer stable attributes in this order: `data-testid` → `aria-label` → `name` → semantic role + text. Scope selectors to a relevant region before text matching; avoid global `.first()` unless uniqueness is guaranteed.
### Optionality (the most common gotcha)
The schema validator accepts `undefined` (i.e. a missing key) for optional fields, **not `null`**. An AI agent producing structured JSON tends to emit `"field": null` for "absent", which fails validation — especially for optional fields with `options` (enums).
Three patterns that work:
**1. Route around it.** Declare the optional value as an `outputParameter` of the segment whose `router` will read it, so the router can branch *before* the consuming segment ever runs. The consuming segment can then treat the input as required.
```json theme={null}
{
"name": "get_task_details",
"type": "ui",
"prompt": "Read the task and return its current estimation if any.",
"inputParameters": [],
"outputParameters": [
{ "name": "estimation", "type": "number", "required": true, "description": "Current estimation, or 0 if none." }
],
"deterministic": "async (page, parameters) => { /* read DOM, default to 0 */ return { estimation: 0 }; }",
"next": ["set_estimation", "skip_estimation"],
"router": "(parameters) => parameters.estimation > 0 ? 'set_estimation' : 'skip_estimation'"
}
```
Note that `parameters.estimation` here refers to **this segment's own output**, which is what the router receives.
**2. Add an explicit "none" option.** For optional enums, include a sentinel like `"none"` in `options` and make the field `required: true`. The agent will pick `"none"` instead of `null`.
**3. Omit the key.** If you control the deterministic code, return `{}` (omit the key entirely) instead of `{ field: null }`.
### Identity-linked workflows
When an [identity](/essentials/authenticated-applications) is attached to the workflow, the platform pre-authenticates the session before the workflow runs. In that case:
* **Do not** declare `username`, `password`, `otp_code`, `totp_secret`, `mfa_code`, login `email`, or any other auth credential as an `inputParameter`.
* **Do not** add login segments to the workflow — login is handled before your first segment runs.
* Treat any login actions you saw during recording as pre-conditions performed by the platform, not as part of the user's task.
* Only declare business-logic parameters the user actually needs to provide at runtime (e.g. `report_name`, `invoice_number`, `search_query`).
### Authoring checklist
* [ ] Every segment has a `type`.
* [ ] `logic` segments have `prompt: null` and a non-null `deterministic`.
* [ ] `agent` segments have `deterministic: null` and a comprehensive `prompt`.
* [ ] Every value referenced in a `router` is declared as an `outputParameter` **of the same segment** as the router.
* [ ] Every value a segment uses is declared in its `inputParameters`.
* [ ] Required downstream inputs come from required upstream outputs; deterministic code throws instead of returning `null` for them.
* [ ] Optional values are handled by routing, an explicit `"none"` option, or by omitting the key — not by emitting `null`.
* [ ] Prompts use `{{parameter_name}}` for dynamic values; static URLs and demonstration values are embedded in the prompt, not declared as parameters.
* [ ] `secret` for credentials/tokens; `file` for user-uploaded attachments.
* [ ] Navigation segments do `page.goto` only — element waits and interactions live in the next segment.
* [ ] `next: null` only on terminal segments; otherwise a single string or an array paired with a `router`.
* [ ] `deterministic` is a JSON string with quotes escaped, on a single line.
* [ ] If an identity is attached, no auth credentials are declared as parameters.
### Complete example
A two-input, two-output workflow that searches Amazon and extracts the first result.
```json theme={null}
{
"name": "amazon_price_check",
"startSegmentName": "nav_to_amazon",
"inputParameters": [
{ "name": "search_query", "type": "string", "required": true, "description": "Product to search for", "defaultValue": null, "options": null },
{ "name": "max_price", "type": "number", "required": false, "description": "Optional price ceiling (USD)", "defaultValue": null, "options": null }
],
"outputParameters": [
{ "name": "top_result_title", "type": "string", "required": true, "description": "Title of the first matching product", "defaultValue": null, "options": null },
{ "name": "top_result_price", "type": "number", "required": false, "description": "Price of the first matching product", "defaultValue": null, "options": null }
],
"segments": [
{
"name": "nav_to_amazon",
"type": "ui",
"prompt": "Navigate to https://www.amazon.com/.",
"inputParameters": [],
"outputParameters": [],
"deterministic": "async (page, parameters) => { await page.goto('https://www.amazon.com/'); return {}; }",
"next": "search_product",
"router": null
},
{
"name": "search_product",
"type": "ui",
"prompt": "Type {{search_query}} into the search box and submit.",
"inputParameters": [
{ "name": "search_query", "type": "string", "required": true, "description": "Product to search for", "defaultValue": null, "options": null }
],
"outputParameters": [],
"deterministic": "async (page, parameters) => { const input = page.locator('#twotabsearchtextbox'); await input.waitFor({ state: 'attached', timeout: 30000 }); await input.fill(parameters.search_query); await page.keyboard.press('Enter'); return {}; }",
"next": "extract_top_result",
"router": null
},
{
"name": "extract_top_result",
"type": "ui",
"prompt": "Extract the title and price of the first product result. Return them as { top_result_title, top_result_price }.",
"inputParameters": [],
"outputParameters": [
{ "name": "top_result_title", "type": "string", "required": true, "description": "First result title", "defaultValue": null, "options": null },
{ "name": "top_result_price", "type": "number", "required": false, "description": "First result price", "defaultValue": null, "options": null }
],
"deterministic": "async (page, parameters) => { const card = page.locator('[data-component-type=\"s-search-result\"]').first(); await card.waitFor({ state: 'attached', timeout: 30000 }); const title = (await card.locator('h2 span').first().textContent())?.trim(); const priceText = (await card.locator('.a-price > .a-offscreen').first().textContent())?.replace(/[^0-9.]/g, ''); const price = priceText ? Number(priceText) : undefined; if (!title) throw new Error(\"Missing required output 'top_result_title' from extract_top_result/h2\"); return { top_result_title: title, top_result_price: price }; }",
"next": null,
"router": null
}
]
}
```
# MCP - Hosted Version
Source: https://docs.anchorbrowser.io/advanced/mcp
Connect Cursor, Claude, ChatGPT, Grok, or any MCP client to Anchor: cloud browsers that get past bot detection, sign in with MFA, run deterministic site actions, and scale without concurrency limits.

Anchor's hosted MCP servers give an agent a real browser in the cloud. Each session is an isolated VM destroyed when it ends, there is no concurrency limit, and the tools cover what agents actually struggle with on the web:
* **Sites that block bots**: residential and mobile proxies by country, extra-stealth fingerprinting, automatic captcha solving.
* **Scale at low cost**: saved tasks and the action index run deterministic code and fall back to an AI step only where a page changed, so repeat work does not pay LLM cost.
* **Digital coworkers**: long-lived signed-in sessions, a live view the user can watch or take over, and sign-in links so a person never hands an agent a password.
* **Authentication**: identities are managed logins; Anchor signs in, handles MFA, and keeps credentials in its vault. No tool returns them.
* **Security**: ephemeral VMs, Zero Data Retention mode, SOC 2 Type II, ISO 27001, HIPAA, and GDPR.
Nothing to install. Paste a URL into your client and sign in, or add an API key header. The dashboard's [MCP page](https://app.anchorbrowser.io/mcp) builds the config for you.
## Servers
Three servers over the same account. Start with `Anchor`; add `Anchor Browser` to drive a live browser and `Anchor Actions` for verified site actions.
> [card] [Anchor](#anchor)
>
> `https://api.anchorbrowser.io/v1/mcp` — start here. Web tasks, site actions, saved automations, managed logins, browser sessions, and `call_endpoint` for everything else.
> [card] [Anchor Browser](#anchor-browser)
>
> `https://api.anchorbrowser.io/v1/mcp/browser` — step-by-step control of a live browser.
> [card] [Anchor Actions](#anchor-actions)
>
> `https://api.anchorbrowser.io/v1/mcp/actions` — find and run deterministic recipes for any site. Add `/{domain}` for one site's recipes as typed tools.
### Anchor
`https://api.anchorbrowser.io/v1/mcp`
[Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=anchor\&config=eyJ1cmwiOiJodHRwczovL2FwaS5hbmNob3Jicm93c2VyLmlvL3YxL21jcCJ9), or from a CLI:
```bash theme={null}
claude mcp add --transport http anchor https://api.anchorbrowser.io/v1/mcp
grok mcp add --transport http anchor https://api.anchorbrowser.io/v1/mcp
```
The headline set for agents that should get work done on the web:
| Area | Tools |
| - | - |
| Web tasks | `perform_web_task`, `get_web_task_status` |
| Site actions | `search_action_index`, `get_action_index`, `execute_action_index` |
| Saved automations | `list_tasks`, `get_task`, `run_task`, `get_execution` |
| Managed logins | `create_identity`, `create_identity_link`, `create_reauth_link`, `reauthenticate_identity`, `get_identity` |
| Browser sessions | `create_session`, `get_session`, `end_session` |
| Docs | `search_docs`, `read_doc` |
| Everything else | `list_endpoints`, `get_endpoint`, `call_endpoint_read`, `call_endpoint_write` |
Long operations are asynchronous so tool calls return within a minute: `perform_web_task` returns a `workflow_id` to poll with `get_web_task_status`, `reauthenticate_identity` returns `pending` to poll with `get_identity`, and `run_task` returns an execution to poll with `get_execution`.
> [!NOTE]
>
> `https://api.anchorbrowser.io/v1/mcp/all` serves every route tagged for agents as its own typed tool, `Anchor` tools first, for integrations whose client can hold a large tool list. Use it instead of `Anchor`, not alongside it; the tool names overlap.
### Anchor Browser
`https://api.anchorbrowser.io/v1/mcp/browser`
[Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=anchor-browser\&config=eyJ1cmwiOiJodHRwczovL2FwaS5hbmNob3Jicm93c2VyLmlvL3YxL21jcC9icm93c2VyIn0%3D), or from a CLI:
```bash theme={null}
claude mcp add --transport http anchor-browser https://api.anchorbrowser.io/v1/mcp/browser
grok mcp add --transport http anchor-browser https://api.anchorbrowser.io/v1/mcp/browser
```
Step-by-step `anchor_*` tools over a live Anchor session: navigate, snapshot, click, type, screenshot, network and console logs, and Playwright code generation. Element references come from accessibility snapshots instead of selectors, so no vision model is needed. Add an `anchor-session-id` header to attach to a session you created on the `Anchor` server; without it the first tool call opens a new session. Every result echoes the session id so `perform_web_task` and actions can continue in the same browser.
> [!NOTE]
>
> `https://api.anchorbrowser.io/mcp` is the legacy address of this server and keeps working with an `anchor-api-key` header.
### Anchor Actions
`https://api.anchorbrowser.io/v1/mcp/actions`
One server for every site, with two tools. `find_actions` takes a site (a URL or bare domain) and/or a short goal and returns matching actions with their input schemas, outputs, and run records. `run_action` runs one by name. Actions run server-side in an Anchor browser with no LLM steps, and neither tool returns the action's code.
```bash theme={null}
claude mcp add --transport http anchor-actions https://api.anchorbrowser.io/v1/mcp/actions
grok mcp add --transport http anchor-actions https://api.anchorbrowser.io/v1/mcp/actions
```
#### One site as typed tools
`https://api.anchorbrowser.io/v1/mcp/actions/{domain}`, for example `/v1/mcp/actions/amazon.com`
The domain is part of the URL, so each site is its own server. For `amazon.com`: [Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=anchor-amazon\&config=eyJ1cmwiOiJodHRwczovL2FwaS5hbmNob3Jicm93c2VyLmlvL3YxL21jcC9hY3Rpb25zL2FtYXpvbi5jb20ifQ%3D%3D), or from a CLI:
```bash theme={null}
claude mcp add --transport http anchor-amazon https://api.anchorbrowser.io/v1/mcp/actions/amazon.com
grok mcp add --transport http anchor-amazon https://api.anchorbrowser.io/v1/mcp/actions/amazon.com
```
Several sites run in parallel: repeat with a different name and domain for each (`anchor-linkedin`, `anchor-github`, …). They share one sign-in and tool names are prefixed with the site, so they do not collide. The `anchor-actions` plugin holds one domain per install; use these per-site entries for anything beyond that.
Every active action index item for the site becomes a tool with the action's own parameter schema. Actions that require a signed-in session say so; pass the `sessionId` of a session created with an identity on the `Anchor` server. Each run is deterministic code in an Anchor browser, with no LLM steps.
## Authentication
**Sign in (OAuth).** Give the client only the URL. On first use it opens the Anchor sign-in and connects to your default project. Cursor, Claude, ChatGPT, Grok, and VS Code all support this.
**API key.** Add an `anchor-api-key` header from [API Keys](https://app.anchorbrowser.io/api-keys). Use this for CI, non-interactive runtimes, or a project other than your default.
## Connect a client
Each server above has its own Add to Cursor link and CLI commands. The snippets here use the `Anchor` server and cover the remaining clients; swap the URL for any server.
> [tab] Cursor
>
> One click: [Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=anchor\&config=eyJ1cmwiOiJodHRwczovL2FwaS5hbmNob3Jicm93c2VyLmlvL3YxL21jcCJ9), or add to `.cursor/mcp.json`:
>
> ```json theme={null}
> {
> "mcpServers": {
> "anchor": {
> "url": "https://api.anchorbrowser.io/v1/mcp"
> }
> }
> }
> ```
>
> With an API key instead of sign-in:
>
> ```json theme={null}
> {
> "mcpServers": {
> "anchor": {
> "url": "https://api.anchorbrowser.io/v1/mcp",
> "headers": { "anchor-api-key": "YOUR_ANCHOR_API_KEY" }
> }
> }
> }
> ```
> [tab] Claude
>
> Claude Code:
>
> ```bash theme={null}
> claude mcp add --transport http anchor https://api.anchorbrowser.io/v1/mcp
> ```
>
> Claude Desktop and claude.ai: Settings → Connectors → Add custom connector, paste `https://api.anchorbrowser.io/v1/mcp`, and sign in when prompted.
> [tab] ChatGPT
>
> Settings → Connectors → Create, paste `https://api.anchorbrowser.io/v1/mcp`, and sign in when prompted. Developer mode must be enabled for custom connectors.
> [tab] Grok
>
> Grok CLI:
>
> ```bash theme={null}
> grok mcp add --transport http anchor https://api.anchorbrowser.io/v1/mcp
> ```
>
> grok.com: Connectors → New Connector → Custom, paste the URL, and sign in. Grok also reads `.cursor/mcp.json` and `.mcp.json` from your project.
> [tab] VS Code
>
> Add to `.vscode/mcp.json`:
>
> ```json theme={null}
> {
> "servers": {
> "anchor": {
> "type": "http",
> "url": "https://api.anchorbrowser.io/v1/mcp"
> }
> }
> }
> ```
> [tab] Python
>
> ```python theme={null}
> import asyncio
> from mcp import ClientSession
> from mcp.client.streamable_http import streamablehttp_client
>
> async def main():
> async with streamablehttp_client(
> url="https://api.anchorbrowser.io/v1/mcp",
> headers={"anchor-api-key": "YOUR_ANCHOR_API_KEY"},
> ) as (read, write, _):
> async with ClientSession(read, write) as session:
> await session.initialize()
> result = await session.call_tool(
> "perform_web_task",
> {"prompt": "Return the top Show HN post", "url": "https://news.ycombinator.com"},
> )
> print(result.content[0].text)
>
> asyncio.run(main())
> ```
> [tab] OpenAI / xAI API
>
> Attach a server to a Responses API request; the platform calls Anchor for you:
>
> ```python theme={null}
> tools=[{
> "type": "mcp",
> "server_label": "anchor",
> "server_url": "https://api.anchorbrowser.io/v1/mcp",
> "headers": {"anchor-api-key": "YOUR_ANCHOR_API_KEY"},
> }]
> ```
## Examples
**Run a web task and poll it**
```text theme={null}
Use Anchor to find the current top post on Hacker News and give me its title and URL.
```
The agent calls `perform_web_task`, receives a `workflow_id`, and polls `get_web_task_status` until the result is ready.
**Work inside a signed-in account**
```text theme={null}
Create an Anchor identity for https://app.example.com and give me a link to sign in.
Then open a session with it and list my open invoices.
```
The agent calls `create_identity`, then `create_reauth_link` and hands you the link. After you sign in, it calls `create_session` with the identity and runs `perform_web_task` with that `sessionId`. Your password never passes through the conversation.
**Generate a Playwright test from a real session (Anchor Browser)**
```text theme={null}
- You are a playwright test generator.
- You are given a scenario and you need to generate a playwright test for it.
- DO NOT generate test code based on the scenario alone.
- DO run steps one by one using the tools provided by the Anchor Browser MCP.
- Only after all steps are completed, emit a Playwright TypeScript test that uses @playwright/test based on message history
- Save generated test file in the tests directory
- Execute the test file and iterate until the test passes
Generate a Playwright test for the following scenario:
1. Navigate to https://www.imdb.com/
2. search for 'Garfield'
3. return the director of the last movie
```
## Install as a plugin
The [anchor-mcp-plugin](https://github.com/anchorbrowser/anchor-mcp-plugin) repository lists `anchor`, `anchor-browser`, and `anchor-actions` as separate plugins for Cursor, Claude Code, and Grok, using sign-in for authentication. `anchor-actions` asks for the site domain.
```bash theme={null}
claude plugin marketplace add anchorbrowser/anchor-mcp-plugin
claude plugin install anchor@anchorbrowser
```
In Cursor, install **Anchor** from the marketplace; **Anchor Browser** and **Anchor Actions** are listed alongside it. For Grok, copy the repository's `.grok/config.toml` into your project or run the `grok mcp add` commands from its README.
## Self-hosting
For custom tools or running inside your own infrastructure, see the [open source MCP server](/advanced/mcp-open-source).
## Getting help
1. Check the API key or re-run the sign-in from your client.
2. Disable and re-enable the server in the client.
3. Reach out at [support@anchorbrowser.io](mailto:support@anchorbrowser.io).
# MCP - Open Source
Source: https://docs.anchorbrowser.io/advanced/mcp-open-source
Self-host Anchor MCP server with customizable Playwright integration for your specific needs
# Anchor MCP Server (Open Source)

A Model Context Protocol (MCP) server that provides browser automation capabilities using [Anchor Browser](https://anchorbrowser.io)'s remote browser service with [Playwright](https://playwright.dev). This server enables LLMs to interact with web pages through Anchor's cloud-based browsers with built-in proxies, stealth features, and advanced capabilities.
This is based on the open source repository at [browsermcp-com/mcp](https://github.com/browsermcp-com/mcp), which extends Microsoft's Playwright MCP with Anchor Browser's cloud infrastructure.
> [!NOTE]
>
> Looking for our hosted MCP service? Check out [MCP - Hosted Version](/advanced/mcp) for zero-setup integration.
## When to Use Open Source MCP
Choose the open source version when you need:
* **Custom tool modifications** - Modify browser automation tools for specific use cases
* **Advanced configuration** - Fine-tune browser settings and behaviors
* **Local development** - Test MCP integrations during development
* **Compliance requirements** - Run MCP server within your infrastructure
* **Integration with existing systems** - Connect MCP to your internal tools and workflows
## Key Features
* **Remote Browser Execution**: Uses Anchor Browser's cloud infrastructure instead of local browsers
* **Built-in Proxies**: Automatic proxy rotation and geo-targeting
* **Stealth & Anti-Detection**: Advanced browser fingerprinting and anti-bot detection
* **Fast and lightweight**: Uses Playwright's accessibility tree, not pixel-based input
* **LLM-friendly**: No vision models needed, operates purely on structured data
* **Deterministic tool application**: Avoids ambiguity common with screenshot-based approaches
* **Customizable**: Modify and extend tools for your specific needs
## Requirements
* Node.js 18 or newer
* **Anchor Browser API Key** ([Get one here](https://anchorbrowser.io))
* VS Code, Cursor, Windsurf, Claude Desktop, Goose or any other MCP client
## Getting Started
### 1. Clone and Build
Since this is a custom Anchor MCP server, you need to build it locally:
```bash theme={null}
# Clone the repository
git clone https://github.com/browsermcp-com/mcp.git
cd mcp
# Install dependencies and build
npm install
npm run build
```
### 2. Get Your Anchor API Key
1. Sign up at [anchorbrowser.io](https://anchorbrowser.io)
2. Get your API key from the dashboard
3. Copy your API key (starts with `sk-`)
### 3. Configure MCP Client
#### Cursor
Add to your `~/.cursor/mcp.json`:
```json theme={null}
{
"mcpServers": {
"anchor-browser": {
"command": "node",
"args": [
"/path/to/mcp/cli.js"
],
"env": {
"ANCHOR_API_KEY": "sk-your-api-key-here"
}
}
}
}
```
#### VS Code
Add to your MCP configuration:
```json theme={null}
{
"mcpServers": {
"anchor-browser": {
"command": "node",
"args": [
"/path/to/mcp/cli.js"
],
"env": {
"ANCHOR_API_KEY": "sk-your-api-key-here"
}
}
}
}
```
#### Claude Desktop
Add to your `claude_desktop_config.json`:
```json theme={null}
{
"mcpServers": {
"anchor-browser": {
"command": "node",
"args": [
"/path/to/mcp/cli.js"
],
"env": {
"ANCHOR_API_KEY": "sk-your-api-key-here"
}
}
}
}
```
### 4. Restart Your MCP Client
After updating the configuration, restart your MCP client (Cursor, VS Code, etc.) to load the new server.
## Configuration Options
The Anchor MCP server supports essential configuration options:
```bash theme={null}
node cli.js --help
```
### Available Options:
* `--host ` - Host to bind server to (default: localhost, use 0.0.0.0 for all interfaces)
* `--port ` - Port to listen on for HTTP transport (Docker/server mode)
### Example with Options:
```json theme={null}
{
"mcpServers": {
"anchor-browser": {
"command": "node",
"args": [
"/path/to/mcp/cli.js"
],
"env": {
"ANCHOR_API_KEY": "sk-your-api-key-here"
}
}
}
}
```
## How It Works
1. **Browser Session Creation**: When you use browser tools, the MCP server calls Anchor's API to create a remote browser session
2. **Remote Connection**: Connects to the remote browser via WebSocket using Chrome DevTools Protocol (CDP)
3. **Tool Execution**: All browser automation happens in Anchor's cloud infrastructure
4. **Proxy & Stealth**: Automatic proxy rotation and advanced anti-detection features
5. **Session Management**: Each session is isolated and can be viewed live via Anchor's dashboard
## Production & CI/CD Usage
### Self-Hosted in Production
The open source MCP server can be deployed in production environments:
* **Docker Containers** - Run in containerized environments
* **CI/CD Pipelines** - Integrate with Jenkins, GitHub Actions, GitLab CI
* **Serverless Functions** - Deploy as microservices or serverless functions
* **Kubernetes** - Scale horizontally in Kubernetes clusters
### CI/CD Integration Example
```yaml theme={null}
# GitHub Actions with self-hosted MCP
name: E2E Testing
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
anchor-mcp:
image: your-registry/anchor-mcp:latest
env:
ANCHOR_API_KEY: ${{ secrets.ANCHOR_API_KEY }}
ports:
- 8931:8931
steps:
- uses: actions/checkout@v3
- name: Run AI tests against MCP server
run: |
python ai_test_runner.py --mcp-url http://localhost:8931/mcp
```
## Benefits Over Local Browsers
### 🌐 **Global Proxy Network**
* Automatic proxy rotation
* Geo-targeting for different regions
* No proxy configuration needed
### 🛡️ **Advanced Stealth**
* Browser fingerprinting protection
* Anti-bot detection bypass
* Real browser environments
### ☁️ **Cloud Infrastructure**
* No local browser dependencies
* Consistent browser versions
* Scalable execution
### 📊 **Monitoring & Debugging**
* Live view of browser sessions
* Session recordings and traces
* Network request logging
# Custom MFA
Source: https://docs.anchorbrowser.io/advanced/mfa
Inject MFA codes from your own systems during browser automation using event coordination.
# Custom MFA
Use **event coordination** to pass MFA codes from external systems — your mobile app, webhook, or backend — into an active browser session during automation.
## Overview
The system provides two operations:
* **Signal Event**: Send data to an event channel
* **Wait for Event**: Listen for data on an event channel with timeout
Events are user-scoped and work across multiple browser instances.
**API Endpoints**
## API Endpoints
### Signal an Event
```http theme={null}
POST https://api.anchorbrowser.io/api/v1/events/{eventName}
```
### Wait for an Event
```http theme={null}
POST https://api.anchorbrowser.io/api/v1/events/{eventName}/wait
```
Both endpoints require `anchor-api-key` header and accept JSON payloads.
####
## Custom MFA flow
Handle MFA codes during automated login flows:
```javascript theme={null}
// In your browser automation script
async function handleMFAFlow() {
await page.fill('#username', 'user@example.com');
await page.fill('#password', 'password');
await page.click('#login-button');
// Wait for MFA code from external system
const mfaEvent = await waitForEvent('mfa_code', 30000);
if (mfaEvent?.data?.code) {
await page.fill('#mfa-code', mfaEvent.data.code);
await page.click('#verify-button');
}
}
```
```javascript theme={null}
// In your external system (mobile app, webhook, etc.)
async function sendMFACode(code) {
await signalEvent('mfa_code', { code });
}
```
## Implementation
### Helper Functions
```javascript node.js theme={null}
import { client, Events } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
async function signalEvent(eventName, data) {
try {
const response = await Events.signalEvent({
path: { event_name: eventName },
body: { data: data || {} },
});
return response;
} catch (error) {
throw new Error(`Failed to signal event: ${error.message}`);
}
}
async function waitForEvent(eventName, timeoutMs = 60000) {
try {
const response = await Events.waitForEvent({
path: { event_name: eventName },
body: { timeoutMs },
});
return response;
} catch (error) {
if (error.message.includes("408")) return null; // Timeout
throw new Error(`Failed to wait for event: ${error.message}`);
}
}
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
def signal_event(event_name, data):
try:
response = anchor_client.events.signal_event(event_name, data=data or {})
return response
except Exception as error:
raise Exception(f"Failed to signal event: {error}")
def wait_for_event(event_name, timeout_ms=60000):
try:
response = anchor_client.events.wait_for_event(event_name, timeout_ms=timeout_ms)
return response
except Exception as error:
if "408" in str(error):
return None # Timeout
raise Exception(f"Failed to wait for event: {error}")
```
## Event Flow Patterns
**Signal First, Wait Later** (immediate consumption):
```javascript theme={null}
await signalEvent("data", { value: "preloaded" });
const data = await waitForEvent("data", 1000); // Short timeout
```
**Wait First, Signal Later** (typical MFA flow):
```javascript theme={null}
const waitPromise = waitForEvent("mfa_code", 60000);
// ... other operations ...
const mfaData = await waitPromise;
```
## Best Practices
* Use descriptive event names: `mfa_code_login`, `mfa_code_transfer`
* Always set appropriate timeouts
* Validate received event data
* Handle timeout scenarios gracefully
# OS-Level Control
Source: https://docs.anchorbrowser.io/advanced/os-level-control
Direct operating system control for precise browser automation and AI agent interactions
# OS-Level Control
OS-level control provides direct access to operating system primitives like mouse movements, keyboard input, and screen interactions within your browser sessions. This approach offers more precise control than traditional web automation methods and is particularly powerful when combined with AI agents and vision-based models.
## Why OS-Level Control?
### Superior AI Agent Performance
**Vision-based AI models perform significantly better** when they can interact with the browser using the same primitives humans use:
* **OS-level UI elements**: Dropdowns, context menus, and system dialogs that aren't part of the webpage DOM.
* **Visual coordinate targeting**: AI agents can directly click on elements they see in screenshots
* **Keyboard shortcuts work naturally**: `Ctrl+F` for searching, `Ctrl+L` for browser navbar interaction, `Ctrl+T` for new tabs
**Key List for Keyboard Shortcuts**
## Supported Keys For Keyboard Shortcuts
| | | | | | | | |
| - | - | - | - | - | - | - | - |
| `A`-`Z` | `Up` | `F1` | `F7` | `Control` | `Enter` | `Command` | |
| `0`-`9` | `Down` | `F2` | `F8` | `Ctrl` | `Return` | `Cmd` | |
| `Space` | `Left` | `F3` | `F9` | `Alt` | `Backspace` | `Windows` | |
| `Home` | `Right` | `F4` | `F10` | `Shift` | `Delete` | `Win` | |
| `End` | `PageUp` | `F5` | `F11` | `CapsLock` | `Escape` | `Insert` | |
| `Tab` | `PageDown` | `F6` | `F12` | `NumLock` | `Esc` | `Ins` | |
## Core Capabilities - Beyond Traditional Web Automation
Control mouse interactions with pixel-level precision:
### Basic Click
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const response = await Sessions.mouseClick({
path: { sessionId: "Your Session ID" },
// Single click at coordinates
body: {
x: 100,
y: 700,
},
});
console.log(response.data.status)
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
client = Anchorbrowser(
api_key = os.getenv("ANCHOR_API_KEY")
)
response = client.sessions.mouse_click(
session_id = "Your Session ID",
# Single click at coordinates
x = 100,
y = 700,
)
print(response.status)
```
### Advanced Mouse Control
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = "Your Session ID";
// Double-click for text selection
await Sessions.mouseDoubleClick({
path: { sessionId },
body: {
x: 500,
y: 200
}
});
// Mouse down and up for custom gestures
await Sessions.mouseDown({
path: { sessionId },
body: {
x: 100,
y: 100,
}
});
// Move while holding down (drag)
await Sessions.mouseMove({
path: { sessionId },
body: {
x: 300,
y: 300
}
});
// Release
await Sessions.mouseUp({
path: { sessionId },
body: {
x: 300,
y: 300
}
});
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "Your Session ID"
# Double-click for text selection
anchor_client.sessions.mouse_double_click(session_id, x = 500, y = 200)
# Mouse down and up for custom gestures
anchor_client.sessions.mouse_down(session_id, x = 100, y = 100)
# Move while holding down (drag)
anchor_client.sessions.mouse_move(session_id, x = 300, y = 300)
# Release
anchor_client.sessions.mouse_up(session_id, x = 300, y = 300)
```
### Drag and Drop
Perform complex drag and drop operations in a single command:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = "Your Session ID";
// Drag and Drop
await Sessions.dragAndDrop({
path: { sessionId },
body: {
startX: 200,
startY: 150,
endX: 600,
endY: 400,
}
});
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "Your Session ID"
# Drag and Drop
anchor_client.sessions.drag_and_drop(session_id,
start_x = 200,
start_y = 150,
end_x = 600,
end_y = 400
)
```
### Keyboard Input
Send text and keyboard shortcuts with human-like timing:
#### Text Input
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = "Your Session ID";
// Type text with optional delay between keystrokes
await Sessions.keyboardType({
path: { sessionId },
body: {
text: "Hello, world!",
delay: 50 // milliseconds between keystrokes
}
});
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "Your Session ID"
# Type text with optional delay between keystrokes
anchor_client.sessions.keyboard_type(session_id,
text = "Hello, world!",
delay = 50 # milliseconds between keystrokes
)
```
#### Keyboard Shortcuts
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = "Your Session ID";
// Execute keyboard shortcuts
Sessions.keyboardShortcut({
path: { sessionId },
body: {
keys: ['Ctrl', 'a'], // Select all
holdTime: 100 // Hold keys for 100ms
}
});
// Common shortcuts
const shortcuts = {
selectAll: ['Ctrl', 'a'],
copy: ['Ctrl', 'c'],
paste: ['Ctrl', 'v'],
undo: ['Ctrl', 'z'],
newTab: ['Ctrl', 't'],
closeTab: ['Ctrl', 'w'],
focusAddressBar: ['Ctrl', 'l']
};
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "Your Session ID"
# Execute keyboard shortcuts
anchor_client.sessions.keyboard_shortcut(session_id,
keys = ['Ctrl', 'a'],
hold_time = 100 # Hold keys for 100ms
)
# Common shortcuts
shortcuts = {
'select_all': ['Ctrl', 'a'],
'copy': ['Ctrl', 'c'],
'paste': ['Ctrl', 'v'],
'undo': ['Ctrl', 'z'],
'new_tab': ['Ctrl', 't'],
'close_tab': ['Ctrl', 'w'],
'focus_address_bar': ['Ctrl', 'l']
}
```
### Scrolling
Control page scrolling with precision:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = "Your Session ID";
// Scroll at specific coordinates
Sessions.scroll({
path: { sessionId },
body: {
x: 400, // Where to perform scroll (cursor position)
y: 300, // Where to perform scroll (cursor position)
deltaX: 0, // Horizontal scroll amount (does not correlate with pixels)
deltaY: 200, // Vertical scroll amount (does not correlate with pixels, positive = down)
steps: 5 // Number of steps for smooth scrolling
}
});
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "Your Session ID"
# Scroll at specific coordinates
anchor_client.sessions.scroll(session_id,
x = 400, # Where to perform scroll (cursor position)
y = 300, # Where to perform scroll (cursor position)
delta_x = 0, # Horizontal scroll amount (does not correlate with pixels)
delta_y = 200, # Vertical scroll amount (does not correlate with pixels, positive = down)
steps = 5 # Number of steps for smooth scrolling
)
```
### Screenshots
Capture visual state for AI analysis:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
import { writeFile } from 'node:fs/promises';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = "Your Session ID";
// Take screenshot of current browser state (returns a Blob)
const imageBlob = await Sessions.getSessionScreenshot({
path: { sessionId }
});
console.log(imageBlob);
// Process screenshot with vision AI model (add code below)
// Or save screenshot to file
const ab = await imageBlob.arrayBuffer();
await writeFile('image.png', Buffer.from(ab));
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "Your Session ID"
# Take screenshot of current browser state
response = anchor_client.sessions.get_session_screenshot(session_id)
print(response)
# Save screenshot to file
with open("image.png", "wb") as f:
for chunk in response.iter_bytes(chunk_size=8192):
f.write(chunk)
# Process screenshot with vision AI model (add code below)
print(f"Received {response}")
```
### Clipboard Operations
Manage clipboard content programmatically:
#### Reading Clipboard
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = "Your Session ID";
// Get current clipboard content
const response = await Sessions.getClipboard({
path: { sessionId }
});
console.log('Clipboard content:', response.data.text);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "Your Session ID"
# Get current clipboard content
response = anchor_client.sessions.get_clipboard(session_id)
print(response)
```
#### Setting Clipboard
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = "Your Session ID";
// Set clipboard content
await Sessions.setClipboard({
path: { sessionId },
body: {
text: "Content to copy"
}
});
// Trigger copy operation (copies selected text)
const copyResponse = await Sessions.copy({
path: { sessionId }
});
// Trigger paste operation
await Sessions.paste({
path: { sessionId },
body: {
text: "Text to paste"
}
});
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "Your Session ID"
# Set clipboard content
anchor_client.sessions.set_clipboard(session_id, text="Content to copy")
# Trigger copy operation (copies selected text)
copy_response = anchor_client.sessions.copy(session_id)
# Trigger paste operation
anchor_client.sessions.paste(session_id, text="Text to paste")
```
### Navigation
Direct URL navigation at the OS level on the currently selected tab:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = "Your Session ID";
// Navigate to a specific URL (completely OS-level, operates on selected tab)
const response = await Sessions.goto({
path: { sessionId },
body: {
url: "https://example.com"
}
});
console.log("Navigation response:", response);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "Your Session ID"
# Navigate to a specific URL (completely OS-level, operates on selected tab)
response = anchor_client.sessions.goto(session_id, url="https://example.com")
print("Navigation response:", response)
```
## AI Agent Integration Patterns
### OpenAI Computer Use Integration
Anchor includes an integrated **OpenAI Computer Use agent** that leverages OS-level control for enhanced AI interactions. This agent can perform complex tasks by combining vision models with precise OS-level operations.
```python python theme={null}
class AnchorBrowser(BasePlaywrightComputer):
"""
Computer implementation for Anchor browser (https://anchorbrowser.io)
Uses OS-level control endpoints for browser automation within the container.
IMPORTANT: The `goto` and navigation tools are already implemented and recommended
when using the Anchor computer to help the agent navigate more effectively.
"""
def __init__(self, width: int = 1024, height: int = 900, session_id: str = None):
"""Initialize the Anchor browser session"""
super().__init__()
self.dimensions = (width, height)
self.session_id = session_id
self.base_url = "http://localhost:8484/api/os-control"
def screenshot(self) -> str:
"""
Capture a screenshot using OS-level control API.
Returns:
str: A base64 encoded string of the screenshot for AI model consumption.
"""
try:
response = requests.get(f"{self.base_url}/screenshot")
if not response.ok:
print(f"OS-level screenshot failed, falling back to standard screenshot")
return super().screenshot()
# OS-level API returns binary PNG data, encoded for AI models
return base64.b64encode(response.content).decode('utf-8')
except Exception as error:
print(f"OS-level screenshot failed, falling back: {error}")
return super().screenshot()
def click(self, x: int, y: int, button: str = "left") -> None:
"""
Click at the specified coordinates using OS-level control.
Args:
x: The x-coordinate to click.
y: The y-coordinate to click.
button: The mouse button to use ('left', 'right').
"""
try:
response = requests.post(
f"{self.base_url}/mouse/click",
json={"x": x, "y": y, "button": button}
)
if not response.ok:
print(f"OS-level click failed, falling back to standard click")
super().click(x, y, button)
except Exception as error:
print(f"OS-level click failed, falling back: {error}")
super().click(x, y, button)
def type(self, text: str) -> None:
"""
Type text using OS-level control with realistic delays.
"""
try:
response = requests.post(
f"{self.base_url}/keyboard/type",
json={"text": text, "delay": 30}
)
if not response.ok:
print(f"OS-level type failed, falling back to standard type")
super().type(text)
except Exception as error:
print(f"OS-level type failed, falling back: {error}")
super().type(text)
def keypress(self, keys: List[str]) -> None:
"""
Press keyboard shortcut using OS-level control.
Args:
keys: List of keys to press simultaneously (e.g., ['Ctrl', 'c']).
"""
try:
response = requests.post(
f"{self.base_url}/keyboard/shortcut",
json={"keys": keys, "holdTime": 100}
)
if not response.ok:
print(f"OS-level keyboard shortcut failed, falling back")
# Fallback to standard implementation
for key in keys:
self._page.keyboard.down(key)
for key in reversed(keys):
self._page.keyboard.up(key)
except Exception as error:
print(f"OS-level keyboard shortcut failed: {error}")
```
### Usage with OpenAI Models
The integrated computer use agent works seamlessly with OpenAI's vision models:
```python theme={null}
# Initialize the agent with your session
agent = AnchorBrowser(width=1440, height=900, session_id="your-session-id")
# The agent can now:
# 1. Take screenshots for AI analysis
screenshot = agent.screenshot()
# 2. Perform precise clicks based on AI vision
agent.click(x=400, y=300)
# 3. Type text naturally
agent.type("Hello from AI agent!")
# 4. Execute keyboard shortcuts
agent.keypress(['Ctrl', 'l']) # Focus address bar
agent.keypress(['Ctrl', 'f']) # Open search
```
The computer use integration provides **automatic fallbacks** to standard browser automation if OS-level operations aren't available, ensuring reliability across different environments.
## Limitations and Considerations
### Session Requirements
* **Headful Sessions Only**: OS-level control requires a visible desktop environment
* **Performance Impact**: Screenshots and precise positioning may be slower than DOM-based automation
***
OS-level control opens up powerful possibilities for AI-driven browser automation, enabling more natural and effective interactions that mirror human behavior while providing the precision needed for reliable automation workflows.
# P2P Download
Source: https://docs.anchorbrowser.io/advanced/p2p-downloads
Receive download events in real time and fetch files directly from the browser
## What is P2P Download?
P2P downloads let you receive a real-time notification the moment a file is downloaded in your browser session, then fetch the file **directly from the active session** — no polling, no waiting for Anchor to process the file, no storage APIs required.
## How It Works
**Traditional downloads:**
> Browser downloads file → Anchor stores the file → You poll `GET /downloads` → Fetch from Anchor storage
**P2P downloads:**
> Browser downloads file → `Anchor.downloadReady` CDP event fires → You fetch directly from the browser
When a file is downloaded, the browser emits a custom CDP event (`Anchor.downloadReady`) over your existing WebSocket connection. The event includes a pre-built fetch URL that streams the file bytes directly from the browser's disk.
## Implementation
**1. Connect to the session and listen for the CDP event**
Connect Playwright over CDP as usual, then open a `CDPSession` on the page to listen for the `Anchor.downloadReady` event.
```typescript node.js theme={null}
import { chromium } from "playwright";
import { client, Sessions } from "anchorbrowser";
import fs from "fs";
const { ANCHOR_API_KEY } = process.env;
client.setConfig({ auth: () => ANCHOR_API_KEY });
const session = await Sessions.createSession();
const { cdp_url, id: sessionId } = session.data;
const browser = await chromium.connectOverCDP(cdp_url);
const page = browser.contexts()[0].pages()[0];
const cdpSession = await page.context().newCDPSession(page);
const downloadReady = new Promise((resolve) => {
cdpSession.on("Anchor.downloadReady", (params) => resolve(params));
});
```
```python python theme={null}
import os
from playwright.sync_api import sync_playwright
from anchorbrowser import Anchorbrowser
ANCHOR_API_KEY = os.getenv("ANCHOR_API_KEY")
client = Anchorbrowser(api_key=ANCHOR_API_KEY)
session = client.sessions.create_session()
cdp_url = session.data.cdp_url
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(cdp_url)
page = browser.contexts[0].pages[0]
cdp_session = page.context.new_cdp_session(page)
download_params = {}
def on_download_ready(params):
download_params.update(params)
cdp_session.on("Anchor.downloadReady", on_download_ready)
```
**2. Trigger the download**
Use Playwright as normal to navigate and click the download link.
```typescript node.js theme={null}
await page.goto("https://example.com/reports");
await page.click("#download-report");
```
```python python theme={null}
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(cdp_url)
page = browser.contexts[0].pages[0]
page.goto("https://example.com/reports")
page.click("#download-report")
```
**3. Receive the event and fetch the file**
Wait for the `Anchor.downloadReady` event, then use the `p2pDownloadUrl` from the event params to fetch the file.
```typescript node.js theme={null}
// Wait for the download event
const event = await downloadReady;
console.log(`Download ready: ${event.suggestedFilename} (${event.size} bytes)`);
// Fetch the file directly from the session
const response = await fetch(
`https://api.anchorbrowser.io${event.p2pDownloadUrl}`,
{ headers: { "anchor-api-key": ANCHOR_API_KEY } }
);
fs.writeFileSync(
event.suggestedFilename,
Buffer.from(await response.arrayBuffer())
);
console.log(`Saved ${event.suggestedFilename}`);
await browser.close();
```
```python python theme={null}
import requests, time
# Wait for the download event (up to 15 seconds)
timeout = 15
start = time.time()
while not download_params and time.time() - start < timeout:
time.sleep(0.1)
params = download_params
print(f"Download ready: {params['suggestedFilename']} ({params['size']} bytes)")
# Fetch the file directly from the session
response = requests.get(
f"https://api.anchorbrowser.io{params['p2pDownloadUrl']}",
headers={"anchor-api-key": ANCHOR_API_KEY},
stream=True,
)
with open(params["suggestedFilename"], "wb") as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
print(f"Saved {params['suggestedFilename']}")
```
## The `Anchor.downloadReady` Event
The event is emitted on the CDP WebSocket connection as soon as the file lands on disk.
```json theme={null}
{
"method": "Anchor.downloadReady",
"params": {
"localDownloadId": "4e901615-5f83-4773-a1af-773e15a19be8",
"suggestedFilename": "report.pdf",
"url": "https://example.com/report.pdf",
"originUrl": "https://example.com/reports",
"size": 1048576,
"duration": 2300,
"p2pDownloadUrl": "/v1/sessions/{sessionId}/downloads/{localDownloadId}/p2p"
}
}
```
| Field | Description |
| - | - |
| `localDownloadId` | Unique ID for this download, valid for the lifetime of the session |
| `suggestedFilename` | The filename as suggested by the browser |
| `url` | The URL the file was downloaded from |
| `originUrl` | The page URL where the download was triggered |
| `size` | File size in bytes |
| `duration` | Time to complete the download in milliseconds |
| `p2pDownloadUrl` | Relative URL to fetch the file — prepend your API base URL |
## Fetch Endpoint
```
GET /v1/sessions/:session_id/downloads/:local_download_id/p2p
```
This endpoint streams the file directly from the active session. It is only available while the session is **active**. Once the session ends, use the standard [session downloads API](/api-reference/browser-sessions/list-session-downloads) to retrieve files from Anchor storage.
| Status | Meaning |
| - | - |
| `200` | File streamed successfully |
| `404` | `local_download_id` not found (may have expired with the session) |
| `410` | Session is no longer active — use the standard `/downloads/:id/fetch` instead |
## Limitations
* The P2P fetch URL is only valid while the **session is running**. After the session ends, the file is no longer accessible via this endpoint.
* Files are still stored by Anchor in the background as a fallback. Once the session completes, they are accessible via the standard [list session downloads](/api-reference/browser-sessions/list-session-downloads) API.
* Blob and data URL downloads (files generated client-side in JavaScript) are supported.
# Popup Blocker
Source: https://docs.anchorbrowser.io/advanced/popup-blocker
Block cookie banners and consent dialogs in your browser sessions
Popup blocking is enabled by default in Anchor Browser. It blocks cookie banners and consent dialogs to create cleaner automation experiences.
> [!NOTE]
>
> Popup blocking is enabled by default. Disable it only if you need to test popup-related functionality.
## Quick Start
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
// Optional: Enabled by default (both), so this configuration is not required
browser: {
adblock: {
active: true // Required for popup blocking
},
popup_blocker: {
active: true // Blocks cookie banners and consent dialogs
}
}
}
});
console.log("Session:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
# Optional: Enabled by default (both), so this configuration is not required
browser={
"adblock": {
"active": True # Required for popup blocking
},
"popup_blocker": {
"active": True # Blocks cookie banners and consent dialogs
}
}
)
print("Session:", session.data.id)
```
> [!WARNING]
>
> Popup blocking requires ad blocking to be active. Disabling ad blocking will result an error.
## Disabling Popup Blocker
To disable popup blocking for a session, set `active: false` in the popup\_blocker configuration:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
// Optional: ad blocking is enabled by default, so this configuration is not required
adblock: {
active: true // Ad blocking must remain active
},
// Required to disable popup_blocker
popup_blocker: {
active: false // Disables popup blocking for this session
}
}
}
});
console.log("Session:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
browser={
# Optional: ad blocking is enabled by default, so this configuration is not required
"adblock": {
"active": True # Ad blocking must remain active
},
# Required to disable popup_blocker
"popup_blocker": {
"active": False # Disables popup blocking for this session
}
}
)
print("Session:", session.data.id)
```
## Related Features
* [Ad Blocker](/advanced/adblocker) - Block ads, trackers, and malicious content (required for popup blocking)
* [Captcha Solving](/advanced/captcha-solving) - Solve CAPTCHAs that may appear when ad blocking is detected
# Proxy
Source: https://docs.anchorbrowser.io/advanced/proxy
Anchor provides proxy configurations to access websites from different geographic locations, configurable down to the **city level.** Use [Bring Your Own Proxy](/advanced/bring-your-own-proxy) or Anchor's built-in proxy for localization.
> [!WARNING]
>
> Anchor Browser infrastructure is fully hosted in the US. For GDPR compliance, upgrade to the [Growth tier](https://app.anchorbrowser.io/billing) or [contact support](https://mail.google.com/mail/?view=cm\&fs=1\&to=support@anchorbrowser.io\&su=Full%20GDPR%20Compatibility%20Request).
#### Quick Start Example
Here's a simple example of how to use Anchor's built-in proxy:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
proxy: {
active: true,
country_code: 'gb',
}
}
}
});
console.log("Session created:", session.data);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
session={
'proxy': {
'active': True,
'country_code': 'gb',
}
}
)
print("Session created:", session.data)
```
This creates a browser session using Anchor's built-in proxy. You can change `country_code` to any supported country (e.g., 'gb', 'de', 'jp').
To experiment with different proxy configurations, visit our [Interactive API Reference](/api-reference/browser-sessions/start-browser-session)
## Using proxy with tasks
Save proxy settings on the task via `task_default_browser_configuration` — a **one-time setup**. Every run that does not pass a `session_id` will use this config.
Set it with `PATCH /v1/tools/{toolId}` or `task_browser_default_configuration` on `POST /v2/tasks/generate`:
```bash theme={null}
curl -X PATCH "https://api.anchorbrowser.io/v1/tools/{toolId}" \
-H "anchor-api-key: $ANCHOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task_default_browser_configuration": {
"session": {
"proxy": {
"active": true,
"type": "anchor_residential",
"country_code": "us"
}
},
"browser": {
"captcha_solver": { "active": true },
"profile": { "name": "my-task-profile", "persist": true }
}
}
}'
```
> [!NOTE]
>
> If you create a session with `POST /v1/sessions` and pass its `session_id` to `/run`, **that session's config is used** — including proxy. The task's `task_default_browser_configuration` is ignored for that run.
See [Run a Task](/tasks/run-a-task#task-config-vs-session-config) for the full run flow.
## Localization
You can specify a country code for your proxy to route traffic through a specific geographic location. This is useful for accessing region-specific content or testing localized experiences.
The `country_code` parameter accepts country codes in lowercase. See the [complete list of supported countries](#supported-countries-with-their-country-codes) below for all available options.
### Region and City-Based Targeting
For even more precise geographic targeting, you can specify both `region` and `city` parameters. This is only supported for the default proxy type (`anchor_proxy`).
**Important Notes:**
* The `city` parameter can only be used when `region` is also provided
* If you specify a city without a region, the city parameter will be ignored
* City names: use English, case-insensitive. Both "Los Angeles" and "los-angeles" work.
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const response = await Sessions.createSession({
body: {
session: {
proxy: {
active: true,
country_code: 'us',
region: 'ca',
city: 'los-angeles'
}
}
}
});
console.log('Session created:', response.data);
```
```python python theme={null}
import os
import json
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
response = anchor_client.sessions.create_session(
session={
'proxy': {
'active': True,
'country_code': 'us',
'region': 'ca',
'city': 'los-angeles'
}
}
)
print('Session created:')
print(response.data)
```
### Supported Countries with their Country Codes
> [tab] Anchor Proxy
>
> | | | | | | |
> | - | - | - | - | - | - |
> | Afghanistan | af | France | fr | Netherlands | nl |
> | Albania | al | French Guiana | gf | New Zealand | nz |
> | Algeria | dz | French Polynesia | pf | Nicaragua | ni |
> | Andorra | ad | Gabon | ga | Nigeria | ng |
> | Angola | ao | Gambia | gm | Norway | no |
> | American Samoa | as | Georgia | ge | Pakistan | pk |
> | Antigua and Barbuda | ag | Germany | de | Panama | pa |
> | Argentina | ar | Ghana | gh | Paraguay | py |
> | Armenia | am | Gibraltar | gi | Peru | pe |
> | Aruba | aw | Greece | gr | Philippines | ph |
> | Australia | au | Grenada | gd | Poland | pl |
> | Austria | at | Guadeloupe | gp | Portugal | pt |
> | Azerbaijan | az | Guatemala | gt | Puerto Rico | pr |
> | Bahamas | bs | Guernsey | gg | Qatar | qa |
> | Bahrain | bh | Guinea | gn | Romania | ro |
> | Barbados | bb | Guinea-Bissau | gw | Saint Lucia | lc |
> | Belarus | by | Guyana | gy | San Marino | sm |
> | Belgium | be | Haiti | ht | Saudi Arabia | sa |
> | Belize | bz | Honduras | hn | Senegal | sn |
> | Benin | bj | Hungary | hu | Serbia | rs |
> | Bermuda | bm | Iceland | is | Seychelles | sc |
> | Bolivia | bo | India | in | Sierra Leone | sl |
> | Bosnia and Herzegovina | ba | Iran | ir | Slovakia | sk |
> | Brazil | br | Iraq | iq | Slovenia | si |
> | Bulgaria | bg | Ireland | ie | Somalia | so |
> | Burkina Faso | bf | Israel | il | South Africa | za |
> | Cameroon | cm | Italy | it | South Korea | kr |
> | Canada | ca | Jamaica | jm | Spain | es |
> | Cape Verde | cv | Japan | jp | Suriname | sr |
> | Chad | td | Jordan | jo | Sweden | se |
> | Chile | cl | Kazakhstan | kz | Switzerland | ch |
> | Colombia | co | Kuwait | kw | Syria | sy |
> | Congo | cg | Kyrgyzstan | kg | São Tomé and Príncipe | st |
> | Costa Rica | cr | Latvia | lv | Taiwan | tw |
> | Côte d’Ivoire | ci | Lebanon | lb | Tajikistan | tj |
> | Croatia | hr | Libya | ly | Togo | tg |
> | Cuba | cu | Liechtenstein | li | Trinidad and Tobago | tt |
> | Cyprus | cy | Lithuania | lt | Tunisia | tn |
> | Czech Republic | cz | Luxembourg | lu | Turkey | tr |
> | Denmark | dk | Macedonia | mk | Turks and Caicos Islands | tc |
> | Dominica | dm | Mali | ml | Ukraine | ua |
> | Dominican Republic | do | Malta | mt | United Arab Emirates | ae |
> | Ecuador | ec | Martinique | mq | United Kingdom | gb |
> | Egypt | eg | Mauritania | mr | United States | us |
> | El Salvador | sv | Mexico | mx | Uruguay | uy |
> | Estonia | ee | Moldova | md | Uzbekistan | uz |
> | Ethiopia | et | Monaco | mc | Venezuela | ve |
> | Faroe Islands | fo | Montenegro | me | Yemen | ye |
> | Finland | fi | Morocco | ma | | |
# Self-healing
Source: https://docs.anchorbrowser.io/advanced/self-healing
How Anchor keeps Automation Tasks reliable — agentic completion during runs and durable workflow improvements afterward.
## Overview
Automation Tasks combine **deterministic Playwright code** for speed and consistency with **agentic steps** when the page needs more flexibility. As websites change, Anchor helps your tasks stay reliable in two ways:
| Layer | When it runs | What it does |
| - | - | - |
| **AI fallback** | During a run, when a segment needs agentic help | Completes the step with an AI agent so the run finishes successfully |
| **Workflow self-healing** | After a run, when a deterministic step failed | Analyzes the failure and creates a new draft version for you to review |
AI fallback keeps today's run on track. Self-healing turns what worked agentically into a stronger deterministic workflow for tomorrow.
## AI fallback
When a step needs more flexibility than deterministic code alone, Anchor completes it with an AI agent. The run keeps going — you get the result, and you can see exactly where the agent stepped in. This retries one step inside the same browser; to retry the whole run on a new browser, see [Retries](/tasks/run-a-task#retries).
### How to spot agentic steps
**On the execution.** Runs that used AI fallback show an **AI Fallback** badge in the task execution list and on the [run detail page](https://app.anchorbrowser.io/tools). Look for it next to the run status.
**On the workflow graph.** Open a run to view the **Workflow Graph**. Any segment that completed agentically shows an **AI Fallback** badge on that segment's card — during the run and after it finishes.
**In the steps panel.** The right-hand **Steps** panel lists each segment in order. Expand a segment to see its logs. When the agent completed that step, an **Agent Logs** section appears underneath — these are the agentic actions taken for that segment.
> [!TIP]
>
> Segments designed to run agentically from the start (not fallback) are marked with a **Bot** icon on the workflow graph. AI fallback is when a normally deterministic segment completed agentically instead.
### Turning AI fallback off
Some workflows must run deterministically or not at all — compliance-sensitive flows, or pipelines where a silent agent recovery masks a real regression. Set `ai_fallback_enabled` to `false` on the task to disable it.
In the dashboard, open the task and toggle **Allow AI in this task** off under **Settings**. The **Overview** tab shows the current state. New tasks default to on, and existing tasks are unchanged.
Via API:
```javascript node.js theme={null}
await client.put({
url: `/v1/task/${taskId}`,
body: { ai_fallback_enabled: false },
});
```
```python python theme={null}
anchor_client.put(
f'/v1/task/{task_id}',
body={'ai_fallback_enabled': False},
)
```
You can also set it at creation time with `ai_fallback_enabled` on `POST /v2/tasks/generate`. `GET /v1/task/{taskId}` returns the current value as `aiFallbackEnabled`.
**What changes when it's off:**
| | Fallback on (default) | Fallback off |
| - | - | - |
| `ui` / `network` step whose deterministic code throws | An agent retries the step; run continues; tagged **AI Fallback** | Step fails with the underlying error; the run fails |
| `logic` step that throws | Run fails | Run fails (unchanged) |
| `agent` step | Runs with AI | Runs with AI — it was never a fallback |
| `ui` / `network` step authored with no deterministic code | Runs with AI | Runs with AI — it was never a fallback |
| [Self-healing](#workflow-self-healing) after the run | May propose a draft version | May propose a draft version — unchanged |
> [!WARNING]
>
> Turning fallback off does **not** remove every agent from a run. Steps that are agentic *by design* — type `agent`, or a `ui`/`network` step authored with no deterministic code — still use AI, because they were never a fallback. Check the **Workflow** tab for **Bot**-icon segments before relying on a fully deterministic run.
>
> Identity authentication also runs as its own prerequisite task and is not covered by this setting. To keep login deterministic, use a cached browser profile.
## Workflow self-healing
After a run where a deterministic step failed, Anchor can study the execution and propose an updated workflow. **Nothing goes live automatically** — self-healing creates a draft version and waits for your approval.
### When it triggers automatically
Self-healing runs automatically after workflow runs that give Anchor enough signal to propose an update:
* The task is a **workflow** task, and the run reached a terminal state other than cancelled or timed out — a run that **failed** still heals
* A segment's **deterministic code failed** — whether or not AI fallback then recovered it — or a **logic segment** surfaced a condition worth updating in the workflow
This often happens on runs that **finished successfully**: the task completed, but one or more steps relied on the agent instead of deterministic code. Self-healing learns from that run so the next execution can stay on the deterministic path.
Self-healing is independent of the [AI fallback setting](#turning-ai-fallback-off) — a task running strictly deterministically still gets healed drafts proposed after a failure. Not every failure produces one. As always, a proposal is a draft: review it and deploy it yourself before it affects production runs.
### Review and approve
**1. Open the execution**
In the [Tasks UI](https://app.anchorbrowser.io/tools), open the task and find the run that triggered self-healing. Expand the execution to see the **summary** and **suggested improvement**.
**2. Review the proposed changes**
Click **Apply fix** to open a side-by-side comparison of the current workflow and the healed draft. Switch between **Code** and **Graph** views to inspect what changed.
**3. Test the healed version**
Click **Test Run** to execute the draft with the same inputs as the original run (or your own). Confirm the updated workflow runs deterministically before promoting it.
**4. Deploy to production**
Click **Deploy** to promote the healed draft to the task's latest version. Until you do, production runs continue using the previous version.
You can also approve via API — see [Code Tasks](/advanced/legacy-tasks#api-process-for-editing-a-workflow) for reading draft versions and calling `POST /v2/tasks/{taskId}/publish-draft`.
## Webhooks
Subscribe to `task.healed` to get notified when self-healing creates a draft version ready for review:
```json theme={null}
{
"type": "task.healed",
"data": {
"task_id": "tsk_4f8w9n2b",
"healed_task_version_id": "tv_demo_v4",
"source_execution_id": "exr_8d2c1fda",
"error_explanation": "Submit button moved into a new container.",
"fix_suggestion": "Use accessible label selector instead of XPath.",
"confidence_score": 0.82,
"published_as_draft": true
}
}
```
`published_as_draft: true` means the healed workflow was saved as a draft — not deployed. Use `healed_task_version_id` in your CI or ops pipeline to review, test, and promote the update when ready. See [Webhook events](/webhooks/events) for the full event catalog.
## Next steps
* [Run a Task](/tasks/run-a-task) — execute workflows and inspect execution results
* [Code Tasks](/advanced/legacy-tasks#manually-editing-workflow-json) — read draft versions and deploy via API
* [Webhook events](/webhooks/events) — automate on `task.healed`
# Sensitive Data Masking
Source: https://docs.anchorbrowser.io/advanced/sensitive-data-masking
Automatically detect and mask sensitive data like passwords, emails, phone numbers, and credit cards in your browser sessions
Sensitive data masking automatically detects and hides sensitive information displayed in web pages. It blurs input fields containing passwords, emails, and credit card numbers, and masks sensitive text visible on the page. This is useful for browser automation workflows that handle real user data, recordings, or live views where sensitive information should not be exposed.
> [!NOTE]
>
> Sensitive data masking is disabled by default. Enable it when your sessions handle real credentials, financial data, or other PII that should not appear in recordings or live views.
## Quick Start
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
sensitive_data_mask: {
active: true
}
}
}
});
console.log("Session:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
browser={
"sensitive_data_mask": {
"active": True
}
}
)
print("Session:", session.data.id)
```
## What Gets Masked
When enabled, the extension automatically detects and masks the following without any additional configuration.
### Input Fields (blurred)
The following input fields are visually blurred with `filter: blur(8px)`:
* Password fields (`type="password"`)
* Email fields (`type="email"`)
* Phone fields (`type="tel"`)
* Credit card fields (detected by `name` or `autocomplete` attributes containing `card`, `cc`, `cvv`, `cvc`, `expir`)
* SSN fields (detected by `name` containing `ssn`, `social_security`)
* Token and API key fields (detected by `name` containing `token`, `secret`, `api_key`, `access_key`, `private_key`)
* One-time code fields (`autocomplete="one-time-code"`)
### Text Content
Sensitive patterns found in visible text on the page are handled in two ways:
* **Dedicated elements**: When an element's text is primarily a sensitive value (e.g., `alice@example.com`), the entire element is blurred.
* **Inline text**: When a sensitive value is embedded in a larger sentence (e.g., "Contact us at [alice@example.com](mailto:alice@example.com) for help"), only the matched portion is replaced with `****`.
Built-in patterns include email addresses, phone numbers, credit card numbers, and long token-like strings (40+ characters).
## Custom CSS Selectors
You can specify additional CSS selectors to blur elements that the automatic detection might not cover. Custom selectors can be applied globally or scoped to specific sites.
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
sensitive_data_mask: {
active: true,
custom_selectors: [".api-key-display", "#secret-field", "[data-sensitive]"],
site_selectors: {
"app.example.com": [".account-number", ".routing-number"],
"*.bank.com": [".balance", ".ssn-display"]
}
}
}
}
});
console.log("Session:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
browser={
"sensitive_data_mask": {
"active": True,
"custom_selectors": [".api-key-display", "#secret-field", "[data-sensitive]"],
"site_selectors": {
"app.example.com": [".account-number", ".routing-number"],
"*.bank.com": [".balance", ".ssn-display"]
}
}
}
)
print("Session:", session.data.id)
```
### Selector Options
| Option | Type | Description |
| - | - | - |
| `custom_selectors` | `string[]` | CSS selectors applied globally across all sites. Matched elements are blurred. |
| `site_selectors` | `object` | Per-site CSS selectors. Keys are hostnames (supports `*.` wildcard prefix), values are arrays of CSS selectors. |
Site selector keys support wildcard matching:
* `"example.com"` matches only `example.com`
* `"*.example.com"` matches `app.example.com`, `dashboard.example.com`, etc.
## Custom Regex Patterns
For data formats not covered by the built-in patterns, you can define custom regular expressions. Custom patterns follow the same blur-vs-replace logic as built-in patterns.
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
sensitive_data_mask: {
active: true,
custom_patterns: [
{ regex: "AKIA[0-9A-Z]{16}", mask: "[AWS_KEY]" },
{ regex: "ghp_[a-zA-Z0-9]{36}", mask: "[GITHUB_TOKEN]" },
{ regex: "sk-[a-zA-Z0-9]{48}" }
]
}
}
}
});
console.log("Session:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
browser={
"sensitive_data_mask": {
"active": True,
"custom_patterns": [
{"regex": "AKIA[0-9A-Z]{16}", "mask": "[AWS_KEY]"},
{"regex": "ghp_[a-zA-Z0-9]{36}", "mask": "[GITHUB_TOKEN]"},
{"regex": "sk-[a-zA-Z0-9]{48}"}
]
}
}
)
print("Session:", session.data.id)
```
### Pattern Options
| Option | Type | Required | Description |
| - | - | - | - |
| `regex` | `string` | Yes | A regular expression pattern to match sensitive data. |
| `mask` | `string` | No | Replacement string for matched text. Defaults to `****`. |
## Configuration Reference
| Option | Type | Default | Description |
| - | - | - | - |
| `active` | `boolean` | `false` | Enable or disable sensitive data masking. |
| `custom_selectors` | `string[]` | `[]` | Additional CSS selectors to blur globally. |
| `site_selectors` | `object` | `{}` | Per-site CSS selectors keyed by hostname. |
| `custom_patterns` | `object[]` | `[]` | Custom regex patterns with optional replacement strings. |
## Related Features
* [Recording](/essentials/recording) - Session recordings where sensitive data masking prevents PII exposure
* [Browser Live View](/advanced/browser-live-view) - Live view where masked data stays hidden from observers
* [Stealth](/essentials/stealth) - Bot detection avoidance (separate concern from data masking)
# Session Tags
Source: https://docs.anchorbrowser.io/advanced/session-tags
Organize and track browser sessions with custom labels
### Categorizing Browser Sessions
Session tags allow you to add custom labels to your browser sessions, making it easier to organize, filter, and track sessions across your workflows. Tags are simple strings that you can use to categorize sessions by project, environment, customer, or any other criteria relevant to your use case.
For the full list of available options, view the [interactive API documentation](/api-reference/browser-sessions).
### Common Use Cases
Tags are particularly useful for:
* **Environment tracking**: Label sessions as `production`, `staging`, or `development`
* **Customer attribution**: Tag sessions with customer IDs like `customer-12345`
* **Project organization**: Group sessions by project name or feature
* **Workflow identification**: Mark sessions for specific automation tasks like `form-fill`, `testing`, or `data-extraction`
* **Cost allocation**: Track resource usage across teams or departments
### Adding Tags to Sessions
You can add tags when creating a new browser session by including the `tags` array in your session configuration. Each tag is a simple string value.
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
tags: ["production", "form-fill", "customer-12345"]
}
}
});
console.log("Session created with tags:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
session={
"tags": ["production", "form-fill", "customer-12345"]
}
)
print("Session created with tags:", session.data.id)
```
### Combining with Other Configuration
Tags can be combined with any other session configuration options:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
tags: ["production", "checkout-flow"],
initial_url: "https://example.com",
proxy: {
active: true,
country_code: "us"
},
timeout: {
max_duration: 30,
idle_timeout: 5
}
}
}
});
console.log("Session created:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
session={
"tags": ["production", "checkout-flow"],
"initial_url": "https://example.com",
"proxy": {
"active": True,
"country_code": "us"
},
"timeout": {
"max_duration": 30,
"idle_timeout": 5
}
}
)
print("Session created:", session.data.id)
```
### Viewing Tags
When you retrieve session information, the tags will be included in the response:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.getSession({ path: { session_id: "SESSION_ID" } });
console.log("Session tags:", session.data.tags);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.get_session("SESSION_ID")
print("Session tags:", session.data.tags)
```
### Best Practices
* **Keep tags concise**: Use short, descriptive labels that are easy to read and filter
* **Use consistent naming**: Establish a tagging convention across your team (e.g., kebab-case like `project-name`)
* **Avoid sensitive data**: Don't include passwords, API keys, or other sensitive information in tags
* **Limit tag count**: While there's no hard limit, keeping the number of tags reasonable improves organization
# Session Timeout
Source: https://docs.anchorbrowser.io/advanced/session-timeout
### Managing Browser Session Lifetime
Anchor provides multiple ways to control and terminate browser sessions. In addition to manually stopping sessions via the [stop session API](/api-reference/browser-sessions/end-browser-session), you can configure two types of automatic timeout mechanisms to manage session lifetime effectively.
For the full list of available options, view the [interactive api documentation](/api-reference/browser-sessions).
### Timeout Configuration Options
The API offers two distinct timeout parameters through the `session.timeout` object to automatically manage browser session termination.
#### Idle Timeout
The `idle_timeout` parameter automatically terminates sessions after a period of inactivity. This timer starts after the last connection to the browser has disconnected, and any new connection will restart the timer. This includes live view sessions, CDP (Chrome DevTools Protocol) connections, and OS-level control connections.
The idle timeout is particularly useful for sessions with unknown length, allowing users to interact with browsers for as long as they need without keeping stale browsers alive unnecessarily. When set to `3` minutes for example, the session will terminate after 3 minutes with no active connections. The default value is `5` minutes, and you can disable automatic termination for idle sessions by setting it to `-1`.
#### Maximum Duration
The `max_duration` parameter sets a hard limit on total session lifetime. Unlike the idle timeout, this will automatically terminate the session after the specified duration regardless of activity level. This acts as a safety mechanism to ensure sessions don't run indefinitely.
The default maximum duration is `180` minutes (3 hours), but you can adjust this based on your needs. Setting `max_duration` to `10` will terminate the session after exactly 10 minutes, whether the browser is actively being used or not. There is no upper limit on how long you can set the maximum duration.
### Implementation Example
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
timeout: {
max_duration: 10, // 10 minutes hard limit
idle_timeout: 3 // 3 minutes of inactivity
}
}
}
});
console.log("Session created with timeout configuration:", session.data.id);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
session={
"timeout": {
"max_duration": 10, # 10 minutes hard limit
"idle_timeout": 3 # 3 minutes of inactivity
}
}
)
print("Session created with timeout configuration:", session.data.id)
```
In this example, replace `"your_api_key_here"` with your actual API key. The configuration sets a 10-minute hard session limit with `max_duration`, while `idle_timeout` ensures the session terminates after 3 minutes of no active connections. These two timeout mechanisms work independently, so the session will end when whichever condition is met first.
# Volumes
Source: https://docs.anchorbrowser.io/advanced/volumes
Persistent storage that follows your browser sessions
A volume is a folder your team owns that outlives any single browser session. Mount it into a session and everything the browser downloads is written to it; upload files to it beforehand and the browser can use them; read the results back through the API afterwards. Several sessions can mount the same volume at once and see each other's files immediately.
For the full endpoint list, see the interactive API documentation: [Volumes](/api-reference/volumes) for creating and managing volumes, and [Volume Files](/api-reference/volume-files) for the files inside them.
## How it works
* Files live under the volume root. The browser saves downloads into its `downloads/` folder, so a file downloaded in a session shows up as `downloads/` in the volume.
* Uploads through the API appear inside running sessions within seconds. Files written by a session appear in the API about a minute after the session stops writing to them.
* A volume can be mounted by any number of sessions, read-write or read-only.
**1. Create a volume**
```bash curl theme={null}
curl -X POST https://api.anchorbrowser.io/v1/volumes \
-H "anchor-api-key: $ANCHOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "customer-reports"}'
```
```javascript node.js theme={null}
const response = await fetch('https://api.anchorbrowser.io/v1/volumes', {
method: 'POST',
headers: { 'anchor-api-key': process.env.ANCHOR_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ name: 'customer-reports' }),
});
const { data: volume } = await response.json();
console.log(volume.id, volume.state); // state is "ready" when the volume can be used
```
```python python theme={null}
import os, requests
response = requests.post(
"https://api.anchorbrowser.io/v1/volumes",
headers={"anchor-api-key": os.environ["ANCHOR_API_KEY"]},
json={"name": "customer-reports"},
)
volume = response.json()["data"]
print(volume["id"], volume["state"]) # state is "ready" when the volume can be used
```
Names are unique within your team and may contain letters, numbers, `_` and `-`. If the response says `creating`, poll [get volume](/api-reference/volumes/get-volume) until it is `ready`.
**2. Upload files the browser should have (optional)**
Send a multipart request with the file and the destination `path`. Put files under `downloads/` if a page in the session will upload them.
```bash curl theme={null}
curl -X POST https://api.anchorbrowser.io/v1/volumes/$VOLUME_ID/files \
-H "anchor-api-key: $ANCHOR_API_KEY" \
-F "file=@./contract.pdf" \
-F "path=downloads/contract.pdf"
```
```javascript node.js theme={null}
import fs from 'fs';
const form = new FormData();
form.append('file', new Blob([fs.readFileSync('./contract.pdf')]), 'contract.pdf');
form.append('path', 'downloads/contract.pdf');
await fetch(`https://api.anchorbrowser.io/v1/volumes/${volumeId}/files`, {
method: 'POST',
headers: { 'anchor-api-key': process.env.ANCHOR_API_KEY },
body: form,
});
```
```python python theme={null}
with open("./contract.pdf", "rb") as f:
requests.post(
f"https://api.anchorbrowser.io/v1/volumes/{volume_id}/files",
headers={"anchor-api-key": os.environ["ANCHOR_API_KEY"]},
files={"file": ("contract.pdf", f)},
data={"path": "downloads/contract.pdf"},
)
```
> [!NOTE]
>
> Multipart uploads are limited to 10 MB. For larger files request a pre-signed URL with [create upload URL](/api-reference/volume-files/create-upload-url) and `PUT` the file to it, sending the returned headers unchanged.
**3. Start a session with the volume mounted**
Add `browser.volume` to the [session configuration](/api-reference/browser-sessions/start-browser-session).
```bash curl theme={null}
curl -X POST https://api.anchorbrowser.io/v1/sessions \
-H "anchor-api-key: $ANCHOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"browser": {"volume": {"id": "'$VOLUME_ID'"}}}'
```
```javascript node.js theme={null}
const session = await fetch('https://api.anchorbrowser.io/v1/sessions', {
method: 'POST',
headers: { 'anchor-api-key': process.env.ANCHOR_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
browser: {
volume: {
id: volumeId,
// read_only: true, // mount without write access
},
},
}),
}).then((r) => r.json());
```
```python python theme={null}
session = requests.post(
"https://api.anchorbrowser.io/v1/sessions",
headers={"anchor-api-key": os.environ["ANCHOR_API_KEY"]},
json={
"browser": {
"volume": {
"id": volume_id,
# "read_only": True, # mount without write access
}
}
},
).json()
```
The session starts once the volume is mounted, which adds a few seconds to session creation.
**4. Download in the browser**
Nothing changes in how you drive the browser. Any download lands in the volume's `downloads/` folder.
```tsx node.js theme={null}
await page.goto("https://browser-tests-alpha.vercel.app/api/download-test");
await Promise.all([page.waitForEvent("download"), page.locator("#download").click()]);
// The file is now in the volume as downloads/
```
```python python theme={null}
await page.goto("https://browser-tests-alpha.vercel.app/api/download-test")
async with page.expect_download():
await page.locator("#download").click()
# The file is now in the volume as downloads/
```
> [!NOTE]
>
> To download PDF files instead of viewing them in the browser, set `browser.pdf_viewer.active` to `false` when creating the session.
**5. Use a volume file in a web form**
Files under `downloads/` can be attached to a file input by their `/downloads/` path through CDP, whether they were uploaded through the API or downloaded by another session.
```tsx node.js theme={null}
await page.goto('https://browser-tests-alpha.vercel.app/api/upload-test');
const cdp = await page.context().newCDPSession(page);
const { root } = await cdp.send('DOM.getDocument');
const { nodeId } = await cdp.send('DOM.querySelector', { nodeId: root.nodeId, selector: '#fileUpload' });
await cdp.send('DOM.setFileInputFiles', { nodeId, files: ['/downloads/contract.pdf'] });
```
```python python theme={null}
await page.goto("https://browser-tests-alpha.vercel.app/api/upload-test")
cdp = await page.context.new_cdp_session(page)
root = await cdp.send("DOM.getDocument")
node = await cdp.send("DOM.querySelector", {"nodeId": root["root"]["nodeId"], "selector": "#fileUpload"})
await cdp.send("DOM.setFileInputFiles", {"nodeId": node["nodeId"], "files": ["/downloads/contract.pdf"]})
```
**6. Read the results after the session**
List the folder, then fetch a file through its pre-signed URL.
```bash curl theme={null}
curl "https://api.anchorbrowser.io/v1/volumes/$VOLUME_ID/files?path=downloads" \
-H "anchor-api-key: $ANCHOR_API_KEY"
# Follow the redirect straight to the file
curl -L "https://api.anchorbrowser.io/v1/volumes/$VOLUME_ID/files/download?path=downloads/report.pdf&redirect=true" \
-H "anchor-api-key: $ANCHOR_API_KEY" -o report.pdf
```
```javascript node.js theme={null}
const headers = { 'anchor-api-key': process.env.ANCHOR_API_KEY };
const base = `https://api.anchorbrowser.io/v1/volumes/${volumeId}`;
const { data: listing } = await fetch(`${base}/files?path=downloads`, { headers }).then((r) => r.json());
console.log(listing.items); // [{ path: 'downloads/report.pdf', type: 'file', size: 142786, ... }]
const { data: link } = await fetch(`${base}/files/download?path=downloads/report.pdf`, { headers }).then((r) => r.json());
const file = await fetch(link.signed_url); // no API key needed; the URL expires after link.expires_in seconds
```
```python python theme={null}
headers = {"anchor-api-key": os.environ["ANCHOR_API_KEY"]}
base = f"https://api.anchorbrowser.io/v1/volumes/{volume_id}"
listing = requests.get(f"{base}/files", headers=headers, params={"path": "downloads"}).json()["data"]
print(listing["items"]) # [{"path": "downloads/report.pdf", "type": "file", "size": 142786, ...}]
link = requests.get(f"{base}/files/download", headers=headers, params={"path": "downloads/report.pdf"}).json()["data"]
pdf = requests.get(link["signed_url"]).content # no API key needed; the URL expires after link["expires_in"] seconds
```
Files written by a session become visible here about a minute after the session stops writing to them, so poll the listing if the session just finished.
## Sharing a volume between sessions
Sessions that mount the same volume share it live: a file downloaded in one session can be used in another a few seconds later, without going through the API. Mount the volume read-only in sessions that should only consume files.
## Managing volumes
| Action | Endpoint |
| - | - |
| List your volumes | `GET /v1/volumes` (returns `{ count, items }`) |
| Get one by ID or name | `GET /v1/volumes/{volume_id}`, `GET /v1/volumes/by-name/{name}` |
| List a folder or the whole tree | `GET /v1/volumes/{volume_id}/files?path=&recursive=true`. Pass the previous `next_cursor` as `cursor`. |
| File metadata | `GET /v1/volumes/{volume_id}/files/stat?path=` |
| Create a folder | `POST /v1/volumes/{volume_id}/directories` |
| Delete a file or a folder | `DELETE /v1/volumes/{volume_id}/files?path=` or `?prefix=&recursive=true` |
| Delete the volume and its files | `DELETE /v1/volumes/{volume_id}` |
Deleting a volume is refused while a running session has it mounted; end those sessions first.
## Limits
* Up to 10 volumes per team.
* One volume per session.
* Multipart uploads up to 10 MB; pre-signed uploads up to 5 GB.
* Paths are relative to the volume root and cannot contain `..`.
* Volumes are not available for [batch sessions](/advanced/batch-browser-sessions).
# Web Unlocker
Source: https://docs.anchorbrowser.io/advanced/web-unlocker
Fetch fully rendered HTML from any URL — including CAPTCHA- and bot-protected sites — with a single API call. No browser session, no proxy setup, billed only on success.
Anchor Web Unlocker is a sessionless retrieval API. You send a URL; Anchor loads it in a stealth browser behind a residential proxy, solves any CAPTCHA or bot-detection challenge it encounters, and returns the rendered HTML. It is the fastest way to get page content from sites that block plain HTTP clients, and it requires none of the session lifecycle management that a full browser does.
> [card] Automatic CAPTCHA solving
>
> Cloudflare, reCAPTCHA, FunCaptcha, DataDome, Kasada, Akamai and PerimeterX (HUMAN) challenges are solved automatically. You receive the page behind the challenge, not the interstitial.
> [card] Residential proxies and stealth built in
>
> Every request egresses through a residential IP with a randomized, consistent browser fingerprint. Nothing to configure.
> [card] Full JavaScript rendering
>
> Pages are loaded in real Chromium, so client-side rendered content, lazy-loaded sections and consent dialogs are handled before the HTML is captured.
> [card] Pay only for successful fetches
>
> Only `200` responses are billed. Requests that fail with a `4xx` or `5xx` cost nothing.
## Quick start
```javascript node.js theme={null}
import { client, Tools } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const html = await Tools.fetchWebpage({
body: {
url: 'https://www.g2.com/products/notion/reviews',
},
});
console.log(html);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
html = anchor_client.tools.fetch_webpage(
url='https://www.g2.com/products/notion/reviews',
)
print(html)
```
```bash curl theme={null}
curl --request POST \
--url https://api.anchorbrowser.io/v1/tools/fetch/webpage \
--header "anchor-api-key: $ANCHOR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"url": "https://www.g2.com/products/notion/reviews"}'
```
## What Web Unlocker handles for you
| Obstacle | Result |
| - | - |
| Bot detection and IP reputation | Requests arrive from residential IPs with a real browser fingerprint. |
| CAPTCHAs and challenge pages | Cloudflare, reCAPTCHA, FunCaptcha, DataDome, Kasada, Akamai and PerimeterX (HUMAN) challenges are solved automatically. You receive the page behind the challenge, never the interstitial. |
| Client-side rendering | JavaScript runs to completion in real Chromium, so SPAs, lazy-loaded sections and hydrated content are present in the HTML. |
| Cookie-consent banners | Consent dialogs are dismissed before the page is captured. |
| Non-HTML targets | PDFs, file downloads, JSON and XML are returned as-is with their original content type. |
| Infrastructure | No browser to start, connect to, or close. Requests do not count against your concurrent-browser limit. |
You send a URL and receive the rendered HTML. Everything in the table above happens inside the request.
## API reference
**Endpoint:** `POST https://api.anchorbrowser.io/v1/tools/fetch/webpage`
**Headers**
| Header | Value |
| - | - |
| `anchor-api-key` | Your API key |
| `Content-Type` | `application/json` |
**Body**
**url** `string` *required*
The fully-qualified URL to fetch, including the scheme (e.g. `https://www.linkedin.com/company/openai`).
**options** `object`
Optional retrieval settings.
**properties**
**return\_partial\_on\_timeout** `boolean` (default: true)
When a page is still loading at the deadline, return the content rendered so far instead of failing. Set to `false` to receive a `504` instead of partial content.
**Response**
A successful request returns `200` with the page body directly — not wrapped in JSON.
| Target | `Content-Type` | Body |
| - | - | - |
| HTML page | `text/html; charset=utf-8` | Rendered HTML after JavaScript execution |
| PDF | `application/pdf` | The file bytes, with `Content-Disposition: attachment` |
| File download (CSV, XLSX, ZIP, …) | `text/csv` or `application/octet-stream` | The file bytes, with `Content-Disposition: attachment` |
| JSON, XML or plain-text resource | The upstream content type | The response body unchanged |
**Error codes**
Errors are returned as JSON: `{ "error": "" }`. The exception is `429`, which uses the platform-wide shape `{ "error": { "code": 429, "message": "" } }`.
| Code | Meaning | Retry? |
| - | - | - |
| `400` | Invalid request — check the URL | No |
| `402` | Insufficient credits balance | After topping up |
| `403` | Project cost limit reached | After raising the limit |
| `422` | Could not reach the URL, DNS failed, or the challenge could not be solved | Once, after a short delay |
| `429` | Rate limit exceeded | With exponential backoff |
| `500` | Failed to fetch the requested page | With exponential backoff |
| `503` | Service temporarily unavailable | With exponential backoff |
| `504` | The page took too long to load | Once, or enable `return_partial_on_timeout` |
## Limits and timeouts
| | Value |
| - | - |
| Rate limit | 2,000 requests per minute per API key by default. Higher limits are available on request. |
| Concurrency | Not tied to your plan's concurrent-browser limit. |
| Request duration | Typically a few seconds. Pages that present a CAPTCHA take longer because the challenge is solved before the response is returned. Requests are capped at about two minutes; configure client timeouts of at least 120 seconds. |
| Proxy geography | Residential, automatically selected. For a specific country or a sticky IP, use a [browser session with proxy configuration](/advanced/proxy). |
## Pricing
Web Unlocker is billed per `200` response: **0.005 credits per fetch**, or \*\*$0.005** at the standard $1 per credit. 1,000 pages cost \$5. Requests that fail with a `4xx` or `5xx` are not billed, and no browser-hour or proxy-bandwidth charges apply. See [Pricing](/pricing) for plan details and credit rates.
## Examples
### Fetch a bot-protected page
```javascript node.js theme={null}
import { client, Tools } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const html = await Tools.fetchWebpage({
body: {
url: 'https://www.indeed.com/jobs?q=software+engineer&l=New+York',
},
});
console.log(html);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
html = anchor_client.tools.fetch_webpage(
url='https://www.indeed.com/jobs?q=software+engineer&l=New+York',
)
print(html)
```
### Fetch many pages in parallel
Requests are independent, so fan them out. Keep total throughput under your per-minute rate limit and back off on `429`.
```javascript node.js theme={null}
import { client, Tools } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const urls = [
'https://www.crunchbase.com/organization/openai',
'https://www.crunchbase.com/organization/anthropic',
'https://www.crunchbase.com/organization/mistral-ai',
];
const pages = await Promise.all(
urls.map((url) => Tools.fetchWebpage({ body: { url } })),
);
pages.forEach((html, index) => {
console.log(urls[index], html.slice(0, 200));
});
```
```python python theme={null}
import os
from concurrent.futures import ThreadPoolExecutor
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
urls = [
'https://www.crunchbase.com/organization/openai',
'https://www.crunchbase.com/organization/anthropic',
'https://www.crunchbase.com/organization/mistral-ai',
]
with ThreadPoolExecutor(max_workers=10) as pool:
pages = list(pool.map(lambda url: anchor_client.tools.fetch_webpage(url=url), urls))
for url, html in zip(urls, pages):
print(url, html[:200])
```
### Call the HTTP API directly with retries
Read the body as text on success; the endpoint returns HTML, not a JSON envelope. Retry `429`, `500`, `503` and `504` with exponential backoff and treat everything else as terminal.
```javascript node.js theme={null}
const RETRYABLE = new Set([429, 500, 503, 504]);
async function unlock(url, { attempts = 3 } = {}) {
for (let attempt = 1; attempt <= attempts; attempt++) {
const response = await fetch('https://api.anchorbrowser.io/v1/tools/fetch/webpage', {
method: 'POST',
headers: {
'anchor-api-key': process.env.ANCHOR_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({ url }),
signal: AbortSignal.timeout(120_000),
});
if (response.ok) {
return response.text();
}
const { error } = await response.json().catch(() => ({ error: response.statusText }));
const message = typeof error === 'string' ? error : error?.message ?? response.statusText;
if (!RETRYABLE.has(response.status) || attempt === attempts) {
throw new Error(`Web Unlocker ${response.status}: ${message}`);
}
await new Promise((resolve) => setTimeout(resolve, 1000 * 2 ** (attempt - 1)));
}
}
const html = await unlock('https://example.com');
```
```python python theme={null}
import os
import time
import requests
RETRYABLE = {429, 500, 503, 504}
def unlock(url: str, attempts: int = 3) -> str:
for attempt in range(1, attempts + 1):
response = requests.post(
'https://api.anchorbrowser.io/v1/tools/fetch/webpage',
headers={
'anchor-api-key': os.environ['ANCHOR_API_KEY'],
'Content-Type': 'application/json',
},
json={'url': url},
timeout=120,
)
if response.ok:
return response.text
try:
error = response.json().get('error', response.reason)
message = error if isinstance(error, str) else error.get('message', response.reason)
except ValueError:
message = response.reason
if response.status_code not in RETRYABLE or attempt == attempts:
raise RuntimeError(f'Web Unlocker {response.status_code}: {message}')
time.sleep(2 ** (attempt - 1))
html = unlock('https://example.com')
```
### Fail fast instead of returning partial content
By default, a page that is still loading at the deadline is returned with whatever has rendered so far. When you need complete pages or nothing, disable partial returns and handle the `504`.
```bash curl theme={null}
curl --request POST \
--url https://api.anchorbrowser.io/v1/tools/fetch/webpage \
--header "anchor-api-key: $ANCHOR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"url": "https://example.com/heavy-page",
"options": { "return_partial_on_timeout": false }
}'
```
### Download a PDF
PDF URLs are returned as the file itself. Save the response body to disk rather than reading it as text.
```javascript node.js theme={null}
import { writeFile } from 'node:fs/promises';
const response = await fetch('https://api.anchorbrowser.io/v1/tools/fetch/webpage', {
method: 'POST',
headers: {
'anchor-api-key': process.env.ANCHOR_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({ url: 'https://arxiv.org/pdf/1706.03762' }),
});
if (!response.ok) {
throw new Error(`Web Unlocker ${response.status}: ${await response.text()}`);
}
await writeFile('attention.pdf', Buffer.from(await response.arrayBuffer()));
```
```python python theme={null}
import os
import requests
response = requests.post(
'https://api.anchorbrowser.io/v1/tools/fetch/webpage',
headers={'anchor-api-key': os.environ['ANCHOR_API_KEY']},
json={'url': 'https://arxiv.org/pdf/1706.03762'},
timeout=120,
)
response.raise_for_status()
with open('attention.pdf', 'wb') as f:
f.write(response.content)
```
## Choosing the right tool
| | Web Unlocker | Browser session | Anchor proxy | AI task (`perform-web-task`) |
| - | - | - | - | - |
| Input | One URL | Session + CDP / Playwright / Puppeteer | Your own HTTP client or browser | Natural-language goal |
| Output | Rendered HTML (or file) | Full interactive browser | Network egress only | Structured result |
| CAPTCHA solving | Automatic | Optional, [configurable](/advanced/captcha-solving) | None | Automatic when enabled |
| Setup | None | Create and close a session | Configure proxy credentials | None |
| State across requests | None | Cookies, logins, tabs persist | None | Within the task |
| Cold start | None | Session startup time | None | Session startup time |
| Billing | Per successful request | Per session and browser-hour | Per GB | Per task and AI step |
| Best for | High-volume scraping, one-shot fetches, RAG ingestion, monitoring | Logins, forms, multi-step flows, anything that needs clicks | Adding residential IPs to an existing stack | Goal-driven automation without writing selectors |
Use **Web Unlocker** when the deliverable is the content of a URL. Use a [**browser session**](/quickstart/browser-sessions) when the workflow has to navigate, click, submit forms, authenticate, or keep state between steps. Use the [**Anchor proxy**](/proxy-integration/quickstart) when you already run your own browser fleet and only need residential routing. Use an [**AI task**](/agentic-browser-control/ai-task-completion) when you want to describe the outcome rather than script the steps.
These compose well: fetch listing pages in bulk with Web Unlocker, then open a session only for the pages that require an authenticated action.
## FAQ
> [accordion] Does Web Unlocker solve CAPTCHAs?
>
> Yes. Cloudflare, reCAPTCHA, FunCaptcha, DataDome, Kasada, Akamai and PerimeterX (HUMAN) challenges are solved automatically and you receive the page behind them. If a challenge is detected but cannot be solved, the request fails with `422` and is not billed. This applies to challenges that replace the page (a Cloudflare interstitial, a DataDome, Kasada, Akamai or PerimeterX block page). A widget rendered inside a page that already loaded — a reCAPTCHA or hCaptcha form, or a PerimeterX Press & Hold gating a search or a login — never delays or fails the request: you receive that page as served.
> [accordion] Does it execute JavaScript?
>
> Yes. Pages are rendered in real Chromium. The HTML you receive reflects the DOM after client-side rendering, not the initial server response.
> [accordion] Do I need to create a browser session first?
>
> No. Web Unlocker is sessionless. There is no browser to create, connect to, or close, no cold start, and requests do not count against your concurrent-browser limit.
> [accordion] Can I choose the proxy country or use a sticky IP?
>
> Not on this endpoint — proxies are residential and selected automatically. For country targeting, sticky IPs, or your own proxy, use a [browser session with proxy configuration](/advanced/proxy).
> [accordion] Am I charged for failed requests?
>
> Only `200` responses are billed; any `4xx` or `5xx` is free. Unreachable hosts (`422`), unsolved challenges (`422`), rate limits (`429`) and timeouts (`504`) therefore cost nothing.
> [accordion] Can I get Markdown or structured data instead of HTML?
>
> Web Unlocker returns raw HTML so you can run your own extraction. For LLM-ready Markdown or structured extraction from a rendered page, use the [session tools](/essentials/control-a-session) or an [AI task](/agentic-browser-control/ai-task-completion).
> [accordion] What are the acceptable-use requirements?
>
> Use Web Unlocker only for websites and data you are authorized to access, and in compliance with the target site's terms and applicable law. See [Security](/security) for Anchor's compliance posture.
# CrewAI
Source: https://docs.anchorbrowser.io/agent-frameworks/crewai
AI agents can leverage browser sessions to complete tasks in the web. The ways to use the browser in CrewAI agent platform are:
* **As a Flexible Browser Tool**: Enable the CrewAI agent to explore the web freely using a general-purpose browser tool.
* **As a Specific-Flow Tool Defined in CrewAI**: Create custom tools by writing CrewAI code to define specific workflows tailored to your needs.
* **As an Automation Task defined in Anchor Browser**: Define tasks using the Anchor platform, which CrewAI agents can run through the Tasks API.
## Quick start - Use Anchor Browser as a flexible browser tool
You can connect your CrewAI agent directly to Anchor Browser, allowing it to use browser sessions for various tasks, leveraging the power of browser automation without the need for complex integration code. Below is a quick guide to setting up and using Anchor Browser as a tool for your CrewAI agent.
> [accordion] Code example - Use Anchor Browser as a flexible browser tool
>
> ```python python theme={null}
> import os
> from anchorbrowser import Anchorbrowser
> from crewai import Agent, Task, Crew
>
> ANCHOR_API_KEY = os.getenv("ANCHOR_API_KEY")
>
> # Create an Anchor Browser tool for CrewAI
> class AnchorBrowserTool:
> def __init__(self):
> self.anchor_client = Anchorbrowser(api_key=ANCHOR_API_KEY)
>
> def browse_and_extract(self, url, task_description):
> # Create a browser session
> session = self.anchor_client.sessions.create_session(
> session={
> "timeout": {
> "max_duration": 30,
> "idle_timeout": 10
> }
> }
> )
> session_id = session.data.id
>
> try:
> # Use the agent to perform the task
> result = self.anchor_client.agent.task(
> task_description,
> session_id=session_id,
> task_options={"url": url}
> )
> return result
> finally:
> # Clean up
> self.anchor_client.sessions.delete_session(session_id)
>
> # Initialize the tool
> browser_tool = AnchorBrowserTool()
>
> # Create a CrewAI agent that uses Anchor Browser
> researcher = Agent(
> role='Web Researcher',
> goal='Research and extract information from websites',
> backstory='Expert at gathering information from web sources',
> tools=[browser_tool.browse_and_extract],
> verbose=True
> )
>
> # Create a task
> research_task = Task(
> description='Go to news.ycombinator.com and extract the title of the first story',
> agent=researcher
> )
>
> # Create and run the crew
> crew = Crew(
> agents=[researcher],
> tasks=[research_task],
> verbose=True
> )
>
> result = crew.kickoff()
> print(result)
> ```
>
> ```javascript node.js theme={null}
> const { client, Sessions, agentTask } = require("anchorbrowser");
> const { Agent, Task, Crew } = require("crewai");
>
> class AnchorBrowserTool {
> constructor() {
> client.setConfig({
> auth: () => process.env.ANCHOR_API_KEY,
> });
> }
>
> async browseAndExtract(url, taskDescription) {
> // Create a browser session
> const session = await Sessions.createSession({
> body: {
> session: {
> max_duration: 30,
> idle_timeout: 10
> }
> }
> });
>
> try {
> // Use the agent to perform the task
> const result = await agentTask(
> taskDescription,
> { sessionId: session.data.id }
> );
> return result;
> } finally {
> // Clean up
> await Sessions.deleteSession({ path: { session_id: session.data.id } });
> }
> }
> }
>
> // Initialize the tool
> const browserTool = new AnchorBrowserTool();
>
> // Create a CrewAI agent that uses Anchor Browser
> const researcher = new Agent({
> role: 'Web Researcher',
> goal: 'Research and extract information from websites',
> backstory: 'Expert at gathering information from web sources',
> tools: [browserTool.browseAndExtract.bind(browserTool)],
> verbose: true
> });
>
> // Create a task
> const researchTask = new Task({
> description: 'Go to news.ycombinator.com and extract the title of the first story',
> agent: researcher
> });
>
> // Create and run the crew
> const crew = new Crew({
> agents: [researcher],
> tasks: [researchTask],
> verbose: true
> });
>
> const result = await crew.kickoff();
> console.log(result);
> ```
## Use Anchor Browser as a specific-flow tool defined in CrewAI
CrewAI can integrate closely with Anchor Browser to define tools for particular workflows. For example, if you need a customized process to interact with an authenticated application, you can create that flow as a reusable tool that CrewAI agents can use for automation.
Here is an example of creating a specific workflow tool using Anchor Browser that can be utilized by CrewAI to automate targeted tasks.
> [accordion] Code example - Use Anchor Browser as a specific-flow tool defined in CrewAI
>
> ```python python theme={null}
>
> import crewai
> from playwright.sync_api import sync_playwright
>
> ANCHOR_API_KEY = "YOUR_ANCHOR_API_KEY" # Replace with your actual API key
>
> # Register Anchor Browser as a specific application tool in CrewAI
> class AnchorSpecificTool(crewai.Tool):
> name = "SpecificAnchorTool"
> description = "Custom tool for interacting with a specific application."
>
> def __init__(self):
> super().__init__()
>
> anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
> with sync_playwright() as p:
> # Create a browser session
> session = anchor_client.sessions.create_session()
> cdp_url = session.data.cdp_url
>
> # Connect to Anchor Browser session
> browser = p.chromium.connect_over_cdp(cdp_url)
> page = browser.new_page()
> page.goto(command['url'])
>
> # Perform specific actions based on command
> if command.get('action') == 'extract':
> result = page.text_content(command['selector'])
> browser.close()
> return result
>
> browser.close()
>
> # Add custom AnchorBrowserTool to CrewAI agent
> my_agent = crewai.Agent(name="Web Automation Agent")
> my_agent.add_tool(AnchorSpecificTool())
>
> # Use the agent to perform a specific task
> result = my_agent.act({
> 'tool': 'SpecificAnchorTool',
> 'command': {
> 'url': 'https://example.com',
> 'action': 'extract',
> 'selector': 'body'
> }
> })
>
> print(result)
> ```
>
> ```jsx node.js theme={null}
> const { chromium } = require('playwright-core');
> const { client, Sessions } = require('anchorbrowser');
> const crewai = require('crewai');
>
> // Define a custom specific-flow tool in CrewAI that uses Anchor Browser
> class AnchorSpecificTool {
> name = "SpecificAnchorTool";
> description = "Custom tool for interacting with a specific application.";
>
> async run(command) {
> client.setConfig({
> auth: () => process.env.ANCHOR_API_KEY,
> });
>
> // Create a browser session
> const session = await Sessions.createSession();
> const cdp_url = session.data.cdp_url;
>
> // Connect to Anchor Browser session
> const browser = await chromium.connectOverCDP(cdp_url);
>
> const page = await browser.newPage();
> await page.goto(command.url);
>
> // Perform specific actions based on the command
> if (command.action === 'extract') {
> const result = await page.textContent(command.selector);
> await browser.close();
> return result;
> }
>
> await browser.close();
> }
> }
>
> // Create a CrewAI agent and add the custom specific-flow Anchor Browser tool
> const agent = new crewai.Agent({ name: "Web Automation Agent" });
> const anchorSpecificTool = new AnchorSpecificTool();
> agent.addTool(anchorSpecificTool);
>
> // Use the tool through the CrewAI agent
> const result = await agent.act({
> tool: 'SpecificAnchorTool',
> command: {
> url: 'https://example.com',
> action: 'extract',
> selector: 'body'
> }
> });
>
> console.log(result);
> ```
# Custom Integration
Source: https://docs.anchorbrowser.io/agent-frameworks/custom-agent-framework
Anchor Browser enables integration with custom AI frameworks to empower agents with the ability to navigate and interact with the web effectively. You can leverage browser sessions within your own custom AI framework to automate workflows, explore the web, or interact with web content dynamically.
The integration methods for a custom AI framework include:
* **As a Flexible Browser Tool**: Utilize Anchor Browser as a general-purpose browser tool that allows your AI agent to freely explore the web and perform dynamic interactions.
* **As a Specific-Flow Tool Defined in Your Custom Framework**: Create reusable, custom tools in your AI framework to handle specific workflows or sequences of interactions.
* **As an Automation Task defined in Anchor Browser**: Define tasks on the Anchor platform and invoke them from your custom AI framework through the Tasks API.
## Quick Start - Use Anchor Browser as a Flexible Browser Tool
Your custom AI framework can directly integrate with Anchor Browser, allowing your agent to interact with the web dynamically. Below is an example of how you can connect your custom AI framework to Anchor Browser, enabling the agent to perform various tasks.
> [accordion] Code example - Use Anchor Browser as a flexible browser tool
>
> ```python python theme={null}
> import requests
> from playwright.sync_api import sync_playwright
>
> ANCHOR_API_KEY = "YOUR_ANCHOR_API_KEY" # Replace with your actual API key
>
> # Define a function to use Anchor Browser as a tool for web-based tasks
> def use_anchor_browser(command):
> with sync_playwright() as p:
> # Connect to Anchor Browser session
> browser = p.chromium.connect_over_cdp(
> f"wss://connect.anchorbrowser.io?apiKey={ANCHOR_API_KEY}"
> )
> page = browser.new_page()
> page.goto(command['url'])
>
> # Perform specific actions as needed
> if command.get('action') == 'search':
> page.fill(command['search_box'], command['search_text'])
> page.click(command['search_button'])
>
> # Extract and return data if needed
> result = page.content()
>
> browser.close()
> return result
>
> # Example usage in your custom AI framework
> command = {
> 'url': 'https://example.com',
> 'action': 'search',
> 'search_box': 'input[name="q"]',
> 'search_text': 'Anchor Browser',
> 'search_button': 'button[type="submit"]'
> }
>
> result = use_anchor_browser(command)
> print(result)
> ```
>
> ```jsx node.js theme={null}
> import { chromium } from 'playwright-core';
>
> const ANCHOR_API_KEY = process.env.ANCHOR_API_KEY; // Replace with your actual API key stored in environment variables
>
> // Define a function to use Anchor Browser as a tool for web-based tasks
> async function useAnchorBrowser(command) {
> // Connect to Anchor Browser session
> const browser = await chromium.connectOverCDP(
> `wss://connect.anchorbrowser.io?apiKey=${ANCHOR_API_KEY}`
> );
>
> const page = await browser.newPage();
> await page.goto(command.url);
>
> // Perform specific actions as needed
> if (command.action === 'search') {
> await page.fill(command.search_box, command.search_text);
> await page.click(command.search_button);
> }
>
> // Extract and return data if needed
> const result = await page.content();
>
> await browser.close();
> return result;
> }
>
> // Example usage in your custom AI framework
> const command = {
> url: 'https://example.com',
> action: 'search',
> search_box: 'input[name="q"]',
> search_text: 'Anchor Browser',
> search_button: 'button[type="submit"]'
> };
>
> const result = await useAnchorBrowser(command);
> console.log(result);
> ```
## Use Anchor Browser as a Specific-Flow Tool Defined in a Custom Framework
Anchor Browser can also be integrated into your custom AI framework to create specific workflow tools. These tools can handle specialized tasks that your agent needs to perform repeatedly, providing consistency and reducing the need for writing duplicate code.
Here is an example of creating a specific tool using Anchor Browser that can be utilized by your custom AI framework for automating targeted tasks.
> [accordion] Code example - Use Anchor Browser as a specific-flow tool in a custom AI framework
>
> ```python python theme={null}
> import requests
> from playwright.sync_api import sync_playwright
>
> ANCHOR_API_KEY = "YOUR_ANCHOR_API_KEY" # Replace with your actual API key
>
> # Define a custom tool for interacting with a specific web application
> def specific_anchor_tool(command):
> with sync_playwright() as p:
> # Connect to Anchor Browser session
> browser = p.chromium.connect_over_cdp(
> f"wss://connect.anchorbrowser.io?apiKey={ANCHOR_API_KEY}"
> )
> page = browser.new_page()
> page.goto(command['url'])
>
> # Perform specific actions based on the command
> if command.get('action') == 'extract':
> result = page.text_content(command['selector'])
> browser.close()
> return result
>
> browser.close()
>
> # Example usage in your custom AI framework
> command = {
> 'url': 'https://example.com',
> 'action': 'extract',
> 'selector': '#data'
> }
>
> result = specific_anchor_tool(command)
> print(result)
> ```
>
> ```jsx node.js theme={null}
> import { chromium } from 'playwright-core';
>
> const ANCHOR_API_KEY = process.env.ANCHOR_API_KEY; // Replace with your actual API key stored in environment variables
>
> // Define a custom specific-flow tool for interacting with a specific web application
> async function specificAnchorTool(command) {
> // Connect to Anchor Browser session
> const browser = await chromium.connectOverCDP(
> `wss://connect.anchorbrowser.io?apiKey=${ANCHOR_API_KEY}`
> );
>
> const page = await browser.newPage();
> await page.goto(command.url);
>
> // Perform specific actions based on the command
> if (command.action === 'extract') {
> const result = await page.textContent(command.selector);
> await browser.close();
> return result;
> }
>
> await browser.close();
> }
>
> // Example usage in your custom AI framework
> const command = {
> url: 'https://example.com',
> action: 'extract',
> selector: '#data'
> };
>
> const result = await specificAnchorTool(command);
> console.log(result);
> ```
# LangChain
Source: https://docs.anchorbrowser.io/agent-frameworks/langchain
AI agents can leverage browser sessions to complete tasks on the web using LangChain, a framework that provides easy integration for AI-driven workflows.
Anchor provides [LangChain tools](https://python.langchain.com/docs/integrations/tools/anchor_browser/) that allows you to use Anchor Browser as a tool in your LangChain workflows.
The package contains the following tools:
* `AnchorContentTool`: Get the content of a web page in markdown format.
* `AnchorScreenshotTool`: Take a screenshot of a web page.
* `AnchorWebTaskTools`: Perform intelligent web tasks using AI:
* Simple - `SimpleAnchorWebTaskTool`
* Advanced - `AdvancedAnchorWebTaskTool`
See Anchor Browser package for LangChain on [PyPi](https://pypi.org/project/langchain-anchorbrowser/) for more information.
## Quickstart
### Installation
Install the `langchain-anchorbrowser` package:
```bash theme={null}
pip install langchain-anchorbrowser
```
### Usage
Import and utilize your intended tool. The full list of Anchor Browser available tools see **Tool Features** table in [Anchor Browser tool page](/docs/integrations/tools/anchor_browser)
```python theme={null}
from langchain_anchorbrowser import AnchorContentTool
# Get Markdown Content for https://www.anchorbrowser.io
AnchorContentTool().invoke(
{"url": "https://www.anchorbrowser.io", "format": "markdown"}
)
```
## Additional Resources
* [PyPi](https://pypi.org/project/langchain-anchorbrowser)
* [Github](https://github.com/anchorbrowser/langchain-anchorbrowser)
* [Anchor Browser Docs on LangChain](https://python.langchain.com/docs/integrations/tools/anchor_browser/)
# Agentic File Usage
Source: https://docs.anchorbrowser.io/agentic-browser-control/agentic-file-usage
Upload ZIP files to browser sessions for AI agents to use
> [!WARNING]
>
> **Compatibility Note**: Only works with the `browser-use` agent. Not supported with `openai-cua`, `gemini-computer-use`, and `anthropic-cua`.
## Quick Start
Upload a ZIP file containing resources that your AI agent can use to complete tasks. The ZIP file is automatically extracted and made available to the agent.
## Example: Upload ZIP File
```javascript node.js theme={null}
import { client, Sessions, Agent, agentTask } from 'anchorbrowser';
import JSZip from 'jszip';
const ANCHOR_API_KEY = process.env.ANCHOR_API_KEY;
// Initialize Anchor client
client.setConfig({ auth: () => ANCHOR_API_KEY });
// Create a new session
const session = await Sessions.createSession();
console.log('session live view url:', session.data?.live_view_url);
const sessionId = session.data?.id;
// 1. Create a test ZIP file with content
const zip = new JSZip();
zip.file('test.txt', 'Hello from Anchor!\nThis is a test file for the agent.');
const zipBlob = await zip.generateAsync({ type: 'blob' });
const zipFile = new File([zipBlob], 'test-data.zip', { type: 'application/zip' });
console.log(`Uploading file to session...`);
// 2. Upload to browser session
const fileUploadResult = await Agent.uploadAgentFiles({
path: { sessionId: sessionId! },
body: { file: zipFile }
});
console.log('Upload result:', fileUploadResult);
// 3. Use uploaded files with AI agent
const result = await agentTask('upload a file to the server', {
taskOptions: {
url: 'https://v0-download-and-upload-text.vercel.app/',
},
sessionId: sessionId
});
console.log('AI agent result:', result);
```
```python python theme={null}
import os
import zipfile
import tempfile
from anchorbrowser import Anchorbrowser
ANCHOR_API_KEY = os.getenv("ANCHOR_API_KEY")
# Initialize Anchor client
anchor_client = Anchorbrowser(api_key=ANCHOR_API_KEY)
# Create a new session
session = anchor_client.sessions.create_session()
print('session live view url:', session.data.live_view_url)
session_id = session.data.id
# 1. Create a test ZIP file with content
with tempfile.NamedTemporaryFile(suffix='.zip', delete=False) as temp_zip:
with zipfile.ZipFile(temp_zip.name, 'w') as zip_file:
zip_file.writestr('test.txt', 'Hello from Anchor!\nThis is a test file for the agent.')
# 2. Upload to browser session
with open(temp_zip.name, 'rb') as zip_file:
result = anchor_client.agent.upload_agent_files(
session_id=session_id,
file=zip_file
)
# Clean up temporary file
os.unlink(temp_zip.name)
print('Upload result:', result)
# 3. Use uploaded files with AI agent
result = anchor_client.agent.task('upload a file to the server',
task_options={
"url": 'https://v0-download-and-upload-text.vercel.app/',
},
session_id=session_id,
)
print('AI agent result:', result)
```
That's it! The agent can now access all uploaded files and use them to complete web tasks.
# Perform Web Task
Source: https://docs.anchorbrowser.io/agentic-browser-control/ai-task-completion
Run natural-language browser tasks with the perform-web-task API and agentTask SDK method.
Anchor Browser delivers a state-of-the-art 89% Score on the industry-standard benchmark WebVoyager, leveraging browser-use as a core component of the automation capability.
## The agent task method
Anchor Browser provides within its SDK the `agentTask` method that enables natural language control over web browsing sessions. This capability allows you to **automate complex web tasks without coding the whole flow.**
> [!NOTE]
>
> Looking for versioned reusable workflows? See [Creating a Task](/tasks/creating-a-task) and [Run a Task](/tasks/run-a-task).
`POST /v1/tools/perform-web-task` does not read an `Idempotency-Key`. Sending the request again starts another task.
### Code Example
```javascript node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const response = await agentTask('Extract the main heading', {
taskOptions: { url: 'https://example.com' },
});
console.log(response.data.result);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
response = anchor_client.agent.task(
"Extract the main heading",
task_options={"url": "https://example.com"},
)
print(response.data.result)
```
The prompt is the only required argument — add `url` (or `sessionId`) to point the agent at a page.
Everything else (agent, model, provider, max steps, secret values, …) is optional; see
[Configuration Options](#configuration-options) below.
## Structured Output
The AI object can also be used to extract structured data from the browser. This is done by providing a **JSON schema** to the AI object, which will then return the structured data.
The following demonstrates using **Zod** and **Pydantic** to utilize the structured output capability.
```javascript node.js theme={null}
import { z } from 'zod';
import { zodToJsonSchema } from 'zod-to-json-schema';
import { agentTask } from 'anchorbrowser';
// Define the expected output structure using Zod schema
const outputSchema = z.object({
nodes_cpu_usage: z.array(
z.object({
node: z.string(), // Node name
cluster: z.string(), // Cluster identifier
cpu_avg_percentage: z.number(), // CPU usage percentage
})
)
});
// Execute the AI task with structured output
const result = await agentTask('Collect the node names and their CPU average %', {
taskOptions: {
outputSchema: zodToJsonSchema(outputSchema), // Convert to JSON Schema
url: 'https://play.grafana.org/a/grafana-k8s-app/navigation/nodes?from=now-1h&to=now&refresh=1m',
}
});
console.info(result);
```
```python python theme={null}
# Define data models using Pydantic for structured output
class NodeCpuUsage(BaseModel):
node: str # Node name
cluster: str # Cluster identifier
cpu_avg_percentage: float # CPU usage percentage
class OutputSchema(BaseModel):
nodes_cpu_usage: List[NodeCpuUsage] # List of node CPU usage data
# Create task payload with structured output schema
task_payload = {
'prompt': 'Collect the node names and their CPU average %',
'output_schema': OutputSchema.model_json_schema() # Convert to JSON Schema
}
result = anchor_client.agent.task('Collect the node names and their CPU average %',
task_options={
'output_schema': OutputSchema.model_json_schema(),
'url': 'https://play.grafana.org/a/grafana-k8s-app/navigation/nodes?from=now-1h&to=now&refresh=1m',
}
)
print(result)
```
**Configuration Options**
## Configuration Options
The AI agent can be configured with the following parameters:
> [!NOTE]
>
> Parameter names use `snake_case` in Python and `camelCase` in JavaScript/TypeScript (e.g., `max_steps` vs `maxSteps`).
* **agent** (string): AI agent to use (`browser-use`, `openai-cua`, `gemini-computer-use`, [`jev`](/agentic-browser-control/computer-use-agents/jev)). Defaults to `browser-use`.
* **secret\_values** | **secretValues** (object): Secret values to pass to the agent for secure credential handling.
* **human\_intervention** | **humanIntervention** (boolean): Allow human intervention during task execution.
* **provider** (string): AI provider to use (`openai`, `gemini`, `groq`, `azure`, `anthropic`, `xai`).
* **model** (string): Specific model to use (see [Available Models](#available-models-for-browser-use) below).
* **url** (string): Target URL to navigate to before executing the task.
* **output\_schema** | **outputSchema** (object): JSON Schema defining the expected structure of the output data.
* **max\_steps** | **maxSteps** (integer): Maximum number of steps the agent can take (default: 40).
* **detect\_elements** | **detectElements** (boolean): Enable element detection for better interaction accuracy.
* **extended\_system\_message** | **extendedSystemMessage** (string): Custom system message to provide additional context or instructions to the agent.
* **use\_vision** | **useVision** (boolean): Enable vision capabilities for enhanced visual understanding.
* **use\_action\_index\_tools** (boolean): Let the agent reuse cached web actions from the [Action Index](/advanced/action-index). Defaults to `true` on free plans and `false` on paid plans.
## Secret Values
Securely pass credentials and sensitive data to AI agents during task execution. Secret values are not logged and automatically cleaned up after completion.[Learn more about Secret Values →](/agentic-browser-control/secret-values)
## Available Models For Browser-Use
**Available Models**
> [tab] OpenAI
>
> gpt-5.6-solgpt-5.6-terragpt-5.6-lunagpt-5.5gpt-5.4gpt-5.4-minigpt-5.4-nanogpt-5.1gpt-5gpt-5-minigpt-5-nanogpt-4ogpt-4o-minigpt-4.1gpt-4.1-minigpt-4.1-nano
> [tab] Gemini
>
> gemini-3.1-pro-previewgemini-3.6-flashgemini-3.5-flashgemini-3-flash-previewgemini-3.1-flash-litegemini-2.5-flash-lite
> [tab] Groq
>
> openai/gpt-oss-120bmeta-llama/llama-4-maverick-17b-128e-instructmeta-llama/llama-4-scout-17b-16e-instructmoonshotai/kimi-k2-instruct
> [tab] Azure
>
> o4-minio3
> [tab] Anthropic
>
> claude-opus-4-8claude-opus-4-7claude-opus-4-6claude-opus-4-5claude-sonnet-5claude-sonnet-4-6claude-sonnet-4-5claude-haiku-4-5
# Async Perform Web Task
Source: https://docs.anchorbrowser.io/agentic-browser-control/async-perform-web-task
Run perform-web-task asynchronously and poll for results
## Basic Usage
To run `perform-web-task` asynchronously, set the `async` parameter to `true` in your request. The API will return immediately with a `workflow_id` that you can use to poll for results.
```javascript node.js theme={null}
import { client, Tools } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
// Start async task
const response = await Tools.performWebTask({
body: {
prompt: 'Extract the main heading and first paragraph from the page',
url: 'https://docs.anchorbrowser.io',
async: true
}
});
console.log('Workflow ID:', response.data.workflow_id);
console.log('Status:', response.data.status);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
# Start async task
response = anchor_client.tools.perform_web_task(
prompt='Extract the main heading and first paragraph from the page',
url='https://docs.anchorbrowser.io',
async_=True
)
print('Workflow ID:', response.data.workflow_id)
print('Status:', response.data.status)
```
**Parameters**
## Parameters
The async `perform-web-task` accepts the following parameters:
| Parameter | Type | Required | Description |
| - | - | - | - |
| `prompt` | string | Yes | The task to be autonomously completed |
| `url` | string | No | The URL of the webpage. If not provided, the tool will use the current page in the session |
| `sessionId` | string | No | An optional browser session identifier to reference an existing running browser session. When passed, the tool will be executed on the provided browser session |
| `async` | boolean | No | Whether to run the task asynchronously. If `true`, the task will be run asynchronously and the response will include a workflow ID. Defaults to `false` |
| `agent` | string | No | The AI agent to use for task completion. Options: `browser-use` (default), `openai-cua`, `gemini-computer-use`, `anthropic-cua` |
| `provider` | string | No | The AI provider to use for task completion. Options: `openai`, `gemini`, `groq`, `azure`, `xai` |
| `model` | string | No | The specific model to use for task completion. See [Available Models](/agentic-browser-control/ai-task-completion#available-models) for more information |
| `detect_elements` | boolean | No | Enable element detection for better interaction accuracy. Improves the agent's ability to identify and interact with UI elements |
| `human_intervention` | boolean | No | Allow human intervention during task execution. When enabled, the agent can request human input for ambiguous situations |
| `max_steps` | integer | No | Maximum number of steps the agent can take to complete the task. Defaults to `200` |
| `secret_values` | object | No | Secret values to pass to the agent for secure credential handling. Keys and values are passed as environment variables to the agent |
| `highlight_elements` | boolean | No | Whether to highlight elements during task execution for better visibility |
| `output_schema` | object | No | JSON Schema defining the expected structure of the output data |
## Polling for Results
After starting an async task, you'll receive a `workflow_id` in the response. Use this ID to poll the status endpoint until the task completes.
### Status Endpoint
```javascript node.js theme={null}
const statusResponse = await Tools.getPerformWebTaskStatus({
path: { workflowId }
});
// Status can be: 'RUNNING', 'COMPLETED', or 'FAILED'
// sessionId is present as soon as the job exists (including RUNNING)
if (statusResponse.data.status === 'RUNNING') {
console.log('Still running...', statusResponse.data.sessionId);
} else if (statusResponse.data.status === 'COMPLETED') {
console.log('Result:', statusResponse.data.result);
console.log('Session ID:', statusResponse.data.sessionId);
} else if (statusResponse.data.status === 'FAILED') {
console.error('Error:', statusResponse.data.error);
console.log('Session ID:', statusResponse.data.sessionId);
}
```
```python python theme={null}
status_response = anchor_client.tools.get_perform_web_task_status(workflow_id)
# Status can be: 'RUNNING', 'COMPLETED', or 'FAILED'
# sessionId is present as soon as the job exists (including RUNNING)
if status_response.data.status == 'RUNNING':
print('Still running...', status_response.data.sessionId)
elif status_response.data.status == 'COMPLETED':
print('Result:', status_response.data.result)
print('Session ID:', status_response.data.sessionId)
elif status_response.data.status == 'FAILED':
print('Error:', status_response.data.error)
print('Session ID:', status_response.data.sessionId)
```
### Response Statuses
* **`RUNNING`**: The workflow is currently executing. `sessionId` is included when a browser session was created or reused for the job.
* **`COMPLETED`**: The workflow has completed. The `result` field contains the task output as a string.
> [!NOTE]
>
> The status will be `COMPLETED` even if the agent fails to complete the task, since the workflow execution itself succeeded. Always check the `result` field to verify whether the agent completed the task successfully or encountered an error.
* **`FAILED`**: The workflow has failed. The `error` field contains the error message
## Complete Example
```javascript node.js theme={null}
import { client, Tools } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
// Start multiple async tasks in parallel
const responses = await Promise.all([
Tools.performWebTask({
body: {
prompt: 'Extract the main heading',
url: 'https://docs.anchorbrowser.io',
async: true
}
}),
Tools.performWebTask({
body: {
prompt: 'Get the first paragraph',
url: 'https://example.com',
async: true
}
})
]);
const workflowIds = responses.map(response => response.data.workflow_id);
console.log('Started', workflowIds.length, 'tasks');
// Poll all tasks
const results = await Promise.all(
workflowIds.map(async (wokflowId) => {
let status = 'RUNNING';
while (status === 'RUNNING') {
await new Promise(resolve => setTimeout(resolve, 2000));
const statusResponse = await Tools.getPerformWebTaskStatus({
path: { workflowId: wokflowId }
});
status = statusResponse.data.status;
if (status === 'RUNNING') {
console.log('Still running...', statusResponse.data.sessionId);
} else if (status === 'COMPLETED') {
console.log('Session ID:', statusResponse.data.sessionId);
return statusResponse.data.result;
} else if (status === 'FAILED') {
console.log('Session ID:', statusResponse.data.sessionId);
throw new Error(statusResponse.data.error);
}
}
})
);
console.log('All tasks completed:', results);
})();
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
import time
import requests
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
# Start multiple async tasks in parallel
responses = [
anchor_client.tools.perform_web_task(
prompt='Extract the main heading',
url='https://docs.anchorbrowser.io',
async_=True
),
anchor_client.tools.perform_web_task(
prompt='Get the first paragraph',
url='https://example.com',
async_=True
)
]
workflow_ids = [response.data.workflow_id for response in responses]
print('Started', len(workflow_ids), 'tasks')
# Poll all tasks
results = []
for workflow_id in workflow_ids:
status = 'RUNNING'
while status == 'RUNNING':
time.sleep(2)
status_response = anchor_client.tools.get_perform_web_task_status(workflow_id)
status = status_response.data.status
if status == 'RUNNING':
print('Still running...', status_response.data.sessionId)
elif status == 'COMPLETED':
print('Session ID:', status_response.data.sessionId)
results.append(status_response.data.result)
break
elif status == 'FAILED':
print('Session ID:', status_response.data.sessionId)
raise Exception(status_response.data.error)
print('All tasks completed:', results)
```
# Anthropic Computer Use
Source: https://docs.anchorbrowser.io/agentic-browser-control/computer-use-agents/anthropic
Use Claude models with native computer use capabilities for browser automation
Anthropic's Claude models with Computer Use capabilities enable AI agents to interact with web browsers through screenshots and native computer control actions.
## Overview
Anthropic Computer Use (`anthropic-cua`) leverages Claude's vision and reasoning capabilities to:
* Analyze screenshots of web pages
* Identify interactive elements
* Execute precise mouse and keyboard actions
* Complete complex multi-step workflows
## Supported Models
| Model | Model ID | Best For |
| - | - | - |
| Claude Opus 4.7 | `claude-opus-4-7` | Most capable, complex reasoning **(default)** |
| Claude Opus 4.6 | `claude-opus-4-6` | Advanced agentic coding |
| Claude Sonnet 4.6 | `claude-sonnet-4-6` | Speed and intelligence balance |
| Claude Sonnet 4.5 | `claude-sonnet-4-5` | Cost-effective automation |
| Claude Haiku 4.5 | `claude-haiku-4-5` | Fastest responses |
## Code Example
```javascript node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const response = await agentTask(
'Navigate to GitHub and find the anchorbrowser repository',
{
taskOptions: {
url: 'https://github.com',
agent: 'anthropic-cua',
// model: 'claude-opus-4-7', // Default model
maxSteps: 30
}
}
);
console.log(response);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
response = anchor_client.agent.task(
'Navigate to GitHub and find the anchorbrowser repository',
task_options={
'url': 'https://github.com',
'agent': 'anthropic-cua',
# 'model': 'claude-opus-4-7', # Default model
'max_steps': 30
}
)
print(response)
```
## Configuration Options
| Parameter | Type | Description |
| - | - | - |
| `agent` | string | Must be `anthropic-cua` |
| `model` | string | Claude model to use (default: `claude-opus-4-7`) |
| `url` | string | Starting URL for the task |
| `max_steps` | integer | Maximum actions the agent can take |
| `output_schema` | object | JSON Schema for structured output |
| `secret_values` | object | Secure credentials (see [Secret Values](/agentic-browser-control/secret-values)) |
## Secure Credentials with Secret Values
Anthropic CUA fully supports secret values for secure credential handling. Secrets are never exposed to the AI model.
```javascript node.js theme={null}
const response = await agentTask(
'Login to the dashboard and download my latest report',
{
taskOptions: {
url: 'https://app.example.com/login',
agent: 'anthropic-cua',
secretValues: {
EMAIL: process.env.APP_EMAIL,
PASSWORD: process.env.APP_PASSWORD
}
}
}
);
```
```python python theme={null}
response = anchor_client.agent.task(
'Login to the dashboard and download my latest report',
task_options={
'url': 'https://app.example.com/login',
'agent': 'anthropic-cua',
'secret_values': {
'EMAIL': os.environ.get('APP_EMAIL'),
'PASSWORD': os.environ.get('APP_PASSWORD')
}
}
)
```
Learn more about [domain-scoped secrets](/agentic-browser-control/secret-values).
## Best Practices
* **Opus 4.7 is the default** - most capable model for complex workflows
* **Use Sonnet 4.6** for faster automation when speed is important
* **Provide clear, specific prompts** describing the exact task to complete
# Gemini Computer Use
Source: https://docs.anchorbrowser.io/agentic-browser-control/computer-use-agents/gemini
Use Google Gemini models for screenshot-based browser automation
Google's Gemini Computer Use agent (`gemini-computer-use`) enables AI-powered browser automation through visual understanding and multi-turn interactions.
## Overview
Gemini Computer Use leverages Google's multimodal AI capabilities to:
* Process and understand web page screenshots
* Plan and execute multi-step browser interactions
* Handle complex visual layouts and dynamic content
* Integrate with Google's AI ecosystem
## Supported Models
| Model | Model ID | Best For |
| - | - | - |
| Gemini 3.5 Flash | `gemini-3.5-flash` | Screenshot-based automation **(default)** |
| Gemini 2.5 Computer Use (legacy) | `gemini-2.5-computer-use-preview-10-2025` | Legacy browser computer-use preview |
## Code Example
```javascript node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const response = await agentTask(
'Search for the latest AI news and summarize the top 3 articles',
{
taskOptions: {
url: 'https://news.google.com',
agent: 'gemini-computer-use',
// model: 'gemini-3.5-flash', // Default model
maxSteps: 25,
outputSchema: {
type: 'object',
properties: {
articles: {
type: 'array',
items: {
type: 'object',
properties: {
title: { type: 'string' },
summary: { type: 'string' },
source: { type: 'string' }
}
}
}
}
}
}
}
);
console.log(response);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
response = anchor_client.agent.task(
'Search for the latest AI news and summarize the top 3 articles',
task_options={
'url': 'https://news.google.com',
'agent': 'gemini-computer-use',
# 'model': 'gemini-3.5-flash', # Default model
'max_steps': 25,
'output_schema': {
'type': 'object',
'properties': {
'articles': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'title': {'type': 'string'},
'summary': {'type': 'string'},
'source': {'type': 'string'}
}
}
}
}
}
}
)
print(response)
```
## Configuration Options
| Parameter | Type | Description |
| - | - | - |
| `agent` | string | Must be `gemini-computer-use` |
| `model` | string | Gemini model to use (default: `gemini-3.5-flash`) |
| `url` | string | Starting URL for the task |
| `max_steps` | integer | Maximum actions the agent can take |
| `output_schema` | object | JSON Schema for structured output |
| `secret_values` | object | Secure credentials (see [Secret Values](/agentic-browser-control/secret-values)) |
## Secure Credentials with Secret Values
Gemini Computer Use fully supports secret values for secure credential handling. Secrets are never exposed to the AI model.
```javascript node.js theme={null}
const response = await agentTask(
'Login to the dashboard and download my latest report',
{
taskOptions: {
url: 'https://app.example.com/login',
agent: 'gemini-computer-use',
secretValues: {
EMAIL: process.env.APP_EMAIL,
PASSWORD: process.env.APP_PASSWORD
}
}
}
);
```
```python python theme={null}
response = anchor_client.agent.task(
'Login to the dashboard and download my latest report',
task_options={
'url': 'https://app.example.com/login',
'agent': 'gemini-computer-use',
'secret_values': {
'EMAIL': os.environ.get('APP_EMAIL'),
'PASSWORD': os.environ.get('APP_PASSWORD')
}
}
)
```
Learn more about [domain-scoped secrets](/agentic-browser-control/secret-values).
## Best Practices
* **gemini-3.5-flash is the default** - recommended Gemini Computer Use model with streamlined actions and intents
* **Leverage structured output** with `output_schema` for reliable data extraction
* **Provide clear, specific prompts** describing the exact task to complete
# Jev Browser Agent
Source: https://docs.anchorbrowser.io/agentic-browser-control/computer-use-agents/jev
Fast browser automation that classifies the next action with TypeSafe Jev and types with the model of your choice
Jev is a decision model from TypeSafe. Instead of generating text, it answers multiple-choice questions about a given state and returns one of the offered options with a probability. The Anchor `jev` agent turns browser automation into exactly that kind of question: at every step it shows Jev the controls on the current page and asks which one to act on next. A regular chat model is called only when a value has to be typed into a field.
In Anchor Browser, this agent is available through the agentic APIs with `taskOptions.agent = 'jev'`.
## Overview
The Jev agent provides:
* **Fast steps** — one classification call per action, no screenshots and no free-form reasoning
* **Choices, not guesses** — Jev can only pick from the controls that are actually on the page, so every action lands on a real element
* **Text generation only when needed** — typed values come from your configured `provider`/`model` (or BYOM); every other step is pure classification
* **Lean token usage** — classification returns a choice instead of text, and the text model runs just for the fields you fill
Learn more about the model in the [Jev documentation](https://openrouter.ai/docs/guides/community/jev).
## Code Example
```javascript node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const response = await agentTask(
'Search Wikipedia for Alan Turing and open his article. From that article, open the linked "Enigma machine" article. Stop when it is visible.',
{
taskOptions: {
url: 'https://www.wikipedia.org',
agent: 'jev',
// provider/model only affect typed text; Jev itself needs no model selection
// provider: 'anthropic',
// model: 'claude-sonnet-4-5',
},
}
);
console.log(response);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
response = anchor_client.agent.task(
'Search Wikipedia for Alan Turing and open his article. From that article, open the linked "Enigma machine" article. Stop when it is visible.',
task_options={
'url': 'https://www.wikipedia.org',
'agent': 'jev',
# provider/model only affect typed text; Jev itself needs no model selection
# 'provider': 'anthropic',
# 'model': 'claude-sonnet-4-5',
}
)
print(response)
```
## How Jev Drives the Task
Jev is a classifier, not a planner. It never writes selectors, coordinates, or code. The agent owns the loop and uses Jev for one thing: deciding the next move from a closed list of options.
**1. Observe the page**
The agent reads the current page and builds a numbered list of the controls a user could act on right now: links, buttons, text fields, checkboxes, dropdown options, and so on, each with its label and current state. It also captures the visible text so Jev can tell whether the goal is already satisfied.
**2. Ask Jev for the next move**
Jev receives the goal, the page summary, the control list, and the recent action history, and returns a single decision:
* `CLICK`, `TYPE_TEXT`, or `SELECT` on one specific control from the list
* `SCROLL_DOWN`, `SCROLL_UP`, or `WAIT` when the needed control is not available yet
* `DONE` when every requirement in the goal is visibly satisfied
* `BLOCKED` when no offered action can make progress
Because the answer is a choice rather than generated text, a step costs one round-trip and cannot reference an element that does not exist.
**3. Generate the value for typed fields**
Only `TYPE_TEXT` needs text. The configured text model receives the goal, the selected field's label and current value, and the page context, and returns the exact string to type. Secret placeholders such as `EMAIL` are kept verbatim and swapped for the real value at type time. If no value can be determined, the task stops as `blocked` instead of typing a guess.
**4. Act and repeat**
The agent performs the chosen action on the real element, confirms the page has not changed since Jev decided (and re-asks if it has), then observes again. The loop continues until Jev reports `DONE` or `BLOCKED`, or the step limit is reached.
### Example walkthrough
The Wikipedia task above completes in three actions and one closing decision:
| Step | Page | Jev decision | What happens |
| - | - | - | - |
| 1 | wikipedia.org | `TYPE_TEXT` → "Search Wikipedia" | Text model returns `Alan Turing`; the agent types it |
| 2 | wikipedia.org | `CLICK` → suggestion "Alan Turing" | Opens the article |
| 3 | Alan Turing article | `CLICK` → link "Enigma machine" | Opens the linked article |
| 4 | Enigma machine article | `DONE` | The end condition is visible |
Each row is one decision. The text model ran once, at step 1.
### Compared with the default agent
The same task, run once on each agent with `max_steps: 30`:
| | `jev` | `browser-use` (default) |
| - | - | - |
| Completed the task | Yes | Yes |
| Execution time | 7.6 s | 34.9 s |
| Text model calls | 1 | 6 |
Results vary with the site and the task. Jev's advantage is largest on click-through and form flows, where most steps need no generated text.
## Configuration Options
| Parameter | Type | Description |
| - | - | - |
| `agent` | string | Must be `jev` |
| `url` | string | Starting URL for the task |
| `provider` | string | Provider for typed text only (same values as other agents) |
| `model` | string | Model for typed text only. Defaults to the platform default model |
| `max_steps` | integer | Maximum actions, default and upper bound `60` |
| `secret_values` | object | Secure credentials (see [Secret Values](/agentic-browser-control/secret-values)) |
| `extended_system_message` | string | Extra instructions appended to the goal |
> [!NOTE]
>
> Jev is in beta and currently focuses on navigating and operating pages. Structured output (`output_schema`), human-in-the-loop (`human_intervention`), OS-level control (`use_os_control`), and element detection (`detect_elements`) are not available yet, so leave them unset when choosing this agent. `use_action_index_tools` is accepted and has no effect.
### Which model does what
| Call | Model | Credentials |
| - | - | - |
| Next-action classification (every step) | Jev | Managed by Anchor. Not affected by `provider`, `model`, or BYOM |
| Typed text (`TYPE_TEXT` steps only) | Your `provider`/`model` | Platform, or your own when [BYOM](/agentic-browser-control/bring-your-own-model) is configured for the project |
With BYOM active, all BYOM providers are supported for typed text (`openai`, `anthropic`, `google`, `vertex`, `azure`, `custom`) and `model` is required.
## Result
The task returns plain text: a status line followed by the visible text of the final page.
```text theme={null}
Done at https://en.wikipedia.org/wiki/Enigma_machine after 3 steps.
Enigma machine
From Wikipedia, the free encyclopedia
…
```
A task that could not finish starts with `Stopped (blocked) at …`. Reported token usage includes both the classification calls and the text model.
## When the Agent Stops
* Jev answers `DONE` — every requirement is visibly satisfied on the current page
* Jev answers `BLOCKED` — no offered action can make progress
* `max_steps` is reached
* Several consecutive actions did not change the page
* The text model could not determine a value for a required field
* The page kept changing before an action could be confirmed
## Limitations
* **Decides, does not write** — Jev returns a choice, never text. The agent operates the page; it does not summarize, extract, or answer questions, and the result is the final page state. Use another agent when the deliverable is generated content.
* **Needs real controls** — Jev picks from the labeled controls a page exposes. Purely visual interfaces such as canvas apps, maps, games, and image CAPTCHAs offer nothing to pick from, so use a screenshot-based agent there.
* **One step at a time** — every decision is made from the current page and recent history. Tasks that hinge on comparing content across pages or interpreting ambiguous instructions are better served by a reasoning agent.
* **Done means visible** — Jev reports `DONE` only from what is on screen. Outcomes the page does not visibly confirm cannot be verified by the agent.
## Secure Credentials with Secret Values
Secret values are substituted at type time and never sent to Jev or the text model.
```javascript node.js theme={null}
const response = await agentTask(
'Enter the API key in the key field and click Save',
{
taskOptions: {
url: 'https://app.example.com/settings/api',
agent: 'jev',
secretValues: {
API_KEY: process.env.APP_API_KEY,
},
},
}
);
```
```python python theme={null}
response = anchor_client.agent.task(
'Enter the API key in the key field and click Save',
task_options={
'url': 'https://app.example.com/settings/api',
'agent': 'jev',
'secret_values': {
'API_KEY': os.environ.get('APP_API_KEY'),
},
}
)
```
Learn more about [domain-scoped secrets](/agentic-browser-control/secret-values).
## Best Practices
* **State the visible end condition** in the goal (for example, "stop when the order confirmation is visible"). Jev only answers `DONE` when the page shows that every requirement is met.
* **Prefer Jev for form-driven sites** such as search, filters, and multi-page flows with native controls. Use a computer-use agent for canvas or purely visual interfaces.
* **Pick a fast text model** — it is called only for `TYPE_TEXT`, so a small model keeps steps quick without affecting decision quality.
# OpenAI Computer Use
Source: https://docs.anchorbrowser.io/agentic-browser-control/computer-use-agents/openai
Use OpenAI models with computer use capabilities for browser automation
OpenAI's Computer Use Agent (`openai-cua`) leverages GPT models with vision and reasoning capabilities for screenshot-based browser automation.
## Overview
OpenAI Computer Use provides:
* **Screenshot-based interactions** for visual understanding of web pages
* **Advanced reasoning** powered by GPT models
* **High accuracy** for complex web interactions
* **Structured outputs** for reliable data extraction
## Supported Models
| Model | Model ID | Best For |
| - | - | - |
| OpenAI 5.4 | `openai-5.4` | Screenshot-based automation **(default)** |
## Code Example
```javascript node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const response = await agentTask(
'Find the pricing information and extract the plan details',
{
taskOptions: {
url: 'https://example.com/pricing',
agent: 'openai-cua',
// model: 'openai-5.4', // Default model
maxSteps: 25,
outputSchema: {
type: 'object',
properties: {
plans: {
type: 'array',
items: {
type: 'object',
properties: {
name: { type: 'string' },
price: { type: 'string' },
features: { type: 'array', items: { type: 'string' } }
}
}
}
}
}
}
}
);
console.log(response);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
response = anchor_client.agent.task(
'Find the pricing information and extract the plan details',
task_options={
'url': 'https://example.com/pricing',
'agent': 'openai-cua',
# 'model': 'openai-5.4', # Default model
'max_steps': 25,
'output_schema': {
'type': 'object',
'properties': {
'plans': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'name': {'type': 'string'},
'price': {'type': 'string'},
'features': {'type': 'array', 'items': {'type': 'string'}}
}
}
}
}
}
}
)
print(response)
```
## Configuration Options
| Parameter | Type | Description |
| - | - | - |
| `agent` | string | Must be `openai-cua` |
| `model` | string | OpenAI model to use (default: `openai-5.4`) |
| `url` | string | Starting URL for the task |
| `max_steps` | integer | Maximum actions the agent can take |
| `output_schema` | object | JSON Schema for structured output |
| `secret_values` | object | Secure credentials (see [Secret Values](/agentic-browser-control/secret-values)) |
## Secure Credentials with Secret Values
OpenAI CUA fully supports secret values for secure credential handling. Secrets are never exposed to the AI model.
```javascript node.js theme={null}
const response = await agentTask(
'Login to the dashboard and download my latest report',
{
taskOptions: {
url: 'https://app.example.com/login',
agent: 'openai-cua',
secretValues: {
EMAIL: process.env.APP_EMAIL,
PASSWORD: process.env.APP_PASSWORD
}
}
}
);
```
```python python theme={null}
response = anchor_client.agent.task(
'Login to the dashboard and download my latest report',
task_options={
'url': 'https://app.example.com/login',
'agent': 'openai-cua',
'secret_values': {
'EMAIL': os.environ.get('APP_EMAIL'),
'PASSWORD': os.environ.get('APP_PASSWORD')
}
}
)
```
Learn more about [domain-scoped secrets](/agentic-browser-control/secret-values).
# Yutori Browser Use
Source: https://docs.anchorbrowser.io/agentic-browser-control/computer-use-agents/yutori
Build browser-use agents with Yutori n1 — state-of-the-art browser-use model
n1 is a browser-use model developed by Yutori, which enables building computer use agents (CUA). Given a user goal, a webpage screenshot, and action history, n1 predicts browser actions — such as clicking, typing, scrolling — to complete complex multi-step tasks. The model is trained on large-scale real-world web interaction trajectories and reinforcement learning with simulated and real websites.
In Anchor Browser, this agent is available directly through agentic API's and `taskOptions.agent = 'yutori'`.
## Overview
Yutori Browser Use provides:
* **Browser-use automation** with native browser actions
* **State-of-the-art performance** — outperforms GPT 5.4 and Opus 4.6 (+3%) on [Navi-bench and WestWorld](https://x.com/DhruvBatra_/status/2031402445772042312), while being 2.5x faster and 4-5x cheaper
* **Multi-step task handling** for navigation, extraction, and workflow completion
* **Structured output support** through `output_schema` when you need machine-readable results
Learn more about the model in the official [Yutori n1 reference](https://docs.yutori.com/reference/n1) and the [Introducing n1 blog post](https://yutori.com/blog/introducing-n1).
## Supported Models
| Model | Model ID | Best For |
| - | - | - |
| Yutori n1 | `n1.5-latest` | State-of-the-art browser-use automation **(default)** |
## Code Example
```javascript node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const response = await agentTask(
'Go to Hacker News, open the top story, and summarize it in 3 bullet points',
{
taskOptions: {
url: 'https://news.ycombinator.com',
agent: 'yutori',
},
}
);
console.log(response);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
response = anchor_client.agent.task(
'Go to Hacker News, open the top story, and summarize it in 3 bullet points',
task_options={
'url': 'https://news.ycombinator.com',
'agent': 'yutori',
}
)
print(response)
```
## Supported Browser-Use Actions
Yutori in Anchor Browser supports these core browser-use actions:
* `left_click`, `double_click`, `triple_click`, `right_click`
* `scroll`, `scroll_at`
* `type`, `key_press`
* `hover`, `drag`
* `goto_url`, `go_back`, `refresh`
* `wait`
## Best Practices
* **Set `max_steps` intentionally** based on task complexity to control runtime
* **Use `output_schema`** for reliable, structured extraction workflows
* **Write specific prompts** with clear success criteria for better automation quality
## Secure Credentials with Secret Values
When using Yutori n1 on Anchor Browser, you get secure credential handling built into the infrastructure. Secrets are never exposed to the AI model.
Learn more about [domain-scoped secrets](/agentic-browser-control/secret-values).
# Human-in-the-Loop
Source: https://docs.anchorbrowser.io/agentic-browser-control/human-in-the-loop
Enable human intervention during AI agent task execution
Enabling Human-in-the-loop (HITL) allows the AI agent to pause execution and request human intervention when needed. This feature is essential for tasks that require human judgment, approval, or handling of unexpected situations.
## Basic Usage
### How It Works
When HITL is enabled, the agent sends its intervention requests to a session-specific queue. The agent then continues execution based on your instructions.
```javascript node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const response = await agentTask(
'Research information about Python programming on Wikipedia and create a summary. Ask for human verification if you find any controversial or disputed information.',
{
taskOptions: {
url: 'https://en.wikipedia.org/wiki/Python_(programming_language)',
humanIntervention: true,
extendedSystemMessage: 'Request human intervention when you encounter disputed or controversial claims about Python'
}
}
);
console.log(response);
})();
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHOR_API_KEY"))
response = anchor_client.agent.task(
'Research information about Python programming on Wikipedia and create a summary. Ask for human verification if you find any controversial or disputed information.',
task_options={
'url': 'https://en.wikipedia.org/wiki/Python_(programming_language)',
'human_intervention': True,
'extended_system_message': 'Request human intervention when you encounter disputed or controversial claims about Python'
}
)
print(response)
```
> [!TIP]
>
> Human-in-the-loop is most effective when combined with clear system messages that define specific intervention triggers and provide context for decision-making.
## Webhooks
Instead of polling the endpoints below, you can subscribe to [webhook](/webhooks/overview) events and receive a push notification whenever the agent requests human input.
Subscribe to `intervention.requested` to get notified when the agent pauses — the payload includes the `request_id`, the agent's message, and a `live_view_url` for one-click live takeover. Subscribe to `intervention.resolved` if you need to know when an intervention was answered.
See [Webhooks](/webhooks/overview) for setup, [Events](/webhooks/events) for the full payload reference, and [Signature verification](/webhooks/signature-verification) to verify incoming deliveries.
## Get Pending Requests
To retrieve pending human intervention requests from the agent, use the GET endpoint:
```javascript node.js theme={null}
import { client, Agent } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
(async () => {
const data = await Agent.getRequestedHumanIntervention({
path: { session_id: sessionId }
});
console.log('Intervention requests:', data.data.requests);
})();
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
data = anchor_client.agent.get_requested_human_intervention(session_id)
print('Intervention requests:', data.data.requests)
```
## Send Intervention Response
To send a response to a pending human intervention request, use the POST endpoint:
```javascript node.js theme={null}
import { client, Agent } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
(async () => {
const data = await Agent.respondToHumanIntervention({
path: { session_id: sessionId },
body: {
requestId: 'request-id-from-intervention-request',
response: 'Your response to the agent\'s request'
}
});
console.log('Response:', data);
})();
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
data = anchor_client.agent.respond_to_human_intervention(
session_id,
request_id='request-id-from-intervention-request',
response="Your response to the agent's request",
)
print('Response:', data)
```
# Secret Values
Source: https://docs.anchorbrowser.io/agentic-browser-control/secret-values
Securely pass credentials and sensitive data to AI agents
Secret values allow you to securely pass credentials, API keys, and other sensitive data to AI agents during task execution. These values are automatically handled at type-time, never logged, and never exposed to the AI model.
Secret values work with all agent types: `browser-use`, `openai-cua`, `anthropic-cua`, and `gemini-computer-use`.
## Basic Usage
Pass credentials as key-value pairs in `secretValues`. The agent will securely use these values when logging into websites or filling forms.
```javascript node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const response = await agentTask(
'Login to LinkedIn and send a connection request to the Anchorbrowser team',
{
taskOptions: {
url: 'https://linkedin.com',
secretValues: {
LINKEDIN_EMAIL: process.env.LINKEDIN_EMAIL,
LINKEDIN_PASSWORD: process.env.LINKEDIN_PASSWORD
}
}
}
);
console.log(response);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
response = anchor_client.agent.task(
'Login to LinkedIn and send a connection request to the Anchorbrowser team',
task_options={
'url': 'https://linkedin.com',
'secret_values': {
'LINKEDIN_EMAIL': os.environ.get('LINKEDIN_EMAIL'),
'LINKEDIN_PASSWORD': os.environ.get('LINKEDIN_PASSWORD')
}
}
)
print(response)
```
> [!TIP]
>
> Secret values are the recommended way to handle any sensitive data in AI agent tasks. Never include credentials directly in prompts.
## Domain-Scoped Secrets
For enhanced security, you can scope secrets to specific domains. Secrets will only be available when the browser is on a matching domain - preventing credential exposure on the wrong site.
```javascript node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const response = await agentTask(
'Login to LinkedIn, then login to Gmail and check my inbox',
{
taskOptions: {
url: 'https://linkedin.com',
agent: 'anthropic-cua',
secretValues: {
// Only available on linkedin.com
'*.linkedin.com': {
LINKEDIN_EMAIL: process.env.LINKEDIN_EMAIL,
LINKEDIN_PASSWORD: process.env.LINKEDIN_PASSWORD
},
// Only available on google.com
'*.google.com': {
GOOGLE_EMAIL: process.env.GOOGLE_EMAIL,
GOOGLE_PASSWORD: process.env.GOOGLE_PASSWORD
}
}
}
}
);
console.log(response);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.environ.get("ANCHORBROWSER_API_KEY"))
response = anchor_client.agent.task(
'Login to LinkedIn, then login to Gmail and check my inbox',
task_options={
'url': 'https://linkedin.com',
'agent': 'anthropic-cua',
'secret_values': {
# Only available on linkedin.com
'*.linkedin.com': {
'LINKEDIN_EMAIL': os.environ.get('LINKEDIN_EMAIL'),
'LINKEDIN_PASSWORD': os.environ.get('LINKEDIN_PASSWORD')
},
# Only available on google.com
'*.google.com': {
'GOOGLE_EMAIL': os.environ.get('GOOGLE_EMAIL'),
'GOOGLE_PASSWORD': os.environ.get('GOOGLE_PASSWORD')
}
}
}
)
print(response)
```
### Domain Pattern Examples
| Pattern | Matches |
| - | - |
| `*.linkedin.com` | `www.linkedin.com`, `login.linkedin.com` |
| `linkedin.com` | `linkedin.com`, `www.linkedin.com` |
| `https://*.google.com` | Only HTTPS Google subdomains |
| `*` | All domains (use sparingly) |
> [!WARNING]
>
> Domain-scoped secrets are only available when the browser URL matches the pattern. If the agent navigates to a different domain, those secrets won't be accessible.
## Best Practices
> [card] Use Environment Variables
>
> Never hardcode secrets in your code. Always load from environment variables or a secrets manager.
> [card] Scope to Domains
>
> Use domain-scoped secrets for multi-site tasks to prevent credential leakage.
> [card] Meaningful Key Names
>
> Use clear, descriptive key names like `LINKEDIN_PASSWORD` instead of `PASS1`.
> [card] Minimal Exposure
>
> Only include secrets that the task actually needs.
## Security Guarantees
| Guarantee | Description |
| - | - |
| **Never logged** | Secret values are excluded from all logs and telemetry |
| **Never sent to AI** | Real values are never visible to the AI model |
| **Type-time replacement** | Secrets are only used at the moment of typing |
| **Domain isolation** | Domain-scoped secrets are only available on matching URLs |
| **No storage** | Secrets are processed in-memory and never persisted |
# Applications
Source: https://docs.anchorbrowser.io/essentials/applications
Define target websites, authentication modes, and login flows for managed authentication.
An **application** represents a website your agents need to access — for example `linkedin.com` or `app.example.com`. Applications group **auth flows** (how login works) and **identities** (who logs in).
After you create an application, choose **how users will log in**. This is the most important configuration step — it determines what Anchor asks for when someone connects an account.
> [card] [Auto-Discovery Auth](#auto-discovery-auth)
>
> Anchor detects the login page and walks through sign-in automatically. Unpredictable login flows or the fastest setup.
> [card] [Preset authentication](#preset-authentication)
>
> You define the exact fields and MFA methods (username/password, email OTP, authenticator, etc.). When you know the login steps in advance.
> [card] [Manual authentication](#manual-authentication)
>
> Anchor opens a browser and the user signs in themselves. Unsupported login methods or a hands-on browser experience.
## Create an application
> [tab] Dashboard
>
> 1. Go to [Identities](https://app.anchorbrowser.io/identities) in the Anchor dashboard.
> 2. Click **Add application**.
> 3. Enter a name and the target site URL or domain.
> 4. Choose [how users will log in](#auth-modes). If you're unsure, start with **Auto-Discovery Auth** — you can switch later.
> [tab] API
>
> ```javascript node.js theme={null}
> import { client, Applications } from 'anchorbrowser';
>
> client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
>
> const app = await Applications.createApplication({
> body: {
> name: 'My LinkedIn User',
> source: 'linkedin.com',
> },
> });
>
> console.log(app.id);
> ```
>
> ```python python theme={null}
> from anchorbrowser import Anchorbrowser
>
> anchor_client = Anchorbrowser()
>
> app = anchor_client.applications.create_application(
> name="My LinkedIn User",
> source="linkedin.com",
> )
>
> print(app.id)
> ```
## Auth modes
Each application uses one of three login approaches. Pick the one that matches how your target site works.
### Auto-Discovery Auth
Anchor opens the target site, analyzes the login page, and guides sign-in automatically. Login steps are detected at runtime — no credential template required upfront.
Use this when:
* The site's login flow changes frequently
* You want the fastest path to a working identity
* You're using [OmniConnect](/essentials/omniconnect) and letting end users sign in
This is pre-selected when you create a new application in the dashboard.
#### Via dashboard
1. Open your application on the [Identities](https://app.anchorbrowser.io/identities) page.
2. Select **Auto-Discovery Auth**.
#### Via API
Set `auth_mode` to `dynauth` when creating or updating an application. This is the default — you can omit it on create.
Drive a live login in an existing session with the dynamic auth API (`session_id` is the last path segment on every call):
| Method | Path | When |
| - | - | - |
| `POST` | `/v1/identities/dynamic/start/{session_id}` | Begin the flow |
| `GET` | `/v1/identities/dynamic/state/{session_id}` | Poll after retryable `detection_failed`, a timeout, or 409 — some login steps take longer than one request |
| `POST` | `/v1/identities/dynamic/resolve/{session_id}` | Answer the current step. Body depends on `type` (see below) |
| `POST` | `/v1/identities/dynamic/finalize/{session_id}` | After `type: authenticated` |
The response tells you which kind of step needs to be handled:
* **`decision`** — `options` contains several sign-in methods. Choose one by sending its `step_id` as `choice`.
* **`form`** — `options` contains ways to complete the step, such as credentials, passkey, or email MFA. Choose one by `option_index`, then send that option's values.
**`/resolve` body by last `type`:**
* **`decision`** — `{ "choice": "" }` only
* **`form`** — `{ "option_index": 0, "values": { "username": "...", "password": "..." } }` only
For an email MFA form, use the same `form` request shape with `values.gmail_tokens` after connecting Gmail through the option's `extra_data.create_integration_url`. There is no separate Gmail-token endpoint.
Every option carries `automatable` — whether that path can be replayed later without a human. The identity saved by `/finalize` reports the flow-level result.
Do not call `/resolve` for `detection_failed`. If `retryable` is true, poll `/state` until you get `decision`, `form`, or `authenticated`. If not, open `live_view_url` to finish signing in.
`/state` includes `view` (same shape as start/resolve) and `phase`. On `settled`, `view` is the current step. On `navigating`, `view` may already be the next step; `target` is only for progress UI.
Gmail one-click MFA tokens are account-bound and reusable across applications — connect once, then reuse the same `gmail_tokens` value on later email MFA forms. See the [resolve reference](/api-reference/identities/resolve-dynamic-auth-flow-step) for option shapes and `extra_data`.
```javascript node.js theme={null}
// On create (default)
const app = await Applications.createApplication({
body: {
name: 'My App',
source: 'https://example.com',
auth_mode: 'dynauth',
},
});
// Or switch an existing application (no dedicated SDK method — use a raw client call)
await client.patch({
url: `/v1/applications/${app.id}`,
body: {
auth_mode: 'dynauth',
},
});
```
```python python theme={null}
# On create (default)
app = anchor_client.applications.create_application(
name="My App",
source="https://example.com",
auth_mode="dynauth",
)
# Or switch an existing application
anchor_client.applications.update_application(
application_id=app.id,
auth_mode="dynauth",
)
```
### Preset authentication
You define one or more named auth flows with specific [authentication methods](#authentication-methods) — for example username/password plus email MFA, or username/password plus an authenticator secret.
Choose preset authentication when you want to control how login looks:
* You define which fields Anchor collects (username/password, custom inputs, MFA methods)
* You need email OTP, authenticator codes, 1Password, or other specific auth methods
* You want multiple named login flows on the same application
#### Via dashboard
1. Open your application on the [Identities](https://app.anchorbrowser.io/identities) page.
2. Select **Preset authentication** — existing flows appear below.
3. Click **Add flow** to create a new authentication flow.
4. Enter a name and select the **authentication methods** your login requires.
5. Click **Save Changes**.
#### Via API
Set `auth_mode` to `preset`, then create one or more auth flows for the application.
```javascript node.js theme={null}
// No dedicated SDK method for updating an application — use a raw client call
await client.patch({
url: `/v1/applications/${app.id}`,
body: {
auth_mode: 'preset',
},
});
const authFlow = await Applications.createAuthFlow({
path: { applicationId: app.id },
body: {
name: 'Email Login with authenticator',
methods: ['username_password', 'authenticator'],
},
});
```
```python python theme={null}
anchor_client.applications.update_application(
application_id=app.id,
auth_mode="preset",
)
auth_flow = anchor_client.applications.create_auth_flow(
application_id=app.id,
name="Email Login with authenticator",
methods=["username_password", "authenticator"],
)
```
Pass the returned flow `id` as `authOptionId` when [creating an identity](/essentials/authenticated-applications).
#### Authentication methods
Combine methods in a preset flow to match the site's login steps:
| Method | What Anchor collects | Guide |
| - | - | - |
| `username_password` | Username and password | — |
| `authenticator` | TOTP secret | — |
| `email_mfa` | Forwarded email OTP via Anchor inbox | [Email MFA](/advanced/email-otp) |
| `sms_mfa` | SMS OTP codes | — |
| `gmail_mfa` | Gmail OAuth for reading codes | — |
| `one_password` | Credentials from 1Password vault | [1Password](/integrations/1password) |
| `custom` | Named fields you define (company name, API key, etc.) | — |
| `profile` | Manual browser login saved to the identity | — |
| `dynauth` | Auto-discovery login | — |
> [!NOTE]
>
> Do not mix credential-based methods (`username_password`, `authenticator`, etc.) with browser-based methods (`dynauth`, `profile`) in the same flow. Use separate flows if you need both approaches on one application.
##### Custom fields
When a login form has non-standard inputs, add `custom_fields` to your auth flow and pair them with the `custom` method:
```json theme={null}
{
"name": "Company Login",
"methods": ["custom", "username_password"],
"custom_fields": [
{ "name": "company_name" }
]
}
```
### Manual authentication
Anchor opens a secure browser and the user signs in themselves. The resulting session state is saved as an identity.
Choose manual authentication when:
* You want a hands-on browser login experience
* The site uses login methods Anchor does not support yet
> [!NOTE]
>
> With auto-discovery or preset authentication, you can optionally switch to a browser login during identity creation if automated steps fail or the site presents an unexpected challenge.
#### Via dashboard
1. Open your application on the [Identities](https://app.anchorbrowser.io/identities) page.
2. Select **Manual authentication**.
#### Via API
Set `auth_mode` to `manual` when creating or updating an application.
```javascript node.js theme={null}
// On create
const app = await Applications.createApplication({
body: {
name: 'My App',
source: 'https://example.com',
auth_mode: 'manual',
},
});
// Or switch an existing application (no dedicated SDK method — use a raw client call)
await client.patch({
url: `/v1/applications/${app.id}`,
body: {
auth_mode: 'manual',
},
});
```
```python python theme={null}
# On create
app = anchor_client.applications.create_application(
name="My App",
source="https://example.com",
auth_mode="manual",
)
# Or switch an existing application
anchor_client.applications.update_application(
application_id=app.id,
auth_mode="manual",
)
```
## What happens next
Once your application is configured, [create an identity](/essentials/authenticated-applications) for each account that needs access. Identities store credentials and validated session state; attach them to browser sessions to start signed in.
## Further application setup
After choosing an auth mode, you can configure defaults that apply to **every identity** under the application — network routing, browser session settings, and application metadata. Open your application on the [Identities](https://app.anchorbrowser.io/identities) page and expand **Advanced**.
### Network defaults
Choose how traffic is routed for authenticated sessions created from this application:
| Option | Description |
| - | - |
| **Anchor Proxy** | Route through Anchor's managed rotating proxy network (default) |
| **Custom Proxy** | Route through your own proxy server |
| **Dedicated Sticky IP** | Each identity gets a fixed IP address that persists across sessions |
Network settings apply at the application level and affect all identities under it. See [Proxy](/advanced/proxy), [Bring Your Own Proxy](/advanced/bring-your-own-proxy), and [Dedicated Sticky IP](/advanced/dedicated-sticky-ip) for details.
You can also set `dedicated_sticky_ip` on an individual identity at creation time to override the application default.
### Browser session defaults
Enable **Default Browser Session Configuration** to set defaults merged into every session launched with an identity from this application — for example proxy country, [Extra Stealth](/essentials/stealth), [CAPTCHA solving](/advanced/captcha-solving), or session timeout.
The configuration uses the same schema as the [Start Browser Session](/api-reference/browser-sessions/start-browser-session) API. Session-level options passed at create time still override these defaults.
### Application metadata
Update the application **name** and **description** from the same Advanced panel — useful for organizing applications in the dashboard.
### Via API
Set defaults when creating or updating an application:
```javascript node.js theme={null}
// No dedicated SDK method for updating an application — use a raw client call
await client.patch({
url: `/v1/applications/${app.id}`,
body: {
name: 'Acme Portal',
description: 'Internal procurement system',
identityDefaultConfiguration: {
dedicated_sticky_ip: true,
},
browserSessionDefaultConfiguration: {
session: {
proxy: { active: true, country_code: 'us' },
},
browser: {
extra_stealth: { active: true },
captcha_solver: { active: true },
},
},
},
});
```
```python python theme={null}
anchor_client.applications.update_application(
application_id=app.id,
name="Acme Portal",
description="Internal procurement system",
identity_default_configuration={
"dedicated_sticky_ip": True,
},
browser_session_default_configuration={
"session": {
"proxy": {"active": True, "country_code": "us"},
},
"browser": {
"extra_stealth": {"active": True},
"captcha_solver": {"active": True},
},
},
)
```
## Related
> [card] [Managed Authentication Overview](/essentials/managed-authentication)
>
> Profiles vs identities and how the model fits together
> [card] [Identities](/essentials/authenticated-applications)
>
> Create identities and launch authenticated sessions
> [card] [API Reference](/api-reference/applications/)
>
> Applications and auth flow endpoints
> [card] [OmniConnect](/essentials/omniconnect)
>
> Embed identity creation in your product
# Async Session
Source: https://docs.anchorbrowser.io/essentials/async-session
Create browser sessions without blocking and poll until they are ready
> [!NOTE]
>
> Not sure which approach to use? See [Browser Sessions](/quickstart/browser-sessions#how-to-create) for sync vs async vs batch.
## Overview
`POST /v1/sessions/async` is the non-blocking variant of `POST /v1/sessions`. Instead of
waiting for the underlying browser pod to provision, it returns a `request_id` immediately
and provisions the session in the background. You then poll
`GET /v1/sessions/async/{request_id}/status` until the request reaches the `ready` status,
at which point the response includes the resolved `session_id`, `cdp_url` and `live_view_url`.
This route has its own per-minute budget, separate from `POST /v1/sessions`. Caps, `429` headers, and retries are the same as [Browser Sessions](/quickstart/browser-sessions#rate-limits).
This pattern is useful when you want to:
* Kick off many sessions in parallel without holding open long-lived HTTP requests.
* Avoid request timeouts while large or proxied sessions are being provisioned.
* Decouple session creation from session consumption (for example, queue the work and connect later).
## How It Works
**1. Create the async request**
Send a `POST` to `/v1/sessions/async` with your browser configuration. The response
returns immediately with a `request_id` and `status: "pending"`.
**2. Poll for readiness**
Call `GET /v1/sessions/async/{request_id}/status` on an interval. The request moves
through the provisioning phases until `status` becomes `ready`.
**3. Connect to the session**
Once ready, read `session_id`, `cdp_url` and `live_view_url` from the embedded
`session` object and connect over CDP as you would for a standard session.
## Create an Async Session
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const browserConfiguration = {
browser: {
headless: { active: false },
adblock: { active: true },
captcha_solver: { active: true },
},
session: {
proxy: { active: true, free_roam: false },
recording: { active: true },
},
};
const { data } = await Sessions.createSessionAsync({
body: browserConfiguration,
});
console.log('request_id:', data.request_id, 'status:', data.status);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
response = anchor_client.sessions.create_session_async(
browser={
'headless': {'active': False},
'adblock': {'active': True},
'captcha_solver': {'active': True},
},
session={
'proxy': {'active': True, 'free_roam': False},
'recording': {'active': True},
},
)
data = response.data
print('request_id:', data.request_id, 'status:', data.status)
```
The request body is identical to the standard [Start Browser Session](/api-reference) request,
so any configuration you can pass to `POST /v1/sessions` is also accepted here.
A successful response is returned immediately:
```json theme={null}
{
"data": {
"request_id": "b1f9e0a2-7c3d-4f5a-9b2e-1d6c8a4f0e21",
"status": "pending",
"session_id": null
}
}
```
## Poll for Readiness
Poll the status endpoint using the `request_id` until `status` becomes `ready`.
> [!TIP]
>
> Instead of polling, you can subscribe to the [`session.ready` webhook event](/webhooks/events#sessions).
> It fires the moment the session becomes connectable and carries the `session_id`, `cdp_url`,
> `live_view_url`, and the `request_id` to correlate it back to your async request.
```javascript node.js theme={null}
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
async function pollUntilReady(requestId) {
while (true) {
const { data } = await Sessions.getAsyncSessionStatus({
path: { request_id: requestId },
});
if (data.status === 'ready') return data;
if (data.status === 'failed' || data.status === 'cancelled') {
throw new Error(`Async request reached terminal status: ${data.status}`);
}
await sleep(3_000);
}
}
```
```python python theme={null}
import time
def poll_until_ready(request_id):
while True:
response = anchor_client.sessions.get_async_session_status(request_id)
data = response.data
if data.status == 'ready':
return data
if data.status in ('failed', 'cancelled'):
raise RuntimeError(f"Async request reached terminal status: {data.status}")
time.sleep(3)
```
A response while provisioning looks like:
```json theme={null}
{
"data": {
"request_id": "b1f9e0a2-7c3d-4f5a-9b2e-1d6c8a4f0e21",
"status": "processing",
"created_at": "2026-06-04T11:00:00.000Z",
"progress": { "current_phase": "provisioning" }
}
}
```
Once ready, the embedded `session` object is populated:
```json theme={null}
{
"data": {
"request_id": "b1f9e0a2-7c3d-4f5a-9b2e-1d6c8a4f0e21",
"status": "ready",
"created_at": "2026-06-04T11:00:00.000Z",
"progress": { "current_phase": "ready" },
"session": {
"session_id": "9c0d1e2f-3a4b-5c6d-7e8f-9a0b1c2d3e4f",
"status": "running",
"cdp_url": "wss://connect.anchorbrowser.io?...",
"live_view_url": "https://live.anchorbrowser.io/..."
}
}
}
```
### Request Statuses
| Status | Description |
| - | - |
| `pending` | Request accepted, not yet picked up for provisioning. |
| `processing` | The browser pod is being provisioned and configured. |
| `ready` | The session is connectable. `session.session_id`, `cdp_url` and `live_view_url` are available. |
| `completed` | The session has finished its lifecycle. |
| `failed` | Provisioning failed. No session was produced. |
| `cancelled` | The request was cancelled before a session was produced. |
### Provisioning Phases
The `progress.current_phase` field reports finer-grained progress while `status` is `pending` or `processing`:
| Phase | Description |
| - | - |
| `queued` | Waiting for capacity. |
| `provisioning` | The browser pod is starting up. |
| `configuring` | Applying your browser and session configuration. |
| `ready` | The session is up and connectable. |
## Complete Example
The following script spawns multiple async sessions in parallel, polls each one until it is
ready, and prints the connection details. Set `ANCHOR_API_KEY` in your environment before running.
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const SESSION_COUNT = 2;
const POLL_INTERVAL_MS = 3_000;
const browserConfiguration = {
session: {
proxy: { active: true },
timeout: { idle_timeout: 5, max_duration: 25 },
recording: { active: true },
},
};
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
async function createAsyncSession(label) {
const { data } = await Sessions.createSessionAsync({
body: browserConfiguration,
});
console.log(`[${label}] create response:`, data);
return data;
}
async function pollUntilReady(requestId, label) {
while (true) {
const { data } = await Sessions.getAsyncSessionStatus({
path: { request_id: requestId },
});
console.log(`[${label}] poll response:`, data);
if (data.status === 'ready') return data;
if (data.status === 'failed' || data.status === 'cancelled') {
throw new Error(`[${label}] async request reached terminal status: ${data.status}`);
}
await sleep(POLL_INTERVAL_MS);
}
}
async function runOne(label) {
const created = await createAsyncSession(label);
const status = await pollUntilReady(created.request_id, label);
const session = status.session;
console.log(`\n[${label}] READY — session info:`);
console.log(` request_id : ${created.request_id}`);
console.log(` session_id : ${session.session_id}`);
console.log(` cdp_url : ${session.cdp_url}`);
console.log(` live_view_url : ${session.live_view_url}`);
console.log(` status : ${session.status}`);
}
(async () => {
const labels = Array.from({ length: SESSION_COUNT }, (_, i) => `s${i + 1}`);
console.log(`Spawning ${SESSION_COUNT} async session(s)\n`);
await Promise.all(labels.map(runOne));
})().catch(console.error);
```
```python python theme={null}
import os
import time
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
SESSION_COUNT = 2
POLL_INTERVAL_SEC = 3
session_configuration = {
'proxy': {'active': True},
'timeout': {'idle_timeout': 5, 'max_duration': 25},
'recording': {'active': True},
}
def create_async_session(label):
response = anchor_client.sessions.create_session_async(session=session_configuration)
data = response.data
print(f'[{label}] create response:', data)
return data
def poll_until_ready(request_id, label):
while True:
response = anchor_client.sessions.get_async_session_status(request_id)
data = response.data
print(f'[{label}] poll response:', data)
if data.status == 'ready':
return data
if data.status in ('failed', 'cancelled'):
raise RuntimeError(f"[{label}] async request reached terminal status: {data.status}")
time.sleep(POLL_INTERVAL_SEC)
def run_one(label):
created = create_async_session(label)
status = poll_until_ready(created.request_id, label)
session = status.session
print(f'\n[{label}] READY — session info:')
print(f" request_id : {created.request_id}")
print(f" session_id : {session.session_id}")
print(f" cdp_url : {session.cdp_url}")
print(f" live_view_url : {session.live_view_url}")
print(f" status : {session.status}")
if __name__ == '__main__':
labels = [f's{i + 1}' for i in range(SESSION_COUNT)]
print(f'Spawning {SESSION_COUNT} async session(s)\n')
for label in labels:
run_one(label)
```
> [!NOTE]
>
> Once a session is `ready`, connect to it over CDP using the returned `cdp_url`, exactly as you
> would for a standard session. The session honors the same `idle_timeout` and `max_duration`
> settings you passed in the configuration, so make sure to connect before the idle timeout
> elapses.
# Identities
Source: https://docs.anchorbrowser.io/essentials/authenticated-applications
Create and manage identities, then attach them to browser sessions for automatic sign-in.
An **identity** is a specific account on an [application](/essentials/applications) — for example "John's LinkedIn" or "Acme Corp Salesforce admin." When you attach an identity to a session or task, Anchor signs in on your behalf before automation runs.
## What an identity contains
An identity is more than a username and password. After a successful login, Anchor persists everything needed to stay signed in:
| Component | What it stores | Enables |
| - | - | - |
| **Credentials** | Username/password, TOTP secrets, 1Password refs, email MFA mailbox, custom fields — depending on the application's auth flow | Full re-login when the saved session expires |
| **Browser profile** | Cookies, local storage, and session state from the last successful sign-in | Fast startup when the site still considers the session valid |
| **Auth flow** | Which login methods this identity uses (linked from the application) | Consistent login behavior across re-authentication |
| **Status** | Whether the identity is ready to use (`active`, `validated`) or needs attention (`failed`, `agent_failed`) | Knowing if automation can proceed without intervention |
What Anchor can do on the next run depends on what was saved. An identity with **credentials and a valid browser profile** starts signed in immediately. An identity with **only a browser profile** (for example after manual login) works until the site expires the session — then someone must sign in again.
## Quick start: create an identity
Create an identity with credentials for the target application. If the application uses a preset auth flow, pass `authOptionId` with the flow ID.
```javascript node.js theme={null}
import { client, Identities } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const identity = await Identities.createIdentity({
body: {
source: 'https://linkedin.com',
name: 'John Doe',
credentials: [{
type: 'username_password',
username: 'john@example.com',
password: 'secret',
}],
},
});
console.log(identity.id);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser()
identity = anchor_client.identities.create_identity(
source="https://linkedin.com",
name="John Doe",
credentials=[{
"type": "username_password",
"username": "john@example.com",
"password": "secret",
}],
)
print(identity.id)
```
> [!TIP]
>
> For end-user self-service authentication in your app, use [Embedding End-User Authentication UI](/essentials/omniconnect).
## Use an identity in browser sessions
Pass the identity ID in the `identities` array when [creating a session](/api-reference/browser-sessions/start-browser-session). Anchor authenticates before your agent or automation starts.
```javascript node.js theme={null}
const session = await Sessions.createSession({
body: {
session: {
proxy: { active: true },
},
browser: {
captcha_solver: { active: true },
extra_stealth: { active: true },
},
identities: [{ id: identityId }],
},
});
```
```python python theme={null}
session = anchor_client.sessions.create_session(
session={"proxy": {"active": True}},
browser={
"captcha_solver": {"active": True},
"extra_stealth": {"active": True},
},
identities=[{"id": identity_id}],
)
```
Optional session flags:
| Flag | Effect |
| - | - |
| `identity_skip_validation` | Defaults to `true`: reuse the saved profile for active identities. Set `false` to validate the profile and re-authenticate only if it is stale. |
| `identity_async_auth` | Run authentication in the background and return the session immediately |
## Use an identity in tasks
Pass `identity_id` when [running an Automation Task](/tasks/run-a-task). Anchor creates a browser session, authenticates with the identity, then executes the task.
```javascript node.js theme={null}
const run = await Tasks.runTask({
path: { taskId },
body: {
input_params: { report_name: 'Monthly Invoice' },
identity_id: identityId,
},
});
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
run = anchor_client.post(
f'/v2/tasks/{task_id}/run',
body={
'input_params': {'report_name': 'Monthly Invoice'},
'identity_id': identity_id,
},
)
```
You can also pass `session_id` to run a task inside an existing authenticated session. By default (`identity_skip_validation: true`), active identities reuse their saved profile. Pass `identity_skip_validation: false`, or call `POST /v1/identities/{identityId}/reauthenticate`, to validate the profile and re-authenticate if it is stale.
## When Anchor re-authenticates
Each time a session or task starts with an identity attached, Anchor decides whether a full login is needed:
1. **Browser profile is still valid** — Anchor loads the saved profile and the session starts signed in. No login steps run.
2. **Browser profile expired / re-auth requested, credentials available** — Anchor runs the application's auth flow using stored credentials (including MFA methods like email OTP or authenticator). The profile is refreshed for next time.
3. **Browser profile expired, no credentials** — Common for manual-login identities. Anchor cannot re-authenticate automatically. Sign in again via the dashboard or generate a re-authenticate link (see below).
> [!NOTE]
>
> Re-authentication requires the identity to have the credentials or auth flow needed for the site's login steps. If the site adds a new MFA requirement that wasn't saved on the identity, update the identity or re-authenticate manually.
## Generate re-authenticate links
When an identity needs a fresh login, create a token or ready-to-share URL:
| Endpoint | Returns |
| - | - |
| `POST /v1/identities/{identityId}/re-authenticate-token` | JWT token (build your own URL) |
| `POST /v1/identities/{identityId}/reauth-links` | `reauth_url` + `expires_at` |
Both accept an optional request body:
| Field | Description |
| - | - |
| `callbackUrl` | HTTPS redirect after the user finishes |
| `authMethod` | `profile` (manual login, default), `dynauth`, or `credentials` |
Send the user to `https://app.anchorbrowser.io/identity/re-authenticate?token={token}` (or use `reauth_url` from `reauth-links`).
```javascript node.js theme={null}
const { reauth_url } = await client.post(
`/v1/identities/${identityId}/reauth-links`,
{ body: { authMethod: 'dynauth', callbackUrl: 'https://your-app.com/reauth-done' } },
);
window.location.href = reauth_url;
```
```python python theme={null}
response = anchor_client.post(
f"/v1/identities/{identity_id}/reauth-links",
body={
"authMethod": "dynauth",
"callbackUrl": "https://your-app.com/reauth-done",
},
)
reauth_url = response["reauth_url"]
# Redirect the user to reauth_url from your frontend
```
## Identity metadata
Add custom metadata to identities for filtering and organization. Metadata is a flexible key-value store.
### Creating an identity with metadata
```javascript node.js theme={null}
const identity = await Identities.createIdentity({
body: {
source: 'https://linkedin.com',
name: 'John Doe',
metadata: {
department: 'Engineering',
role: 'admin',
},
credentials: [{
type: 'username_password',
username: 'john@example.com',
password: 'secret',
}],
},
});
```
```python python theme={null}
identity = anchor_client.identities.create_identity(
source="https://linkedin.com",
name="John Doe",
metadata={
"department": "Engineering",
"role": "admin",
},
credentials=[{
"type": "username_password",
"username": "john@example.com",
"password": "secret",
}],
)
```
### Filtering identities by metadata
```javascript node.js theme={null}
const identities = await Applications.listApplicationIdentities({
path: { applicationId: app.id },
query: { metadata: JSON.stringify({ department: 'Engineering' }) },
});
```
```python python theme={null}
import json
identities = anchor_client.applications.list_application_identities(
application_id=app.id,
metadata=json.dumps({"department": "Engineering"}),
)
```
## Related
> [card] [Managed Authentication Overview](/essentials/managed-authentication)
>
> Profiles vs identities and how everything connects
> [card] [Applications](/essentials/applications)
>
> Configure target sites and auth flows
> [card] [Run a Task](/tasks/run-a-task)
>
> Execute automation tasks with an identity
> [card] [Embedding End-User Auth UI](/essentials/omniconnect)
>
> Let end users connect accounts from your product
> [card] [Email MFA](/advanced/email-otp)
>
> Email OTP via forwarded inbox
> [card] [API Reference](/api-reference/identities/create-identity)
>
> Identity endpoints
# Control a Browser Session
Source: https://docs.anchorbrowser.io/essentials/control-a-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.
> [card] [Natural language](/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] [Your own code](/quickstart/create-session)
>
> Connect with Playwright or Puppeteer over CDP and write the automation yourself. Full control over every step.
> [card] [REST API](#rest-api)
>
> Call HTTP endpoints for screenshots, page content, PDFs, and perform-web-task — no SDK required.
> [card] [OS-level control](/advanced/os-level-control)
>
> Drive the session with mouse, keyboard, and screen coordinates. Used by computer-use agents and vision models.
## 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.
### 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.
# Managed Authentication
Source: https://docs.anchorbrowser.io/essentials/managed-authentication
Choose between browser profiles and the Applications + Identities model for persistent sign-in across sessions.
Anchor offers two ways to keep browser sessions signed in across runs. Both persist login state, but they differ in how much structure and automation you get.
## Browser profiles vs managed authentication
| | Browser profiles | Managed authentication |
| - | - | - |
| **Setup** | Log in manually once; Anchor saves cookies and storage | Store credentials (or guide a login) on an identity; Anchor re-authenticates when needed |
| **MFA support** | You handle codes yourself during the one-time login | Built-in methods (email OTP, TOTP, 1Password, custom MFA) |
| **Re-auth** | Profile may expire; you log in again manually | Anchor runs the auth flow automatically before each session |
## Browser profiles
Browser profiles persist cookies, local storage, and cache from a session so future sessions can start signed in. Pass `browser.profile` when [creating a session](/quickstart/browser-sessions) — set `persist: true` on first use, log in once, then end the session to save the profile.
```javascript theme={null}
const session = await Sessions.createSession({
body: {
browser: {
profile: { name: 'my-profile', persist: true },
},
},
});
```
Reuse the profile on later sessions by name (omit `persist`). When the target site expires the session, log in again manually — profiles do not store credentials or re-authenticate automatically.
See [Dedicated Sticky IP](/advanced/dedicated-sticky-ip) for fixed-IP profiles and [Browser Sessions](/quickstart/browser-sessions) for full session configuration options.
### Profiles on Mac hardware
A session on Mac hardware (`session.hardware: "mac"`), once the capability is enabled for your project, starts from the profile's saved cookies, localStorage and IndexedDB and, with `persist: true`, writes them back when the session ends. Differences from cloud sessions:
* The state is saved only when the session ends (`DELETE` the session, an idle or maximum-duration timeout, or a `Browser.close` over CDP). Saving a profile from a running session (`source: "session"`) is not supported on Mac hardware.
* Storage of origins the session had open at the end is exported; the saved state of other origins is carried over unchanged. `sessionStorage`, `store_cache` and `reset_preferences` have no effect.
* `GET /v1/profiles/{name}` reports `status: "ready"` once the new state is stored (`in_progress` while the upload is in flight). Poll it before starting the next session on the same profile if you depend on the latest state.
* With `zero_retention` on, nothing is saved, as on cloud sessions.
## How managed authentication works
Managed authentication is built around three concepts:
```mermaid theme={null}
flowchart LR
A["Application target website"] --> B["Auth flow how to log in"]
B --> C["Identity who logs in"]
C --> D["Browser session starts signed in"]
```
1. **Application** — Represents a target website (for example `linkedin.com`). Each application defines how login works and owns its identities.
2. **Auth flow** — Describes *how* login works: which fields to collect, which MFA methods apply, or whether Anchor detects login steps automatically.
3. **Identity** — A specific account on that application. Stores credentials and validated session state. Attach an identity when creating a session and the browser starts already signed in.
## Choose how users log in
When you create an application, choose **how users will log in**. This is the most important configuration step — it determines what Anchor asks for when someone connects an account.
> [card] [Auto-Discovery Auth](/essentials/applications#auto-discovery-auth)
>
> Anchor detects the login page and walks through sign-in automatically. Unpredictable login flows or the fastest setup. Pre-selected for new applications.
> [card] [Preset authentication](/essentials/applications#preset-authentication)
>
> You define the exact fields and MFA methods (username/password, email OTP, authenticator, etc.). When you know the login steps in advance.
> [card] [Manual authentication](/essentials/applications#manual-authentication)
>
> Anchor opens a browser and the user signs in themselves. Unsupported login methods or a hands-on browser experience.
See [Applications](/essentials/applications) for dashboard and API setup for each mode, authentication methods, and [further application setup](/essentials/applications#further-application-setup) (proxy, sticky IP, browser session defaults).
## End-to-end flow
**1. Create an application**
Define the target website. See [Applications](/essentials/applications).
**2. Choose how users log in**
Pick auto-discovery, preset, or manual authentication. With preset, define auth flows and MFA methods.
**3. Configure defaults (optional)**
Set network routing, proxy, sticky IP, and browser session defaults for all identities under the application.
**4. Create an identity**
Store credentials or complete a guided login for a specific account. See [Identities](/essentials/authenticated-applications).
**5. Launch authenticated sessions**
Pass the identity ID when creating a session. Anchor authenticates before your agent or automation runs.
```javascript theme={null}
const session = await Sessions.createSession({
body: {
identities: [{ id: identityId }],
},
});
```
## Related
> [card] [Applications](/essentials/applications)
>
> Auth modes, authentication methods, and application defaults
> [card] [Identities](/essentials/authenticated-applications)
>
> Create accounts and launch signed-in sessions
> [card] [Embedding End-User Auth UI](/essentials/omniconnect)
>
> Let your users connect accounts from your product
# Embedding End-User Authentication UI
Source: https://docs.anchorbrowser.io/essentials/omniconnect
Anchor's embeddable flow so your end users can sign in to third-party sites from your product; identities power [authenticated browser sessions](/essentials/managed-authentication).
This flow is the end-to-end experience: your backend mints a short-lived link, the user completes sign-in on Anchor's hosted UI, and your app receives the new identity on callback. The steps below are the integration contract.
## Prerequisites
Before integrating the embedded identity UI, ensure the following are configured:
1. **[Create an Application](/essentials/applications)** — Define the target website users will authenticate to via the Anchor Dashboard or API.
2. **Authentication flows** — You **do not** need to manually add an auth flow for this embedded flow. New applications include a default **Auto-Discovery Auth** flow: the end user signs in through a guided browser experience while Anchor detects the site's login steps and persists the resulting identity. Add or edit flows in the dashboard or API only when you need fixed credential forms (for example username/password templates), extra methods (authenticator, custom fields), or multiple named login paths.
## Overview
**1. Generate a Token**
Create a one-time token that authorizes the identity creation flow.
```javascript node.js theme={null}
import { client, Applications } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
// Generate a token for identity creation
const tokenResponse = await Applications.createIdentityToken({
path: { applicationId: 'your-application-id' },
body: { callbackUrl: 'https://your-app.com/identity-callback' }
});
console.log(tokenResponse.token);
// Use this token to redirect the user
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser()
# Generate a token for identity creation
token_response = anchor_client.applications.create_identity_token(
application_id="your-application-id",
callback_url="https://your-app.com/identity-callback"
)
print(token_response.token)
# Use this token to redirect the user
```
> [!WARNING]
>
> The `callbackUrl` must use HTTPS. Store the token securely and use it immediately - tokens are single-use and expire
> after 15 minutes.
**2. Redirect User to Identity Creation**
Redirect the user to the Anchor identity creation page with the generated token:
```
https://app.anchorbrowser.io/identity/create?token={token}
```
```javascript Frontend (React) theme={null}
function CreateIdentityButton({ token }) {
const handleClick = () => {
window.location.href = `https://app.anchorbrowser.io/identity/create?token=${token}`;
};
return ;
}
```
After the user finishes, Anchor shows a success step. When they continue (or close), the browser is sent to your `callbackUrl` with the new identity.
> [!TIP]
>
> Use a `callbackUrl` **without** an existing query string. The redirect always appends `?identity_id=…&status=success` (see below).
**3. Handle the Callback**
Anchor redirects to your `callbackUrl` using **snake\_case** query parameters:
```
https://your-app.com/identity-callback?identity_id={identity_id}&status=success
```
Read `identity_id` on your server. `status` is `success` when the identity was created.
```javascript Express.js theme={null}
app.get('/identity-callback', async (req, res) => {
const identityId = req.query.identity_id;
const status = req.query.status;
if (status !== 'success' || typeof identityId !== 'string' || !identityId) {
return res.status(400).send('Missing or invalid callback parameters');
}
// Store the mapping between the user and the Anchor identity
await saveUserIdentityMapping(req.user.id, identityId);
// Optionally, update the identity with an external user ID
res.redirect('/dashboard?connected=true');
});
```
```python Flask theme={null}
@app.route('/identity-callback')
def identity_callback():
identity_id = request.args.get('identity_id')
status = request.args.get('status')
if status != 'success' or not identity_id:
return 'Missing or invalid callback parameters', 400
# Store the mapping between the user and the Anchor identity
save_user_identity_mapping(current_user.id, identity_id)
# Optionally, update the identity with an external user ID (See next step)
return redirect('/dashboard?connected=true')
```
If you open the identity flow in a **popup** (`window.open`) instead of a full redirect, the Anchor page may notify the opener with `postMessage` (`type: 'identity-created'`, `identityId`). Validate `event.origin` before trusting the message; the HTTPS callback remains the most reliable way to persist the mapping server-side.
**4. Update Identity Metadata (Optional)**
Update the identity with additional metadata to maintain a mapping between users and their Anchor identities:
```javascript node.js theme={null}
import { client, Identities } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
// Update identity with external user ID
const updatedIdentity = await Identities.updateIdentity({
path: { identityId: 'your-identity-id' },
body: {
name: 'User Display Name',
metadata: {
externalUserId: 'your-user-id-123',
plan: 'premium',
connectedAt: new Date().toISOString(),
},
},
});
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser()
# Update identity with external user ID
updated_identity = anchor_client.identities.update_identity(
identity_id='your-identity-id',
name="User Display Name",
metadata={
"externalUserId": "your-user-id-123",
"plan": "premium",
"connectedAt": datetime.now().isoformat()
}
)
```
**5. Create Authenticated Sessions**
Once an identity ID is available, use it to create authenticated browser sessions:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const identityId = "your-identity-id";
const session = await Sessions.createSession({
body: {
// Recommended settings for authenticated sessions.
session: {
proxy: {
active: true,
}
},
browser: {
captcha_solver: {
active: true,
},
extra_stealth: {
active: true,
}
},
// Identity to authenticate with.
identities: [{ id: identityId }]
}
});
console.log(session.data.id);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser()
identity_id = "your-identity-id"
session = anchor_client.sessions.create_session(
# Recommended settings for authenticated sessions.
session={
"proxy": {
"active": True,
}
},
browser={
"captcha_solver": {
"active": True,
},
"extra_stealth": {
"active": True,
}
},
# Identity to authenticate with.
identities=[{"id": identity_id}]
)
print(session.data.id)
```
The browser session will automatically be authenticated to the target website using the stored identity.
## See it in action
Try this flow on the live demo: **[demo.anchorbrowser.io](https://demo.anchorbrowser.io)** — connect an account from the chat UI, then run automations.
The full app is open source: **[github.com/anchorbrowser/chat-demo](https://github.com/anchorbrowser/chat-demo)** (Next.js, Anchorbrowser Node SDK, WorkOS AuthKit). Clone it and follow the README for `ANCHORBROWSER_API_KEY`, and callback base URL.
The demo matches the integration described above:
* **`applications.createIdentityToken(applicationId, { callbackUrl })`** - see [`src/lib/anchorbrowser.ts`](https://github.com/anchorbrowser/chat-demo/blob/main/src/lib/anchorbrowser.ts).
* **Redirect URL** - `getIdentityCreationUrl` builds `https://app.anchorbrowser.io/identity/create?token=…` (override with `ANCHORBROWSER_APP_URL` when needed).
* **Callback** - [Identity callback route](https://github.com/anchorbrowser/chat-demo/blob/main/src/app/api/identity-callback/%5BconversationId%5D/route.ts) (`src/app/api/identity-callback/[conversationId]/route.ts`) reads `identity_id` from the query string (with a fallback for legacy `identityId`), then tags the identity and creates a session.
* **Sessions** - `sessions.create` passes **`identities` at the top level** next to `browser` and `session`; the SDK wraps the session payload in **`response.data`** (the demo returns `response.data` and uses `id` / `live_view_url` from that object - same data as `session.data` in the snippets earlier on this page).
* **Popup option** - [`src/components/identity-popup.tsx`](https://github.com/anchorbrowser/chat-demo/blob/main/src/components/identity-popup.tsx) listens for `postMessage` with `type: 'identity-created'`; the HTTPS callback remains the source of truth for persistence.
Tool wiring (when to mint tokens and connection URLs) lives in [`src/lib/tools.ts`](https://github.com/anchorbrowser/chat-demo/blob/main/src/lib/tools.ts).
## Best Practices
> [card] Secure Token Handling
>
> Generate tokens server-side and never expose your API key to the frontend. Tokens are single-use and should be used immediately.
> [card] Store Identity Mappings
>
> Maintain a mapping between your users and their Anchor identity IDs in your database for future session creation.
> [card] Use Metadata
>
> Store your external user ID in the identity metadata to easily correlate identities with your users.
> [card] Handle Errors
>
> Implement proper error handling for cases where identity creation fails or the user cancels the flow.
## Related Resources
* [Chat demo (live)](https://demo.anchorbrowser.io) and [chat-demo source](https://github.com/anchorbrowser/chat-demo) - reference implementation for this guide
* [Managed Authentication](/essentials/managed-authentication) - Overview of profiles vs identities
* [Applications](/essentials/applications) - Define target websites and authentication flows
* [Identities](/essentials/authenticated-applications) - Create pre-authenticated browser sessions
# Session Recording
Source: https://docs.anchorbrowser.io/essentials/recording
Record browser sessions for debugging, analysis, and documentation
## Overview
Anchor Browser provides built-in session recording that allows you to capture and review browser sessions. This feature is invaluable for debugging automation workflows, analyzing user behavior, and creating documentation.
## How It Works
Anchor Browser automatically records browser sessions and creates an MP4 video file that captures the complete visual experience.
Recordings are accessible both through our API and the web UI (see below).
**SDK Usage**
# SDK Usage
## Record a Session
Recording is enabled by default when creating a session.
Start a session using the [SDK](/quickstart/use-via-sdk), you can enable recording by setting:
`recording` -> `active` -> `true` in the request body.
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const response = await Sessions.createSession({
body: {
session: {
recording: {
active: true // Enable recording (default)
}
}
}
});
const sessionId = response.data.id
console.log("Session created:", response.data);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
response = anchor_client.sessions.create_session(
session={
"recording": {
"active": True # Enable recording (default)
}
}
)
session_id = response.data.id
print("Session created:", session_id)
```
## Get Session Recordings
Retrieve recordings for a specific session:
```javascript node.js theme={null}
import { client, Recordings } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const recordings = await Recordings.listRecordings({
path: { session_id: sessionId }
});
console.log("Recordings:", recordings.data);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
recordings = anchor_client.recordings.list_recordings(session_id)
print("Recordings:", recordings.data)
```
## Download Recording
Download a specific recording file:
```javascript node.js theme={null}
import { client, Recordings } from 'anchorbrowser';
import { writeFile } from 'node:fs/promises';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
// const sessionId = 'your-session-id'; // Replace with actual session ID
const recording = await Recordings.fetchPrimaryRecording({
path: { session_id: sessionId }
});
// Save to file
const buffer = await recording.arrayBuffer();
await writeFile(`recording-${sessionId}.mp4`, Buffer.from(buffer));
console.log(`Recording saved as recording-${sessionId}.mp4`);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "your-session-id" # Replace with actual session ID
recording = anchor_client.recordings.fetch_primary_recording(session_id)
# Save to file
with open(f"recording-{session_id}.mp4", "wb") as f:
for chunk in recording.iter_bytes(chunk_size=8192):
f.write(chunk)
print(f"Recording saved as recording-{session_id}.mp4")
```
## Delete Recording
Delete a specific recording from a session. Use `"primary"` as the recording ID to delete the primary recording.
```javascript node.js theme={null}
import { client, Recordings } from 'anchorbrowser';
(async () => {
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const sessionId = 'your-session-id'; // Replace with actual session ID
const recordingId = 'primary'; // Or use a specific recording ID
const response = await Recordings.deleteRecording({
path: { session_id: sessionId, recording_id: recordingId }
});
console.log("Recording deleted:", response.data);
})().catch(console.error);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session_id = "your-session-id" # Replace with actual session ID
recording_id = "primary" # Or use a specific recording ID
response = anchor_client.recordings.delete_recording(session_id, recording_id)
print("Recording deleted:", response.data)
```
**Web UI Usage**
# Web UI Usage
## Create a Session
In order to create a session through the UI with recording enabled use the [playground](https://app.anchorbrowser.io/playground), it will be recorded by default.

## Session Recordings
The Session History dashboard shows all sessions. Each session has a link to its recording.
> [!WARNING]
>
> If a session is still running, the link in the session history page will take you to the session's live view instead of the recording. Once the session ends, the link will point to the recording.

## Recording Playback
When you click on a session recording, the playback interface will be opened.
You can use it to view the recording, navigate through it, and download it as MP4 file.

# Extra Stealth Mode
Source: https://docs.anchorbrowser.io/essentials/stealth
Advanced anti-detection and browser fingerprinting protection for automated browsing
Anchor Browser provides built-in stealth capabilities that help avoid detection by anti-bot systems and website fingerprinting. These features enable automated browsing that mimics human behavior and bypasses common detection mechanisms.
Extra Stealth mode is available on the [Growth plan](https://app.anchorbrowser.io/billing).
## What is Extra Stealth Mode?
Extra Stealth Mode leverages a specialized Chrome browser environment that provides:
* 🔒 **Advanced Anti-Detection** - Bypass sophisticated bot detection systems and CAPTCHAs
* 🛡️ **Automation Consistency** - Maintain consistent access without getting blocked
* 👤 **Human-Like Behavior** - Mimic real user patterns to avoid suspicion
> [!NOTE]
>
> Alternative Cloudflare-verified access to webpages is available through our [Cloudflare Web Bot Auth Integration](/advanced/cloudflare-web-bot-auth).
## Quick start - Enable stealth features
**1. Create a session with extra stealth enabled**
Create a browser session with extra stealth features enabled using the SDK:
> [!WARNING]
>
> Extra stealth mode requires proxy configuration to be active. **If proxy is disabled, extra stealth will be automatically disabled** by the system.
>
> Read more about [Proxy Configuration](/advanced/proxy)
```JavaScript node.js theme={null}
import { client, Sessions } from "anchorbrowser";
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY })
const session = await Sessions.createSession({
body: {
browser: {
extra_stealth: {
active: true
}
},
session: {
proxy: {
active: true
}
}
}
});
console.log(session);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchorClient = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchorClient.sessions.create_session(
browser={
"extra_stealth": {
"active": True
}
},
session={
"proxy": {
"active": True
}
}
)
print(session)
```
**2. Use the session for automated browsing**
Once your stealth session is created, you can use it for automated browsing that bypasses common detection mechanisms:
```JavaScript node.js theme={null}
import { client, Sessions, agentTask } from "anchorbrowser";
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY })
// Create stealth session
const session = await Sessions.createSession({
body: {
browser: {
extra_stealth: {
active: true
}
},
session: {
proxy: {
active: true
}
}
}
})
// Use the session for automated tasks
const result = await agentTask(
"Navigate to a website and check if I'm detected as a bot",
{
sessionId: session.data.id
}
);
console.log(result);
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchorClient = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
# Create stealth session
session = anchorClient.sessions.create_session(
browser={
"extra_stealth": {
"active": True
}
},
session={
"proxy": {
"active": True
}
}
)
# Use the session for automated tasks
result = anchorClient.agent.task(
session_options=session,
prompt="Navigate to a website and check if I'm detected as a bot"
)
print(result)
```
## Using stealth with tasks
Save stealth settings on the task via `task_default_browser_configuration` — a **one-time setup**. Include `browser.extra_stealth` and an active `session.proxy` (required):
```bash theme={null}
curl -X PATCH "https://api.anchorbrowser.io/v1/tools/{toolId}" \
-H "anchor-api-key: $ANCHOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task_default_browser_configuration": {
"browser": { "extra_stealth": { "active": true } },
"session": { "proxy": { "active": true } }
}
}'
```
> [!NOTE]
>
> If you pass a `session_id` to `/run`, that session's config is used instead. See [Run a Task](/tasks/run-a-task#task-config-vs-session-config).
## Usage with Profiles
Use stealth mode with saved browser profiles for persistent authenticated sessions:
```JavaScript node.js theme={null}
import { client, Sessions } from "anchorbrowser";
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY })
const session = await Sessions.createSession({
body: {
browser: {
extra_stealth: {
active: true
},
profile: {
name: 'stealth-profile',
persist: true // Only on Profile Creation
}
},
session: {
proxy: {
active: true
}
}
}
})
console.log(session)
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchorClient = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchorClient.sessions.create_session(
browser={
"extra_stealth": {
"active": True
},
"profile": {
"name": "stealth-profile",
"persist": true # Only on Profile Creation
}
},
session={
"proxy": {
"active": True
}
}
)
print(session)
```
## Enabling Console Logs
> [!WARNING]
>
> When extra stealth mode is enabled, `page.on('console')` events are **disabled by default** to prevent detection. If you need to capture console output, you must explicitly enable it.
To receive console log events while using extra stealth, enable `console_logs` in your session configuration:
```javascript node.js theme={null}
import { client, Sessions, connectBrowser } from "anchorbrowser";
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession({
body: {
browser: {
extra_stealth: { active: true },
console_logs: { active: true }
},
session: {
proxy: { active: true }
}
}
});
// Connect to the browser
const browser = await connectBrowser(session.data.id);
const context = browser.contexts()[0];
const page = context.pages()[0];
// Now page.on('console') will work
page.on('console', (msg) => {
console.log(`[${msg.type()}] ${msg.text()}`);
});
await page.goto("https://example.com");
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
session = anchor_client.sessions.create_session(
browser={
"extra_stealth": {"active": True},
"console_logs": {"active": True}
},
session={
"proxy": {"active": True}
}
)
# Connect to the browser
with anchor_client.browser.connect(session.data.id) as browser:
context = browser.contexts[0]
page = context.pages[0]
# Now page.on('console') will work
def handle_console(msg):
print(f"[{msg.type}] {msg.text}")
page.on("console", handle_console)
page.goto("https://example.com")
```
## Catching Captcha Events
When using stealth mode with captcha solving enabled, you can listen to captcha lifecycle events via CDP (Chrome DevTools Protocol). This allows you to track when captchas are detected, solved, or failed.
```javascript node.js theme={null}
import { client as anchorClient, Sessions, connectBrowser } from "anchorbrowser";
anchorClient.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
// Create a session with extra stealth and captcha solving enabled
const session = await Sessions.createSession({
body: {
browser: {
extra_stealth: { active: true },
captcha_solver: { active: true }
},
session: {
proxy: { active: true }
}
}
});
// Connect to the browser
const browser = await connectBrowser(session.data.id);
const context = browser.contexts()[0];
const page = context.pages()[0];
// Create CDP session and listen to captcha events
const client = await context.newCDPSession(page);
client.on('Captcha.lifecycle', (event) => {
if (event.name === 'detected') {
console.log(`${event.captchaType} captcha detected on ${event.url}`);
if (event.captchaType === 'recaptcha') {
// 'invisible' (badge, may auto-pass) or 'checkbox'
console.log(`reCAPTCHA variant: ${event.variant}`);
}
}
if (event.name === 'solved') {
console.log(`Captcha solved in ${event.timeToSolve}ms`);
if (event.captchaType === 'recaptcha') {
console.log(event.puzzle ? 'An image puzzle was solved' : 'Passed without a puzzle');
}
}
if (event.name === 'failed') {
console.log(`Captcha failed: ${event.error}`);
}
});
// Navigate to a page with captcha
await page.goto("https://example.com");
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
# Create a session with extra stealth and captcha solving enabled
session = anchor_client.sessions.create_session(
browser={
"extra_stealth": {"active": True},
"captcha_solver": {"active": True}
},
session={
"proxy": {"active": True}
}
)
# Connect to the browser
with anchor_client.browser.connect(session.data.id) as browser:
context = browser.contexts[0]
page = context.pages[0]
# Create CDP session and listen to captcha events
client = context.new_cdp_session(page)
def handle_captcha_event(event):
if event["name"] == "detected":
print(f"{event['captchaType']} captcha detected on {event['url']}")
if event["captchaType"] == "recaptcha":
# 'invisible' (badge, may auto-pass) or 'checkbox'
print(f"reCAPTCHA variant: {event['variant']}")
if event["name"] == "solved":
print(f"Captcha solved in {event['timeToSolve']}ms")
if event["captchaType"] == "recaptcha":
print("An image puzzle was solved" if event["puzzle"] else "Passed without a puzzle")
if event["name"] == "failed":
print(f"Captcha failed: {event['error']}")
client.on("Captcha.lifecycle", handle_captcha_event)
# Navigate to a page with captcha
page.goto("https://example.com")
```
### Event Types
Every event carries `captchaType`, `url`, `pageId` and `timestamp`. `captchaType` is one of `cloudflare`, `recaptcha`, `funcaptcha`, `datadome`, `kasada`, `akamai`, `hcaptcha`, `altcha` or `perimeterx` (the HUMAN "Press & Hold" challenge, solved automatically; a `failed` event carries the reason).
| Event Name | Description | Additional Properties |
| - | - | - |
| `detected` | Fired when a captcha is detected on the page | `variant` (reCAPTCHA and PerimeterX) |
| `solved` | Fired when the captcha is successfully solved | `timeToSolve` (in milliseconds), `variant` (reCAPTCHA and PerimeterX), `puzzle` (reCAPTCHA only) |
| `failed` | Fired when captcha solving fails | `error`, `variant` (reCAPTCHA and PerimeterX), `puzzle` (reCAPTCHA only) |
### reCAPTCHA Properties
reCAPTCHA events (`captchaType: 'recaptcha'`) carry two extra properties, so you can tell a widget that may pass silently from one that needs an image puzzle:
| Property | Values | Description |
| - | - | - |
| `variant` | `'invisible'`, `'checkbox'` | The widget kind, taken from the rendered widget's own frame (or its `data-size` markup), so it is available from `detected` onwards. Where a page's markup contradicts how it renders the widget, `solved` / `failed` reflect the rendered widget. `invisible` covers the badge and reCAPTCHA v3, which often pass with no visible challenge. `checkbox` covers the "I'm not a robot" widget (normal and compact sizes). |
| `puzzle` | `true`, `false` | On `solved` and `failed`: whether an image-selection puzzle was shown before the outcome. Both variants can escalate to a puzzle, so `variant` tells you what was rendered and `puzzle` tells you what actually happened. |
### PerimeterX Properties
PerimeterX events (`captchaType: 'perimeterx'`) carry `variant`, which tells you whether the challenge stood between you and the page at all:
| Property | Values | Description |
| - | - | - |
| `variant` | `'block_page'`, `'inline'` | `block_page` is the hosted "Access to this page has been denied" page served in place of the content (HTTP 403); solving it is what gets you the page. `inline` is a Press & Hold widget rendered on a page that already loaded (HTTP 200), typically gating an action such as a search or a login rather than the page itself. The Web Unlocker holds a fetch, and fails it with `422`, only for `block_page`; an `inline` challenge never delays or fails a fetch. |
### DataDome Properties
DataDome (`captchaType: 'datadome'`) serves a slider in place of the page. The slider widget accepts a slide before DataDome has decided whether to honour it, so the browser reports the outcome of the page that follows rather than the widget's own green state:
* `solved` fires once the page served after the accepted slide is not a DataDome block (a few seconds after the widget turns green, so the page you get afterwards is the content, not another challenge).
* A slide the widget refuses ("The position of the slider is not correct") is retried without any event: DataDome serves a fresh slider within a couple of seconds and the retry usually passes.
* `failed` fires only when the challenge is over, with the reason in `error`:
| `error` | Meaning |
| - | - |
| `blocked` | DataDome served its "Access is temporarily restricted" page instead of a slider; the exit IP is blocked for this site. |
| `blocked_after_solve` | The slide was accepted but the page served next was still a DataDome block. A 403 from the site itself, without DataDome's headers or cookie, is not counted as a block. |
| `drag_cap_reached` | Six slides within two minutes did not get through on this page; the browser stops retrying. |
| `fail` | The slide was refused and DataDome did not serve a new slider within 15 seconds. |
## Session warm-up
Some sites show a login or sign-up wall to a browser they have never seen, even with stealth on: they check whether this browser has already run their own scripts once, on the IP it is using now. Turn on `browser.warm_up` and the session loads the site's homepage once before it is handed to you, so your first navigation arrives with a jar those checks accept. On a warmed session, a direct navigation to that site also carries a search-engine referer; see **Entering the site** below. LinkedIn is the site covered today.
> [!WARNING]
>
> A warmed session needs both blockers off: `browser.adblock.active: false` and `browser.popup_blocker.active: false`. They stop the third-party analytics scripts these sites use to recognise a returning browser, so a warm-up under a blocker leaves no trace; the API rejects a `warm_up` request that leaves either one on.
```JavaScript node.js theme={null}
const session = await Sessions.createSession({
body: {
browser: {
warm_up: { active: true },
adblock: { active: false },
popup_blocker: { active: false },
extra_stealth: { active: true }
},
session: {
proxy: { active: true }
}
}
});
```
```python python theme={null}
session = anchorClient.sessions.create_session(
browser={
"warm_up": {"active": True},
"adblock": {"active": False},
"popup_blocker": {"active": False},
"extra_stealth": {"active": True}
},
session={
"proxy": {"active": True}
}
)
```
The warm-up runs before the create-session call returns and adds about ten seconds to session creation; that time counts toward the session's duration. It loads the page in the session's first tab, which is left blank afterwards.
> [!NOTE]
>
> **Entering the site.** Some sites, LinkedIn among them, show a public page to a visitor arriving from a search result and wall the same browser on a direct navigation. On a warmed session the browser handles this for you: a direct navigation to the warm-up's site carries a search referer, whether it comes from `page.goto(profileUrl)`, the agent, or a URL typed into the address bar in the live view. Landing still depends on the reputation of the exit IP the session was given, and a new session gets a new exit.
The warm-up also makes one request to `ipinfo.io` through the session's exit to record which IP the session used; it counts as session traffic like the rest of the warm-up.
# Buyer Intent Discovery
Source: https://docs.anchorbrowser.io/examples/buyer-intent
The following example use-case shows how to find buyer-intent data from Hacker News' monthly *"Ask HN: Who is hiring?"* thread. A company that is actively hiring data engineers is a strong signal of buying intent in the data pipelines space.
```tsx node.js theme={null}
const result = await agentTask(
`Open the most recent "Ask HN: Who is hiring?" story from the search results.
In that thread, scan the top-level comments and find companies hiring for data
engineering or data platform roles. For each match, collect the company name,
the role title, the location, and an application link if one is present.
Return a JSON array: [{ "company": "...", "role": "...", "location": "...", "url": "..." }].`,
{
taskOptions: {
url: 'https://hn.algolia.com/?query=Ask%20HN%3A%20Who%20is%20hiring&sort=byDate&type=story',
}
}
)
console.log(result);
```
```python python theme={null}
result = anchor_client.agent.task(
'''Open the most recent "Ask HN: Who is hiring?" story from the search results.
In that thread, scan the top-level comments and find companies hiring for data
engineering or data platform roles. For each match, collect the company name,
the role title, the location, and an application link if one is present.
Return a JSON array: [{ "company": "...", "role": "...", "location": "...", "url": "..." }].''',
task_options={
'url': 'https://hn.algolia.com/?query=Ask%20HN%3A%20Who%20is%20hiring&sort=byDate&type=story',
}
)
print(result)
```
# Configuration Collection
Source: https://docs.anchorbrowser.io/examples/configuration-collection
The following example shows how to collect configuration data that is not exposed through an API from a SaaS service (Grafana) configuration page.
```tsx node.js theme={null}
const result = await agentTask(
'Collect the node names and their CPU average %, return in JSON array',
{
taskOptions: {
url: 'https://play.grafana.org/a/grafana-k8s-app/navigation/nodes',
}
}
)
console.log(result);
```
```python python theme={null}
result = anchor_client.agent.task(
'Collect the node names and their CPU average %, return in JSON array',
task_options={
'url': 'https://play.grafana.org/a/grafana-k8s-app/navigation/nodes',
}
)
print(result)
```
# Form Filling Automation
Source: https://docs.anchorbrowser.io/examples/form-filling
The following example shows form filling, including the ability to self-complete missing data in the form filling process.
```tsx node.js theme={null}
const result = await agentTask(
`Go to https://www.wix.com/demone2/nicol-rider, read the resume,
understand the details, and complete the form at
https://formspree.io/library/donation/charity-donation-form/preview.html
as if you were her. Limit the donation to $10.`
)
console.log(result);
```
```python python theme={null}
result = anchor_client.agent.task(
'''Go to https://www.wix.com/demone2/nicol-rider, read the resume,
understand the details, and complete the form at
https://formspree.io/library/donation/charity-donation-form/preview.html
as if you were her. Limit the donation to $10.'''
)
print(result)
```
# Deep Research
Source: https://docs.anchorbrowser.io/examples/research-task
The following example demonstrates how to use Anchor Browser to perform web research tasks.
```tsx node.js theme={null}
import { Sessions, agentTask } from 'anchorbrowser';
const session = await Sessions.createSession()
const sessionId = session.data?.id
const result = await agentTask(
`Find the most recent NBA game played by the Milwaukee Bucks
and provide the result.`,
{
taskOptions: {
url: 'https://nba.com/',
},
sessionId: sessionId,
}
)
console.log(result)
const author = await agentTask(
`Find an article discussing the game and provide the author's name.`,
{
sessionId: sessionId,
}
)
console.log(author)
```
```python python theme={null}
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser()
session = anchor_client.sessions.create_session()
session_id = session.data.id
result = anchor_client.agent.task(
'''Find the most recent NBA game played by the Milwaukee Bucks
and provide the result.''',
task_options={
'url': 'https://nba.com/',
},
session_id=session_id,
)
print(result)
author = anchor_client.agent.task(
'Find an article discussing the game and provide the author\'s name.',
session_id=session_id,
)
print(author)
```
# Task Examples
Source: https://docs.anchorbrowser.io/examples/task-examples
Browse ready-made task examples in the Anchor library.
Explore pre-built browser automation tasks you can run, fork, and adapt in the Anchor library.
> [card] [Anchor Task Library](https://app.anchorbrowser.io/library)
>
> Browse task examples — form filling, data extraction, research, and more.
# 1Password
Source: https://docs.anchorbrowser.io/integrations/1password
Securely inject 1Password secrets into your browser sessions
## Overview
The 1Password integration **enables your AI agent to securely authenticate with services** during browser automation by injecting secrets, credentials, and other sensitive data from your 1Password vaults directly into your Anchor Browser sessions. This gives your AI agent the ability to log into websites, access APIs, and perform authenticated actions **without you needing to hardcode credentials** in your automation scripts.
> [!NOTE]
>
> The actual secret values are **never exposed** to the AI agent, logs, API responses, or any other output
## Prerequisites
Before you can use the 1Password integration, you need:
1. **1Password Account**: An active 1Password account with access to the secrets you want to use in a vault different than “Personal”.
2. **Anchor Browser API Key**: Your Anchor Browser API key for authentication
## Getting a 1Password Service Account Token
1. Log in to your [1Password account](https://my.1password.com/)
2. Navigate to **Developer** → **Directory** → **Service Accounts**
3. Click **Create Service Account**
4. Give your service account a descriptive name (e.g., "Anchor Browser Automation")
5. Grant the service account access to the vaults containing the secrets you need
6. Copy the service account token (starts with `ops_`) - you'll need this for the integration setup
> [!WARNING]
>
> Store your service account token securely. It provides access to your
> 1Password secrets and should be treated like a password.
## Using 1Password as an Identity Auth Method
In addition to injecting raw secrets as environment variables (described above), 1Password can back an **Identity** — the credentials Anchor uses to log your AI agent into a specific application. This is configured per identity in the **Create / Update Identity** flow, not on the team Integrations page.
When you select 1Password as the auth method for an identity, you provide a **service account token** and Anchor resolves the login credentials for you. There are two ways credentials are discovered:
> [!NOTE]
>
> The service account token is entered directly in the identity creation form. See [Getting a 1Password Service Account Token](#getting-a-1password-service-account-token), or create one directly at [the 1Password service account page](https://my.1password.com/developer-tools/infrastructure-secrets/serviceaccount).
### Domain Discovery Mode
In **domain discovery mode**, you only provide the service account token. Anchor automatically finds the 1Password login item whose website matches the application's domain and uses its fields (username, password, one-time password, etc.) to authenticate.
* No `op://` references are required — just grant the service account access to the relevant vault.
* This is the default when the auth flow does not define explicit reference fields.
### Reference Mode
In **reference mode**, you supply explicit [1Password secret references](#1password-secret-reference-format) (`op://vault/item/field`) for each field the auth flow requires. Use this when domain discovery is ambiguous or when the credentials live in a differently-named item.
### One-Time Passwords (TOTP / 2FA)
If the matched 1Password item or a referenced field contains a **one-time password** field — Anchor resolves the code **at runtime, the moment the agent reaches the 2FA step**.
> [!NOTE]
>
> The service account token is never exposed to the AI agent.
## 1Password Secret Reference Format
1Password uses a specific format for secret references:
```
op://[vault]/[item]/[field]
```
* **vault**: The name of your 1Password vault
* **item**: The name of the item in the vault
* **field**: The specific field within the item
### Examples
```
op://Production/AWS Credentials/access_key_id
op://Development/GitHub/personal_access_token
op://Shared/Stripe/api_key
```
## Support
For additional help with 1Password integration:
* [1Password Service Accounts Documentation](https://developer.1password.com/docs/service-accounts/)
* Contact Anchor Browser support at [support@anchorbrowser.io](mailto:support@anchorbrowser.io)
# Agentcard
Source: https://docs.anchorbrowser.io/integrations/agentcard
Let an agent pay with your user's own card inside an Anchor session.
[Agentcard](https://agentcard.com) lets an agent running in an Anchor session pay with your user's real card. The card never reaches the agent, the task text, or your servers.
The agent types a placeholder card at checkout. The Agentcard SDK, attached to the session, holds the payment request, and the user approves it on their phone with a passkey. Their device swaps in the real card, and the order completes.
## What you need
* An Anchor API key, in `ANCHORBROWSER_API_KEY`.
* An Agentcard `client_id` and `client_secret`, from the [Agentcard dashboard](https://app.agentcard.sh).
* A user who has stored a card in the Agentcard Vault, and the `user_id` you received when they stored it. See [Adding a card](https://docs.agentcard.com/vault/adding-a-card).
## Install
```bash theme={null}
npm i @agent-cards/sdk anchorbrowser playwright
```
Use `@agent-cards/sdk` 0.20.0 or later. Earlier versions, published under the older name `@agent-cards/checkout`, refuse a page that has Anchor's extensions on it.
## Attach Agentcard to a session
Create a session, then attach Agentcard to its page before your agent reaches the payment form.
```ts theme={null}
import { createBrowser } from 'anchorbrowser';
import { VaultClient, attachToPlaywright } from '@agent-cards/sdk';
const { browser, session } = await createBrowser();
const page = browser.contexts()[0].pages()[0];
const vault = new VaultClient({
clientId: process.env.AGENTCARD_CLIENT_ID!,
clientSecret: process.env.AGENTCARD_CLIENT_SECRET!,
});
await vault.syncRegistry();
await attachToPlaywright(page, {
vault,
user: 'usr_8f3k2m', // the user whose card pays
merchant: 'shop.agentcard.sh', // the store's domain
amount: 583, // cents, the total the user approves
currency: 'usd',
onApprovalUrl: (url) => sendToUser(url), // your own push or in-app message
});
// Now let your agent shop on this page.
await page.goto('https://shop.agentcard.sh');
```
`syncRegistry()` loads the list of payment processors the SDK can hold. Call it once per client.
`onApprovalUrl` receives a link to the user's approval screen. Send it from your own app, and keep it out of your logs: only the user should open it.
## With Anchor's agent
Pass the same `sessionId` to `agentTask`, so the agent shops in the session Agentcard is attached to. A task created without `sessionId` runs in a new browser where the SDK is not attached, the store receives the placeholder card, and the purchase fails.
```ts theme={null}
import { createBrowser, agentTask, Sessions } from 'anchorbrowser';
const { browser, session } = await createBrowser();
const sessionId = session.data?.id;
if (!sessionId) throw new Error('Anchor returned no session id');
const placeholderCard = process.env.PLACEHOLDER_CARD_NUMBER!;
// Attach Agentcard to every page in the session, as above, before the task starts.
try {
const result = await agentTask(
`Buy one Enamel Camp Mug. Pay with card ${placeholderCard}, expiry 12/34, CVC 123, and click Pay once. ` +
`The payment then waits for the cardholder to approve on their phone. Do not click Pay again. ` +
`Wait until the page shows the order is paid.`,
{ sessionId, taskOptions: { url: 'https://shop.agentcard.sh' } },
);
console.log(result.data.result);
} finally {
await Sessions.deleteSession({ path: { session_id: sessionId } }).catch(console.error);
}
```
Two things to tell the agent in the task: the placeholder card to type, and that the payment waits for the cardholder after Pay, so it does not click Pay a second time while the user approves. Keep the approval link out of the task, because the agent reads the task.
The agent's summary is not proof that the merchant took the order. Confirm the order with the merchant while the session is still open, then end the session.
## Full guide
The complete flow, including attaching to new tabs the agent opens and refusing card requests from tabs the SDK has not reached, is in Agentcard's docs: [Agentcard with Anchor](https://docs.agentcard.com/vault/integrations/agent-browsers/anchor).
# Browser-use
Source: https://docs.anchorbrowser.io/integrations/browseruse-deployment
> [!NOTE]
>
> This guide is dedicated to running your own browser-use agent while connecting to an Anchor browser. To use the embedded browser use capability, refer to [AI task completion](/agentic-browser-control/ai-task-completion)
**1. Step one - Create an Anchor Browser session**
```python python theme={null}
from anchorbrowser import Anchorbrowser
import os
anchor_client = Anchorbrowser(
api_key=os.getenv("ANCHOR_API_KEY")
)
session = anchor_client.sessions.create_session()
cdp_url = session.data.cdp_url
print("Session's CDP_URL for later use\n", cdp_url)
```
**2. Initialize browser-use with Anchor browser**
```python python theme={null}
from browser_use import Agent, Controller
from browser_use.browser import BrowserProfile, BrowserSession
from browser_use.llm import ChatOpenAI
import os
# Configure your LLM (example with OpenAI)
llm = ChatOpenAI(
model='gpt-4o',
api_key=os.getenv('OPENAI_API_KEY'),
)
# Initialize browser session with Anchor
profile = BrowserProfile(keep_alive=True)
browser_session = BrowserSession(
headless=False,
cdp_url=cdp_url,
browser_profile=profile
)
# Create controller and agent
controller = Controller()
agent = Agent(
task="Your task description here",
llm=llm,
enable_memory=False,
use_vision=False,
controller=controller,
browser_session=browser_session,
)
# Run the agent
result = await agent.run(max_steps=40)
```
**3. Optional - Live view the browser**
Use the `live_view_url` returned on the first step to view the browser session in real-time, or to embed it as a UI component
```html theme={null}
```
# Groq GPT-OSS
Source: https://docs.anchorbrowser.io/integrations/groq
Blazing Fast, Accurate Browser Agents
# Anchor Browser + Groq: Blazing, Accurate Fast Browser Agents
[Groq](https://groq.com/) is the fast inference platform, providing llm APIs with low time-to-first-token and time-to-response
## Python Quickstart (2 minutes to hello world)

### Prerequisites
* Python 3.8 or higher installed.
### Setup
1. **Get your API keys:**
* Go to [Anchor Browser API Key](https://app.anchorbrowser.io/api-keys?utm_source=groq)
2. **Install dependencies:**
Install the [Anchor Browser Python SDK](https://docs.anchorbrowser.io/quickstart/use-via-sdk?utm_source=groq). ([Typescript SDK](https://docs.anchorbrowser.io/quickstart/use-via-sdk?utm_source=groq) is also available).
```bash theme={null}
pip install anchorbrowser pydantic
```
## Quick Example: Extract Latest AI News
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
# Initialize the Anchor Browser Client
client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
# Collect the newest from AI News website
task_result = client.agent.task(
"Extract the latest news title from this AI News website",
task_options={
"url": "https://www.artificialintelligence-news.com/",
"provider": "groq",
"model": "openai/gpt-oss-120b",
}
)
print("Latest news title:", task_result)
```
## Advanced Session Configuration
Create a session using advanced configuration (see Anchor [API reference](https://docs.anchorbrowser.io/api-reference/browser-sessions/start-browser-session?utm_source=groq)).
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
# configuration example, can be ommited for default values.
session_config = {
"session": {
"recording": False, # Disable session recording
"proxy": {
"active": True,
"country_code": "us"
},
"max_duration": 5, # 5 minutes
"idle_timeout": 1 # 1 minute
}
}
client = Anchorbrowser(api_key=os.getenv("ANCHOR_API_KEY"))
configured_session = client.sessions.create_session(browser=session_config)
# Get the session_id to run automation workflows to the same running session.
session_id = configured_session.data.id
# Get the live view url to browse the browser in action (it's interactive!).
live_view_url = configured_session.data.live_view_url
print('session_id:', session_id, '\nlive_view_url:', live_view_url)
```
## Next Steps
* Explore the [API Reference](https://docs.anchorbrowser.io/api-reference?utm_source=groq) for detailed documentation
* Learn about [Managed Authentication](https://docs.anchorbrowser.io/essentials/managed-authentication?utm_source=groq)
* Check out [Advanced Proxy Configuration](https://docs.anchorbrowser.io/advanced/proxy?utm_source=groq) for location-specific browsing
* Use more [Agentic tools](https://docs.anchorbrowser.io/agentic-browser-control?utm_source=groq)
# Make
Source: https://docs.anchorbrowser.io/integrations/make
Integrate Anchor Browser with Make (formerly Integromat) for no-code automation workflows
## About Make
[Make](https://www.make.com/) is a no-code automation platform that lets you connect apps and services together to build powerful workflows — without writing code.
## Quick Start
Use our modules to enhance your automation workflows with Anchor Browser powerful tools.
### Module Selection

Use our [AI Task Completion](/agentic-browser-control/ai-task-completion) module to perform various tasks in a single module.

### Basic Workflow
Here is a basic workflow that uses our modules to perform a task, capture a screenshot and save it to a file both in google drive and slack.

***
## Getting Help
If you experience any issues with Anchor Browser Make modules, please contact our support team at [support@anchorbrowser.io](mailto:support@anchorbrowser.io).
# n8n
Source: https://docs.anchorbrowser.io/integrations/n8n
Integrate Anchor Browser with n8n for no-code automation workflows
## About n8n
[n8n](https://n8n.io/) is an open-source workflow automation platform that lets you connect apps and services together to build powerful workflows — without writing code.
The [n8n-nodes-anchorbrowser](https://n8n.io/integrations/anchor-browser/) community node brings Anchor Browser's cloud browser automation into your n8n workflows. Use it to run AI-powered web tasks, manage browser sessions, execute [Automation Tasks](/advanced/tasks), and control the browser at the OS level — all from n8n's visual builder.
## Quick Start
**1. Install the community node**
The Anchor Browser node is a [verified community node](https://n8n.io/integrations/anchor-browser/) on n8n. Choose the installation method for your environment:
> [tab] n8n Cloud
>
> On [n8n Cloud](https://n8n.io/cloud/), install the node directly from the editor. Only instance owners and admins can install community nodes — once installed, all instance members can use it in their workflows.
>
> 1. Open a workflow and open the nodes panel (**+** or **N**).
>
> 2. Search for **Anchor Browser**. It appears under **More from the community** with a verified badge.
>
> 3. Select the node, review the supported operations, then click **Install**.
>
> > [!NOTE]
> >
> > If you do not see verified community nodes, the instance owner must enable them in the [Cloud Admin Panel](https://docs.n8n.io/integrations/community-nodes/installation/verified-install/#enable-installation-of-verified-community-nodes). See the [n8n docs](https://docs.n8n.io/integrations/community-nodes/installation/verified-install/) for details.
> [tab] Self-hosted
>
> On a self-hosted n8n instance, install via the Settings UI or npm. Only instance owners and admins can install community nodes from npm.
>
> **Settings UI**
>
> 1. Go to **Settings → Community nodes**.
> 2. Click **Install** and enter `n8n-nodes-anchorbrowser`.
> 3. Confirm the installation.
>
> **npm**
>
> ```bash theme={null}
> npm install n8n-nodes-anchorbrowser
> ```
>
> 
**2. Connect your account**
In n8n, go to **Credentials** and create a new **Anchor Browser API** credential. Enter your API key and base URL (default: `https://api.anchorbrowser.io`). You can create or copy a key from the [API Keys page](https://app.anchorbrowser.io/api-keys) in the Anchor dashboard.

After saving, test the connection to confirm it succeeds before continuing.

**3. Add the Anchor Browser node**
Create a new workflow and add the **Anchor Browser** node. Select the **Resource** and **Operation** that match your use case. For most agentic automations, start with **Tool → Perform Web Task** — see [Tool operations](#tool-operations) below.

**4. Configure and execute**
Fill in the required fields for your chosen operation, then run the step to confirm it works.

For AI-powered tasks, configure the prompt, URL or session ID, and agent settings. See [AI Task Completion](/agentic-browser-control/ai-task-completion) for details on agents, providers, and models.



## Available Operations
The node exposes operations across five resources: Tool, Browser Session, Task, OS Level Control, and Profile.
### Tool operations
These operations use Anchor's AI agents and browser tools to complete web tasks. You can provide either a **Session ID** to use an existing session, or a **URL** to let the system create a session automatically — making these operations ideal for quick, one-off tasks without manual session management. See [AI Task Completion](/agentic-browser-control/ai-task-completion) for configuration details such as agents, providers, and models.
| Operation | Description |
| - | - |
| **Perform Web Task** | Execute an AI-powered web task from a natural language prompt. Requires a prompt and either a URL or session ID. |
| **Get Perform Web Task Status** | Retrieve the status or result of an async **Perform Web Task** execution. |
| **Fetch Webpage** | Get webpage content as HTML or Markdown. |
| **Take Screenshot** | Capture a screenshot of a webpage. |
### Browser session operations
Manage cloud browser sessions and retrieve session artifacts.
| Operation | Description |
| - | - |
| **Create Session** | Start a new browser session with configurable proxy, profile, viewport, recording, timeout, and PDF viewer settings. |
| **Get Session** | Retrieve details of a specific browser session. |
| **List All** | List all active browser sessions. |
| **End Session** | Terminate a specific browser session. |
| **End All** | Terminate all active browser sessions. |
| **Get Recordings** | Retrieve recordings for a session. |
| **Get Downloads** | Retrieve files downloaded during a session. |
### Task management operations
Create, run, and manage [Automation Tasks](/advanced/tasks) — reusable browser automation scripts you create in Anchor.
| Operation | Description |
| - | - |
| **Create Task** | Create a new task or update an existing one. |
| **Run Task** | Execute a saved task by ID. Supports input variables and async execution. |
| **Deploy Task** | Deploy a task version. |
| **Delete Task** | Delete a task. |
| **List Tasks** | List all tasks with pagination. |
| **List Executions** | List executions for a task. |
| **Get Execution** | Retrieve the result of a specific task execution. |
### OS Level Control operations
Low-level browser control for multi-step workflows that operate on an existing session. Each operation requires a **Session ID** from **Create Session** or a previous step.
| Operation | Description |
| - | - |
| **Navigate to URL** | Navigate the browser to a URL. |
| **Mouse Click** | Click at a given coordinate. |
| **Mouse Double Click** | Double-click at a given coordinate. |
| **Mouse Move** | Move the mouse cursor. |
| **Drag and Drop** | Perform a drag-and-drop operation. |
| **Scroll** | Scroll the page. |
| **Type Text** | Type text with the keyboard. |
| **Keyboard Shortcut** | Send a keyboard shortcut. |
| **Get Clipboard** | Read clipboard content. |
| **Set Clipboard** | Set clipboard content. |
| **Copy Text** | Copy the currently selected text to the clipboard. |
| **Paste Text** | Paste text from the clipboard. |
| **Take Screenshot** | Capture a screenshot of the current session viewport. |
### Profile operations
| Operation | Description |
| - | - |
| **Get Profile** | Retrieve details of a specific profile. |
| **List Profiles** | List all available profiles. |
| **Update Profile** | Update a profile's description. |
| **Delete Profile** | Delete a browser profile. |
***
## Common recipes
### Download PDF files instead of opening the viewer
By default, the **Create Session** operation enables the in-browser PDF viewer. To download PDF files automatically instead, disable the viewer when creating the session.
Add an **Anchor Browser** node and set **Resource** to **Browser Session** and **Operation** to **Create Session**. Open **Browser Configuration** and set **PDF Viewer Active** to **false**.
After the PDF downloads, use **Browser Session → Get Downloads** with the same session ID to retrieve the file. See [File Download](/advanced/file-download) for API details and P2P download options.
***
## Getting Help
If you experience any issues with the Anchor Browser n8n node, contact our support team at [support@anchorbrowser.io](mailto:support@anchorbrowser.io).
# NetSuite
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/netsuite
Automate NetSuite business workflows with Playwright when APIs aren't available.
# How to Automate NetSuite with Playwright
Automate critical NetSuite workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual data entry and reduce errors by automating repetitive business processes. Use Playwright to interact with NetSuite's web interface programmatically.
[View NetSuite's SuiteScript documentation](https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2023.1/index.html) for API alternatives when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common NetSuite tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to NetSuite
await page.goto('https://system.netsuite.com/pages/customerlogin.jsp');
await page.fill('#email', process.env.NETSUITE_EMAIL);
await page.fill('#password', process.env.NETSUITE_PASSWORD);
await page.click('#login-submit');
// Navigate to customer records
await page.click('text=Lists');
await page.click('text=Customers');
// Create new customer record
await page.click('text=New');
await page.fill('#companyname', 'Acme Corporation');
await page.fill('#email', 'contact@acme.com');
await page.click('#btn_multibutton_submitter');
await browser.close();
```
Playwright handles dynamic loading, form submissions, and navigation automatically. You can automate financial reporting, customer management, and inventory updates.
## Scale your NetSuite automation with Anchor Browser
Run your Playwright NetSuite automations on cloud browsers with enterprise-grade reliability and session persistence. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Notion
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/notion
Automate Notion workspace workflows with Playwright when APIs aren't available.
# How to Automate Notion with Playwright
Automate critical Notion workspace workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual page creation and reduce content management errors by automating repetitive documentation processes. Use Playwright to interact with Notion's web interface programmatically.
[View Notion's API documentation](https://developers.notion.com/) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Notion tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Notion
await page.goto('https://www.notion.so/login');
await page.fill('[data-testid="login-email"]', process.env.NOTION_EMAIL);
await page.fill('[data-testid="login-password"]', process.env.NOTION_PASSWORD);
await page.click('[data-testid="login-submit"]');
// Navigate to workspace
await page.click('[data-testid="workspace-switcher"]');
await page.click('text=Team Workspace');
// Create new page
await page.click('text=+ New page');
await page.fill('[placeholder="Untitled"]', 'Weekly Status Report');
await page.click('[data-testid="template-button"]');
await page.click('text=Meeting notes');
// Add content to database
await page.click('text=Projects Database');
await page.click('text=+ New');
await page.fill('[data-testid="title-input"]', 'Q1 Marketing Campaign');
await page.selectOption('[data-testid="status-select"]', 'In Progress');
await page.click('[data-testid="save-button"]');
await browser.close();
```
Playwright handles page loading, template selection, and database updates automatically. You can automate content publishing, team collaboration workflows, and project tracking processes.
## Scale your Notion automation with Anchor Browser
Run your Playwright Notion automations on cloud browsers with enterprise-grade reliability and persistent Notion sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Sage Intact
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/sage-intact
Automate Sage Intacct financial workflows with Playwright when APIs aren't available.
# How to Automate Sage Intacct with Playwright
Automate critical Sage Intacct financial workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual accounting tasks and reduce processing errors by automating repetitive financial processes. Use Playwright to interact with Intacct's web interface programmatically.
[View Sage Intacct's API documentation](https://developer.intacct.com/api/) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Intacct tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Sage Intacct
await page.goto('https://www.intacct.com/ia/acct/login.phtml');
await page.fill('#userid', process.env.INTACCT_USERNAME);
await page.fill('#companyid', process.env.INTACCT_COMPANY);
await page.fill('#password', process.env.INTACCT_PASSWORD);
await page.click('#loginButton');
// Navigate to General Ledger
await page.click('text=General Ledger');
await page.click('text=Journal Entry');
// Create new journal entry
await page.click('text=+');
await page.fill('[name="description"]', 'Monthly Accrual Entry');
await page.selectOption('[name="account"]', '1200');
await page.fill('[name="debit"]', '5000.00');
await page.click('#post');
await browser.close();
```
Playwright handles dynamic forms, account lookups, and validation automatically. You can automate journal entries, invoice processing, and financial reporting workflows.
## Scale your Sage Intacct automation with Anchor Browser
Run your Playwright Intacct automations on cloud browsers with enterprise-grade reliability and persistent financial sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Salesforce
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/salesforce
Automate Salesforce CRM workflows with Playwright when APIs aren't available.
# How to Automate Salesforce with Playwright
Automate critical Salesforce CRM workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual data entry and reduce lead processing errors by automating repetitive sales processes. Use Playwright to interact with Salesforce's web interface programmatically.
[View Salesforce's REST API documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
### Authentication Options
**Option 1: Direct Login (Basic)**
Store credentials securely using environment variables:
```JavaScript theme={null}
// Use environment variables for security
const SALESFORCE_USERNAME = process.env.SALESFORCE_USERNAME;
const SALESFORCE_PASSWORD = process.env.SALESFORCE_PASSWORD;
```
**Option 2: OAuth2 Integration**
For production environments, implement OAuth2 flow:
```
import { chromium } from 'playwright';
// OAuth2 flow for secure authentication
const page = await browser.newPage();
await page.goto('https://login.salesforce.com/services/oauth2/authorize?...');
// Handle OAuth callback and token exchange
const accessToken = await handleOAuthCallback(page);
```
## Automate Workflows
Create scripts for common Salesforce tasks:
```
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Salesforce
await page.goto('https://login.salesforce.com/');
await page.fill('#username', process.env.SALESFORCE_USERNAME);
await page.fill('#password', process.env.SALESFORCE_PASSWORD);
await page.click('#Login');
// Navigate to Leads
await page.click('[title="App Launcher"]');
await page.fill('input[placeholder="Search apps and items..."]', 'Leads');
await page.click('text=Leads');
// Create new lead
await page.click('text=New');
await page.fill('[name="firstName"]', 'John');
await page.fill('[name="lastName"]', 'Doe');
await page.fill('[name="Company"]', 'Acme Corporation');
await page.fill('[name="Email"]', 'john.doe@acme.com');
await page.selectOption('[name="LeadSource"]', 'Website');
await page.click('button[name="SaveEdit"]');
await browser.close();
```
Playwright handles dynamic Lightning components, field validations, and record saves automatically. You can automate lead conversion, opportunity updates, and account management workflows.
## Scale your Salesforce automation with Anchor Browser
Run your Playwright Salesforce automations on cloud browsers with enterprise-grade reliability and persistent Salesforce sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# SAP S/4HANA
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/sap-s4-hana
Automate SAP S/4HANA business workflows with Playwright when APIs aren't available.
# How to Automate SAP S/4HANA with Playwright
Automate critical SAP S/4HANA workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual ERP tasks and reduce processing errors by automating repetitive business processes. Use Playwright to interact with SAP's web interface programmatically.
[View SAP's API documentation](https://api.sap.com/products/SAPS4HANA/apis/REST) for programmatic connections when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common SAP tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to SAP S/4HANA
await page.goto('https://your-sap-system.com:8000/sap/bc/gui/sap/its/webgui');
await page.fill('#sap-user', process.env.SAP_USERNAME);
await page.fill('#sap-password', process.env.SAP_PASSWORD);
await page.click('#LOGON_BUTTON');
// Navigate to purchase orders
await page.fill('#RSWPSearchTextField', 'ME21N');
await page.press('#RSWPSearchTextField', 'Enter');
// Create new purchase order
await page.fill('[title="Vendor"]', '100001');
await page.fill('[title="Purchase Organization"]', '1000');
await page.fill('[title="Material"]', 'MAT-001');
await page.fill('[title="Quantity"]', '10');
await page.click('#toolbar_save');
await browser.close();
```
Playwright handles SAP GUI navigation, transaction codes, and form submissions automatically. You can automate procurement, financial postings, and material movements.
## Scale your SAP S/4HANA automation with Anchor Browser
Run your Playwright SAP automations on cloud browsers with enterprise-grade reliability and persistent SAP sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Tableau
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/tableau
Automate Tableau dashboard workflows with Playwright when APIs aren't available.
# How to Automate Tableau with Playwright
Automate critical Tableau dashboard workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual reporting tasks and reduce data processing errors by automating repetitive visualization processes. Use Playwright to interact with Tableau's web interface programmatically.
[View Tableau's REST API documentation](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api.htm) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Tableau tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Tableau Server
await page.goto('https://your-tableau-server.com');
await page.fill('[name="username"]', process.env.TABLEAU_USERNAME);
await page.fill('[name="password"]', process.env.TABLEAU_PASSWORD);
await page.click('[type="submit"]');
// Navigate to workbooks
await page.click('text=Explore');
await page.click('text=All Workbooks');
// Refresh data source
await page.click('text=Sales Dashboard');
await page.click('[data-test-id="refresh-button"]');
await page.waitForSelector('.refresh-complete');
// Export dashboard as PDF
await page.click('[data-test-id="share-button"]');
await page.click('text=Download');
await page.selectOption('[name="format"]', 'pdf');
await page.click('#download-button');
await browser.close();
```
Playwright handles dashboard loading, data refresh cycles, and export processes automatically. You can automate report generation, data source updates, and user permission management.
## Scale your Tableau automation with Anchor Browser
Run your Playwright Tableau automations on cloud browsers with enterprise-grade reliability and persistent Tableau sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Zendesk
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/zendesk
Automate Zendesk customer service workflows with Playwright when APIs aren't available.
# How to Automate Zendesk with Playwright
Automate critical Zendesk customer service workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual ticket processing and reduce response time errors by automating repetitive support processes. Use Playwright to interact with Zendesk's web interface programmatically.
[View Zendesk's API documentation](https://developer.zendesk.com/api-reference/) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Zendesk tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Zendesk
await page.goto('https://your-company.zendesk.com/agent/');
await page.fill('[name="user[email]"]', process.env.ZENDESK_EMAIL);
await page.fill('[name="user[password]"]', process.env.ZENDESK_PASSWORD);
await page.click('[type="submit"]');
// Navigate to tickets
await page.click('[data-test-id="views_views-list_row-item"]');
await page.click('text=Open tickets');
// Update ticket priority
await page.click('.ticket-row:first-child');
await page.click('[data-test-id="priority-field"]');
await page.selectOption('[data-test-id="priority-field"]', 'high');
// Add internal note
await page.fill('[data-test-id="omni-composer-rich-text"]', 'Customer escalation processed - priority updated');
await page.click('[data-test-id="submit-button"]');
await browser.close();
```
Playwright handles ticket loading, field updates, and comment submissions automatically. You can automate ticket routing, bulk status updates, and customer communication workflows.
## Scale your Zendesk automation with Anchor Browser
Run your Playwright Zendesk automations on cloud browsers with enterprise-grade reliability and persistent Zendesk sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Apache Superset
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/e2e-testing/apache-superset
Test Apache Superset dashboards and data visualization workflows with Playwright's end-to-end testing framework.
# How to Test Apache Superset with Playwright
Test your Apache Superset dashboards and data exploration workflows with Playwright's end-to-end testing framework. You'll catch visualization errors and ensure data accuracy by testing charts and filters in a real browser environment. Use Playwright to automate dashboard interactions and validate SQL queries.
[View Superset's Playwright configuration](https://github.com/apache/superset/blob/master/superset-frontend/playwright.config.ts) from the official repository.
## Setup
Install Playwright and configure for Superset testing:
```bash theme={null}
npm install playwright
```
## Write Tests
Create tests for dashboard and chart functionality:
```JavaScript theme={null}
import { test, expect } from '@playwright/test';
test('dashboard loads with correct charts', async ({ page }) => {
await page.goto('http://localhost:8088/superset/dashboard/1/');
// Login if required
await page.fill('[name="username"]', 'admin');
await page.fill('[name="password"]', 'admin');
await page.click('[type="submit"]');
// Verify dashboard elements
await expect(page.locator('.dashboard-header')).toBeVisible();
await expect(page.locator('.chart-container')).toHaveCount(4);
});
test('chart filters update data correctly', async ({ page }) => {
await page.goto('http://localhost:8088/explore/');
// Apply filter
await page.click('[data-test="adhoc-filter-edit"]');
await page.selectOption('[data-test="select-column"]', 'category');
await page.fill('[data-test="filter-value"]', 'Technology');
await page.click('[data-test="run-query"]');
// Verify filtered results
await expect(page.locator('.slice_container')).toContainText('Technology');
});
```
Playwright handles chart rendering, filter interactions, and SQL query execution automatically. You can test custom visualizations, dashboard permissions, and data source connections.
## Scale your Apache Superset testing with Anchor Browser
Run your Playwright Superset tests on cloud browsers with enterprise-grade reliability and persistent database connections. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Grafana
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/e2e-testing/grafana
Test Grafana dashboards and monitoring workflows with Playwright's end-to-end testing framework.
# How to Test Grafana with Playwright
Test your Grafana dashboards and monitoring workflows with Playwright's end-to-end testing framework. You'll catch visualization bugs and ensure critical alerts work correctly by testing in a real browser environment. Use Playwright to automate dashboard interactions and validate data accuracy.
[View Grafana's Playwright configuration](https://github.com/grafana/grafana/blob/main/playwright.config.ts) from the official repository.
## Setup
Install Playwright and configure for Grafana testing:
```bash theme={null}
npm install playwright
```
## Write Tests
Create tests for dashboard functionality:
```JavaScript theme={null}
import { test, expect } from '@playwright/test';
test('dashboard loads with correct panels', async ({ page }) => {
await page.goto('http://localhost:3000/d/dashboard-id');
// Login if required
await page.fill('[name="user"]', 'admin');
await page.fill('[name="password"]', 'admin');
await page.click('[type="submit"]');
// Verify dashboard elements
await expect(page.locator('.panel-title')).toContainText('CPU Usage');
await expect(page.locator('.graph-panel')).toBeVisible();
});
test('alert rule triggers correctly', async ({ page }) => {
await page.goto('http://localhost:3000/alerting/list');
// Check alert status
await expect(page.locator('[data-testid="alert-rule"]')).toBeVisible();
await expect(page.locator('.alert-state-ok')).toContainText('OK');
});
```
Playwright handles dashboard loading, data refresh cycles, and alert state changes automatically. You can test panel configurations, data source connections, and user permissions.
## Scale your Grafana testing with Anchor Browser
Run your Playwright Grafana tests on cloud browsers with enterprise-grade reliability and persistent authentication sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# OpenHands
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/e2e-testing/openhands
Test OpenHands' AI-driven software development workflows with Playwright's end-to-end testing framework.
# How to Test OpenHands with Playwright
Test your OpenHands AI development workflows with Playwright's end-to-end testing framework. You'll catch UI bugs and ensure agent interactions work correctly by testing in a real browser environment. Use Playwright to automate chat interactions and validate code generation features.
[View OpenHands' Playwright configuration](https://github.com/All-Hands-AI/OpenHands/blob/main/frontend/playwright.config.ts) from the official repository.
## Setup
Install Playwright and configure for OpenHands testing:
```bash theme={null}
npm install playwright
```
## Write Tests
Create tests for AI agent functionality:
```JavaScript theme={null}
import { test, expect } from '@playwright/test';
test('chat interface loads and responds', async ({ page }) => {
await page.goto('http://localhost:3000');
// Verify chat interface is ready
await expect(page.locator('[data-testid="chat-input"]')).toBeVisible();
await expect(page.locator('[data-testid="send-button"]')).toBeEnabled();
// Send a message to the agent
await page.fill('[data-testid="chat-input"]', 'Create a simple Python function');
await page.click('[data-testid="send-button"]');
// Verify agent response appears
await expect(page.locator('.agent-response')).toBeVisible();
await expect(page.locator('.code-block')).toContainText('def');
});
test('file explorer functionality works', async ({ page }) => {
await page.goto('http://localhost:3000');
// Test file tree navigation
await page.click('[data-testid="file-explorer"]');
await expect(page.locator('.file-tree')).toBeVisible();
// Create new file through UI
await page.click('[data-testid="new-file-button"]');
await page.fill('[data-testid="file-name-input"]', 'test.py');
await page.click('[data-testid="confirm-button"]');
// Verify file appears in explorer
await expect(page.locator('text=test.py')).toBeVisible();
});
```
Playwright handles agent response timing, code syntax highlighting, and file system interactions automatically. You can test multi-step workflows, error handling, and agent memory persistence.
## Scale your OpenHands testing with Anchor Browser
Run your Playwright OpenHands tests on cloud browsers with enterprise-grade reliability and persistent authentication sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Storybook
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/e2e-testing/storybook
Test Storybook components with Playwright's component testing framework.
# How to Test Storybook with Playwright
Test your Storybook components directly with Playwright's component testing framework. You'll catch UI bugs early by testing components in a real browser environment. Use Storybook's experimental Playwright integration to mount and interact with your stories.
[View the complete example](https://github.com/storybookjs/storybook/blob/795e05c3e6a72d7de10fbb2f4cb309e4dd333f46/docs/_snippets/portable-stories-playwright-ct.md) from the Storybook project.
## Setup
Install the required packages:
```bash theme={null}
npm install @storybook/react/experimental-playwright @playwright/experimental-ct-react
```
## Write Tests
Create tests that mount your stories:
```JavaScript theme={null}
import { createTest } from '@storybook/react/experimental-playwright';
import { test as base } from '@playwright/experimental-ct-react';
import stories from './Button.stories.portable';
const test = createTest(base);
test('renders primary button', async ({ mount }) => {
await mount();
});
test('renders with custom props', async ({ mount }) => {
const component = await mount();
await expect(component).toContainText('custom label');
});
```
The `mount` function executes your story's loaders, render, and play functions automatically. You can override props and test different component states.
## Scale your Storybook testing with Anchor Browser
Run your Playwright component tests on cloud browsers with enterprise-grade reliability and performance. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Twenty
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/e2e-testing/twenty
Test Twenty CRM workflows with Playwright's end-to-end testing framework.
# How to Test Twenty with Playwright
Test your Twenty CRM workflows with Playwright's end-to-end testing framework. You'll catch UI bugs and ensure contact management works correctly by testing in a real browser environment. Use Playwright to automate lead creation, pipeline management, and data validation features.
[View Twenty's Playwright configuration](https://github.com/twentyhq/twenty/blob/main/packages/twenty-e2e-testing/playwright.config.ts) from the official repository.
## Setup
Install Playwright and configure for Twenty testing:
```bash theme={null}
npm install playwright
```
## Write Tests
Create tests for CRM functionality:
```JavaScript theme={null}
import { test, expect } from '@playwright/test';
test('creates new contact successfully', async ({ page }) => {
await page.goto('http://localhost:3000');
// Navigate to contacts
await page.click('[data-testid="nav-contacts"]');
await expect(page.locator('[data-testid="contacts-table"]')).toBeVisible();
// Create new contact
await page.click('[data-testid="add-contact-button"]');
await page.fill('[data-testid="contact-first-name"]', 'John');
await page.fill('[data-testid="contact-last-name"]', 'Doe');
await page.fill('[data-testid="contact-email"]', 'john.doe@example.com');
await page.click('[data-testid="save-contact"]');
// Verify contact appears in list
await expect(page.locator('text=John Doe')).toBeVisible();
});
test('manages sales pipeline correctly', async ({ page }) => {
await page.goto('http://localhost:3000/opportunities');
// Create new opportunity
await page.click('[data-testid="add-opportunity"]');
await page.fill('[data-testid="opportunity-name"]', 'Enterprise Deal');
await page.fill('[data-testid="opportunity-amount"]', '50000');
await page.selectOption('[data-testid="opportunity-stage"]', 'qualification');
await page.click('[data-testid="save-opportunity"]');
// Verify opportunity in pipeline
await expect(page.locator('.pipeline-stage')).toContainText('Enterprise Deal');
});
```
Playwright handles dynamic loading, form validations, and state updates automatically. You can test contact imports, task management, and custom field configurations.
## Scale your Twenty testing with Anchor Browser
Run your Playwright Twenty tests on cloud browsers with enterprise-grade reliability and persistent authentication sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Integrate Playwright with Anchor Browser
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/index
Integrate Playwright and Anchor Browser
# What is Playwright?
[Playwright](https://playwright.dev/) is Microsoft's modern browser automation framework that enables reliable end-to-end testing and web scraping across all major browsers (Chromium, Firefox, and WebKit). It provides a unified API for controlling browsers programmatically, making it the industry standard for automated browser interactions.
## Why Playwright + Anchor Browser?
Anchor Browser leverages Playwright's robust browser automation capabilities to provide enterprise-grade reliability and cross-browser compatibility. While Playwright handles the low-level browser control, Anchor Browser adds:
* Cloud-hosted browser instances - No local browser management required
* AI-powered interactions - Natural language task execution beyond traditional scripting
* Enterprise security - Isolated environments with authentication and proxy support
* Self-healing automations - Built-in error recovery and adaptation to website changes
### Key Playwright Capabilities
* Multi-Browser Support - Test across Chrome, Firefox, and Safari with identical code
* Fast & Reliable - Auto-wait for elements, built-in retry logic, and parallel execution
* Powerful Debugging - Time-travel debugging, trace viewer, and UI mode for visual testing
* Visual Testing - Automated screenshot comparison and visual regression detection
* Precise Element Selection - Advanced locators for reliable element targeting
### How It Works with Anchor Browser
When you connect to Anchor Browser, you're using Playwright's familiar API but with cloud-hosted browsers:
```javascript node.js theme={null}
import { chromium } from 'playwright';
import { client, Sessions } from 'anchorbrowser';
client.setConfig({
auth: () => process.env.ANCHOR_API_KEY,
});
// First create a session
const session = await Sessions.createSession();
const cdp_url = session.data.cdp_url;
// Then connect using the session's CDP URL
const browser = await chromium.connectOverCDP(cdp_url);
console.log('Browser connected');
browser.close();
```
This gives you all of Playwright's power while eliminating infrastructure complexity and adding enterprise features.
### Use Cases
* Business Workflow Automation - Automate repetitive tasks in ERP, CRM, and financial systems
* End-to-End Testing - Automated testing of web applications across browsers
* Web Scraping - Reliable data extraction from dynamic websites
* UI Automation - Form filling, clicking, and complex user workflow automation
* Visual Monitoring - Automated screenshot comparison and regression testing
* Performance Testing - Page load timing and interaction performance measurement
## Next Steps
* [Create a Session](/quickstart/create-session) - Get started in 5 minutes
* [Examples](/examples/form-filling) - Real-world Playwright automation scripts
* [Browser Configuration](/api-reference/browser-sessions/start-browser-session#body-browser) - Advanced browser settings and options
# Integrate Puppeteer with Anchor Browser
Source: https://docs.anchorbrowser.io/integrations/open-source/puppeteer/index
Integrate Puppeteer and Anchor Browser
# What is Puppeteer?
[Puppeteer](https://pptr.dev/) is Google's Node.js library for controlling headless Chrome or Chromium browsers via the DevTools Protocol. It provides a high-level API for browser automation, making it one of the most widely adopted tools for web scraping, testing, and automated interactions.
## Why Puppeteer + Anchor Browser?
Anchor Browser leverages Puppeteer's mature CDP (Chrome DevTools Protocol) integration to provide seamless cloud browser automation. While Puppeteer handles the low-level browser control, Anchor Browser adds:
* Cloud-hosted browser instances - No local browser management required
* AI-powered interactions - Natural language task execution beyond traditional scripting
* Enterprise security - Isolated environments with authentication and proxy support
* Self-healing automations - Built-in error recovery and adaptation to website changes
### Key Puppeteer Capabilities
* CDP Native - Direct Chrome DevTools Protocol integration for precise browser control
* Lightweight & Fast - Minimal overhead with direct browser communication
* Extensive Ecosystem - Rich plugin ecosystem and community support
* Network Interception - Capture and modify network requests and responses
* PDF Generation - Convert web pages to PDFs with full rendering support
### How It Works with Anchor Browser
When you connect to Anchor Browser, you're using Puppeteer's familiar API but with cloud-hosted browsers:
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
import puppeteer from 'puppeteer-core';
client.setConfig({
auth: () => process.env.ANCHOR_API_KEY,
});
// First create a session
const session = await Sessions.createSession();
const cdpUrl = session.data.cdp_url;
const sessionId = session.data.id;
// Connect Puppeteer to the Anchor CDP session
const browser = await puppeteer.connect({
browserWSEndpoint: cdpUrl,
defaultViewport: null,
});
// Open a page and navigate
const page = await browser.newPage();
await page.goto('https://example.com');
console.log('Page title:', await page.title());
// Disconnect Puppeteer (doesn't close the Anchor session)
await browser.disconnect();
// Close the session via SDK
await Sessions.deleteSession({ path: { session_id: sessionId } });
```
This gives you all of Puppeteer's power while eliminating infrastructure complexity and adding enterprise features.
### Use Cases
* Web Scraping - Extract data from dynamic JavaScript-heavy websites
* PDF Generation - Generate PDFs from web pages with precise rendering
* Screenshot Capture - Automated screenshot generation for monitoring and testing
* Form Automation - Automate form submissions and multi-step workflows
* Network Analysis - Intercept and analyze network traffic for debugging
* Performance Profiling - Measure page load times and runtime performance
## Next Steps
* [Create a Session](/quickstart/create-session) - Get started in 5 minutes
* [Examples](/examples/form-filling) - Real-world Puppeteer automation scripts
* [Browser Configuration](/api-reference/browser-sessions/start-browser-session#body-browser) - Advanced browser settings and options
# Sandboxes
Source: https://docs.anchorbrowser.io/integrations/sandboxes
Run agent or automation code in a third-party sandbox and connect it to an Anchor cloud browser.
A sandbox is where your agent or automation **code** runs. Anchor is where the **browser** runs.
The integration Anchor is shipping now is **Anchor SDK in the sandbox base image → Anchor Cloud**. The sandbox stays vanilla and lightweight. Chromium runs as a managed Anchor cloud session; the sandbox just holds the SDK and talks to it over HTTPS + CDP.
Keep those roles separate:
* The sandbox stays the code runtime — install packages, run a script, call a model.
* Anchor stays the remote browser — stealth, proxies, live view, and session lifecycle.
* Connect the two over HTTPS + CDP. Do not launch Chromium inside the sandbox.
This is the same pattern as [Stagehand](/integrations/stagehand): create an Anchor session, then point your tool at `cdp_url` when you need full Playwright control.
> [!NOTE]
>
> Anchor's own [Execute Code Snippet](/tools/execute-code-snippet) tool is different — it runs TypeScript *inside* an existing Anchor session. Pages in this section attach a sandbox *from the outside*.
## What Anchor provides
* SDKs on [npm](https://www.npmjs.com/package/anchorbrowser) and [PyPI](https://pypi.org/project/anchorbrowser/) (Playwright or Puppeteer via CDP)
* Co-branded docs template (MDX)
* An Agent Skill (`SKILL.md`) so agents use the tool correctly — bundle it into the partner's default agent environment or skills catalog
* [Agent Access](/quickstart/agent-access) — a limited keyless trial, not a BYOK replacement
## Shared setup
Every partner page below uses the same technical contract:
* Preinstall `anchorbrowser` in the image (and `playwright` / `playwright-core` only if you need direct CDP control).
* Alias `ANCHORBROWSER_API_KEY=${ANCHOR_API_KEY}` — the raw SDK reads `ANCHORBROWSER_API_KEY`. Without that alias, session and task calls fail auth (401) even when `ANCHOR_API_KEY` is set.
* Customers bring their own Anchor API key (BYOK). Anchor bills them directly on usage.
* Prefer `agent.task` / `agentTask` for declarative browser work. The result string is `result.data.result`.
* Never log `session.data.cdp_url` — it carries the API key in the query string. Surface `session.data.live_view_url` to humans instead.
* Reuse one session per agent run, set `timeout.max_duration` / `timeout.idle_timeout`, and delete the session on sandbox teardown.
## Egress
If the sandbox restricts egress, allowlist:
* `https://api.anchorbrowser.io`
* `wss://connect.anchorbrowser.io`
* `https://live.anchorbrowser.io`
> [card] [CreateOS](/integrations/sandboxes/createos)
>
> Isolated Linux VMs for agent code, connected to an Anchor cloud browser.
> [card] [Daytona](/integrations/sandboxes/daytona)
>
> Daytona sandboxes as the code runtime, with Anchor as the remote browser.
> [card] [E2B](/integrations/sandboxes/e2b)
>
> Isolated cloud VMs for agent code, connected to an Anchor cloud browser.
> [card] [Tenki](/integrations/sandboxes/tenki)
>
> Disposable Linux VMs for agents, connected to an Anchor cloud browser.
# CreateOS
Source: https://docs.anchorbrowser.io/integrations/sandboxes/createos
Run agent code in a CreateOS sandbox and connect it to an Anchor cloud browser.
[CreateOS](https://createos.sh) sandboxes are isolated Linux VMs for running agent or automation code.
## What you're integrating
**Anchor SDK in CreateOS's base image → Anchor Cloud.** The sandbox stays vanilla and lightweight. Chromium runs as a managed Anchor cloud session; the sandbox just holds the SDK and talks to it over HTTPS + CDP.
* CreateOS stays the code runtime — install packages, run a script, call a model.
* Anchor stays the remote browser — stealth, proxies, live view, and session lifecycle.
* Do not launch a browser inside the sandbox.
## Preinstall the SDK
Install into the image app directory — not globally. `npm install -g` is not importable from user projects.
```bash Python theme={null}
pip install "anchorbrowser>=1.0" playwright
```
```bash Node.js theme={null}
npm install anchorbrowser playwright-core
```
`playwright` / `playwright-core` are only needed for direct CDP control, not for `agent.task` / `agentTask`.
Alias the env var the raw SDK actually reads, so code that does not call `setConfig` / `api_key=` still works:
```bash theme={null}
ANCHORBROWSER_API_KEY=${ANCHOR_API_KEY}
```
Put that on a Dockerfile `ENV` line or in the sandbox entrypoint. Without this alias, session and task calls fail auth (401) even when `ANCHOR_API_KEY` is set.
## API key (BYOK)
Each CreateOS customer brings their own Anchor API key as a sandbox secret: `ANCHOR_API_KEY=sk-...`. List it in CreateOS's secrets UI as a known integration.
Anchor bills the customer directly on usage — CreateOS does not meter or bill browser usage.
## Expose a browser tool
Wrap the SDK so agents call it declaratively. `agent.task` (Python) / `agentTask` (Node) return an object; the result string is `result.data.result`.
```javascript Node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const result = await agentTask(
'Go to example.com and return the page title'
);
console.log(result.data.result);
```
```python Python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHORBROWSER_API_KEY'))
result = anchor_client.agent.task(
'Go to example.com and return the page title'
)
print(result.data.result)
```
### Optional: full Playwright control
Connect over CDP to the created cloud session (`session.data.cdp_url`).
> [!WARNING]
>
> That URL carries the API key in the query string — **never log it**. Surface `session.data.live_view_url` to humans instead (`https://live.anchorbrowser.io/inspector.html?sessionId=...`). Closing Playwright only disconnects — it does not end the cloud session.
```javascript Playwright theme={null}
import { chromium } from 'playwright-core';
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
timeout: { max_duration: 30, idle_timeout: 10 },
},
},
});
const browser = await chromium.connectOverCDP(session.data.cdp_url);
const page = browser.contexts()[0].pages()[0] ?? await browser.newPage();
await page.goto('https://example.com');
console.log('Title:', await page.title());
await browser.close();
await Sessions.deleteSession({ path: { session_id: session.data.id } });
```
```python Playwright theme={null}
import os
from anchorbrowser import Anchorbrowser
from playwright.sync_api import sync_playwright
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHORBROWSER_API_KEY'))
session = anchor_client.sessions.create_session(
session={'timeout': {'max_duration': 30, 'idle_timeout': 10}}
)
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(session.data.cdp_url)
page = browser.contexts[0].pages[0] if browser.contexts[0].pages else browser.new_page()
page.goto('https://example.com')
print('Title:', page.title())
browser.close()
anchor_client.sessions.delete_session(session.data.id)
```
## Session hygiene
* Reuse **one** session per agent run — do not create a session per page.
* Set `timeout.max_duration` / `timeout.idle_timeout` (minutes) so abandoned sandboxes do not hold browsers open. See [Session Timeout](/advanced/session-timeout).
* Delete the session on sandbox teardown (`delete_session` / `deleteSession`).
* Show `live_view_url` in the sandbox UI so users can watch the browser run.
## Egress
If CreateOS sandboxes restrict egress, allowlist:
* `https://api.anchorbrowser.io`
* `wss://connect.anchorbrowser.io`
* `https://live.anchorbrowser.io`
See the [Sandboxes overview](/integrations/sandboxes) and [Create a Session](/quickstart/create-session).
# Daytona
Source: https://docs.anchorbrowser.io/integrations/sandboxes/daytona
Run agent code in a Daytona sandbox and connect it to an Anchor cloud browser.
[Daytona](https://www.daytona.io) sandboxes are isolated environments for running agent or automation code.
## What you're integrating
**Anchor SDK in Daytona's base image → Anchor Cloud.** The sandbox stays vanilla and lightweight. Chromium runs as a managed Anchor cloud session; the sandbox just holds the SDK and talks to it over HTTPS + CDP.
* Daytona stays the code runtime — install packages, run a script, call a model.
* Anchor stays the remote browser — stealth, proxies, live view, and session lifecycle.
* Do not use Daytona's local browser.
## Preinstall the SDK
Install into the image app directory — not globally. `npm install -g` is not importable from user projects.
```bash Python theme={null}
pip install "anchorbrowser>=1.0" playwright
```
```bash Node.js theme={null}
npm install anchorbrowser playwright-core
```
`playwright` / `playwright-core` are only needed for direct CDP control, not for `agent.task` / `agentTask`.
Alias the env var the raw SDK actually reads, so code that does not call `setConfig` / `api_key=` still works:
```bash theme={null}
ANCHORBROWSER_API_KEY=${ANCHOR_API_KEY}
```
Put that on a Dockerfile `ENV` line or in the sandbox entrypoint. Without this alias, session and task calls fail auth (401) even when `ANCHOR_API_KEY` is set.
## API key (BYOK)
Each Daytona customer brings their own Anchor API key as a sandbox secret: `ANCHOR_API_KEY=sk-...`. List it in Daytona's secrets UI as a known integration.
Anchor bills the customer directly on usage — Daytona does not meter or bill browser usage.
## Expose a browser tool
Wrap the SDK so agents call it declaratively. `agent.task` (Python) / `agentTask` (Node) return an object; the result string is `result.data.result`.
```javascript Node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const result = await agentTask(
'Go to example.com and return the page title'
);
console.log(result.data.result);
```
```python Python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHORBROWSER_API_KEY'))
result = anchor_client.agent.task(
'Go to example.com and return the page title'
)
print(result.data.result)
```
### Optional: full Playwright control
Connect over CDP to the created cloud session (`session.data.cdp_url`). You can create the session outside the sandbox and pass the URL in (for example as `ANCHOR_CDP_URL`), or create it from inside the sandbox.
> [!WARNING]
>
> That URL carries the API key in the query string — **never log it**. Surface `session.data.live_view_url` to humans instead (`https://live.anchorbrowser.io/inspector.html?sessionId=...`). Closing Playwright only disconnects — it does not end the cloud session.
```javascript Playwright theme={null}
import { chromium } from 'playwright-core';
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
timeout: { max_duration: 30, idle_timeout: 10 },
},
},
});
const browser = await chromium.connectOverCDP(
process.env.ANCHOR_CDP_URL ?? session.data.cdp_url
);
const page = browser.contexts()[0].pages()[0] ?? await browser.newPage();
await page.goto('https://example.com');
console.log('Title:', await page.title());
await browser.close();
await Sessions.deleteSession({ path: { session_id: session.data.id } });
```
```python Playwright theme={null}
import os
from anchorbrowser import Anchorbrowser
from playwright.sync_api import sync_playwright
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHORBROWSER_API_KEY'))
session = anchor_client.sessions.create_session(
session={'timeout': {'max_duration': 30, 'idle_timeout': 10}}
)
cdp_url = os.getenv('ANCHOR_CDP_URL') or session.data.cdp_url
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(cdp_url)
page = browser.contexts[0].pages[0] if browser.contexts[0].pages else browser.new_page()
page.goto('https://example.com')
print('Title:', page.title())
browser.close()
anchor_client.sessions.delete_session(session.data.id)
```
## Session hygiene
* Reuse **one** session per agent run — do not create a session per page.
* Set `timeout.max_duration` / `timeout.idle_timeout` (minutes) so abandoned sandboxes do not hold browsers open. See [Session Timeout](/advanced/session-timeout).
* Delete the session on sandbox teardown (`delete_session` / `deleteSession`).
* Show `live_view_url` in the sandbox UI so users can watch the browser run. That stream is the remote Anchor session, not Daytona's sandbox desktop view.
## Egress
If Daytona sandboxes restrict egress, allowlist:
* `https://api.anchorbrowser.io`
* `wss://connect.anchorbrowser.io`
* `https://live.anchorbrowser.io`
See the [Sandboxes overview](/integrations/sandboxes) and [Create a Session](/quickstart/create-session).
# E2B
Source: https://docs.anchorbrowser.io/integrations/sandboxes/e2b
Run agent code in an E2B sandbox and connect it to an Anchor cloud browser.
[E2B](https://e2b.dev) sandboxes are isolated cloud VMs for running agent or automation code.
## What you're integrating
**Anchor SDK in E2B's base image → Anchor Cloud.** The sandbox stays vanilla and lightweight. Chromium runs as a managed Anchor cloud session; the sandbox just holds the SDK and talks to it over HTTPS + CDP.
* E2B stays the code runtime — install packages, run a script, call a model.
* Anchor stays the remote browser — stealth, proxies, live view, and session lifecycle.
* Do not launch a browser inside the sandbox. Skip E2B [Computer use](https://docs.e2b.dev/use-cases/computer-use) (desktop / VNC) and in-sandbox Chromium — live view for this integration is Anchor's remote session.
## Create the sandbox
Pass keys at create time on `Sandbox.create`. Template `setEnvs` / `set_envs` is build-time only — secrets and the SDK alias belong on create.
```javascript Node.js theme={null}
import { Sandbox } from 'e2b';
const sandbox = await Sandbox.create({
envs: {
ANCHOR_API_KEY: process.env.ANCHOR_API_KEY,
ANCHORBROWSER_API_KEY: process.env.ANCHOR_API_KEY,
},
timeoutMs: 300_000,
});
```
```python Python theme={null}
import os
from e2b import Sandbox
sandbox = Sandbox.create(
envs={
'ANCHOR_API_KEY': os.environ['ANCHOR_API_KEY'],
'ANCHORBROWSER_API_KEY': os.environ['ANCHOR_API_KEY'],
},
timeout=300,
)
```
JavaScript `timeoutMs` is milliseconds. Python `timeout` is seconds. That value is the **E2B sandbox** lifetime (Hobby max 1 hour, Pro max 24 hours) — it is separate from Anchor's session `timeout.max_duration` / `timeout.idle_timeout`.
Run the snippets below inside the sandbox. From the host you can write them in with `files.write` and `commands.run`.
## Preinstall the SDK
Install into the image app directory — not globally. `npm install -g` is not importable from user projects.
```bash Python theme={null}
pip install "anchorbrowser>=1.0" playwright
```
```bash Node.js theme={null}
npm install anchorbrowser playwright-core
```
`playwright` / `playwright-core` are only needed for direct CDP control, not for `agent.task` / `agentTask`.
Alias the env var the raw SDK actually reads, so code that does not call `setConfig` / `api_key=` still works:
```bash theme={null}
ANCHORBROWSER_API_KEY=${ANCHOR_API_KEY}
```
Put that on `Sandbox.create` `envs` (as above) or in the sandbox entrypoint. Without this alias, session and task calls fail auth (401) even when `ANCHOR_API_KEY` is set.
There is no public Anchor E2B template. Bake `anchorbrowser` (and Playwright only if you need CDP) into your own tag so every sandbox starts ready:
```javascript Node.js theme={null}
import { Template } from 'e2b';
export const template = Template()
.fromBaseImage()
.pipInstall(['anchorbrowser>=1.0', 'playwright'])
.npmInstall(['anchorbrowser', 'playwright-core']);
```
```python Python theme={null}
from e2b import Template
template = (
Template()
.from_base_image()
.pip_install(['anchorbrowser>=1.0', 'playwright'])
.npm_install(['anchorbrowser', 'playwright-core'])
)
```
Build that template with the E2B SDK or CLI, then create from the tag (`Sandbox.create('your-tag', { envs, timeoutMs })`). Runtime `pip install` / `npm install` works if you skip a template, but it adds 30–60s to every sandbox.
## API key (BYOK)
Each E2B customer brings their own Anchor API key as a sandbox env: `ANCHOR_API_KEY=sk-...`.
Anchor bills the customer directly on usage — E2B does not meter or bill browser usage.
## Expose a browser tool
Wrap the SDK so agents call it declaratively. `agent.task` (Python) / `agentTask` (Node) return an object; the result string is `result.data.result`.
```javascript Node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const result = await agentTask(
'Go to example.com and return the page title'
);
console.log(result.data.result);
```
```python Python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHORBROWSER_API_KEY'))
result = anchor_client.agent.task(
'Go to example.com and return the page title'
)
print(result.data.result)
```
### Optional: full Playwright control
Connect over CDP to the created cloud session (`session.data.cdp_url`).
> [!WARNING]
>
> That URL carries the API key in the query string — **never log it**. Surface `session.data.live_view_url` to humans instead (`https://live.anchorbrowser.io/inspector.html?sessionId=...`). Closing Playwright only disconnects — it does not end the cloud session.
```javascript Playwright theme={null}
import { chromium } from 'playwright-core';
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
timeout: { max_duration: 30, idle_timeout: 10 },
},
},
});
const browser = await chromium.connectOverCDP(session.data.cdp_url);
const page = browser.contexts()[0].pages()[0] ?? await browser.newPage();
await page.goto('https://example.com');
console.log('Title:', await page.title());
await browser.close();
await Sessions.deleteSession({ path: { session_id: session.data.id } });
```
```python Playwright theme={null}
import os
from anchorbrowser import Anchorbrowser
from playwright.sync_api import sync_playwright
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHORBROWSER_API_KEY'))
session = anchor_client.sessions.create_session(
session={'timeout': {'max_duration': 30, 'idle_timeout': 10}}
)
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(session.data.cdp_url)
page = browser.contexts[0].pages[0] if browser.contexts[0].pages else browser.new_page()
page.goto('https://example.com')
print('Title:', page.title())
browser.close()
anchor_client.sessions.delete_session(session.data.id)
```
If the remote browser needs to visit an app running **inside** the sandbox, expose the port with `getHost` / `get_host` and open that public HTTPS URL. The cloud browser cannot reach `localhost` inside the VM.
## Session hygiene
You have two lifecycles to close:
* Reuse **one** Anchor session per agent run — do not create a session per page.
* Set Anchor `timeout.max_duration` / `timeout.idle_timeout` (minutes) so an abandoned sandbox does not hold a browser open. See [Session Timeout](/advanced/session-timeout).
* Delete the Anchor session on teardown (`delete_session` / `deleteSession`). `sandbox.kill()` stops the VM only — it does not end the cloud browser.
* Set the E2B sandbox timeout (`timeoutMs` / `timeout`) and call `sandbox.kill()` when the run finishes.
* Show `live_view_url` in the sandbox UI so users can watch the browser run. That stream is the remote Anchor session, not E2B's desktop / VNC view.
## Egress
If E2B sandboxes restrict egress, allowlist:
* `https://api.anchorbrowser.io`
* `wss://connect.anchorbrowser.io`
* `https://live.anchorbrowser.io`
See the [Sandboxes overview](/integrations/sandboxes) and [Create a Session](/quickstart/create-session).
# Tenki
Source: https://docs.anchorbrowser.io/integrations/sandboxes/tenki
Run agent code in a Tenki sandbox and connect it to an Anchor cloud browser.
[Tenki](https://tenki.cloud) sandboxes are disposable Linux VMs for running agent or automation code.
## What you're integrating
**Anchor SDK in Tenki's base image → Anchor Cloud.** The sandbox stays vanilla and lightweight. Chromium runs as a managed Anchor cloud session; the sandbox just holds the SDK and talks to it over HTTPS + CDP.
* Tenki stays the code runtime — install packages, run a script, call a model.
* Anchor stays the remote browser — stealth, proxies, live view, and session lifecycle.
* Do not launch a browser inside the sandbox.
## Preinstall the SDK
Install into the image app directory — not globally. `npm install -g` is not importable from user projects.
```bash Python theme={null}
pip install "anchorbrowser>=1.0" playwright
```
```bash Node.js theme={null}
npm install anchorbrowser playwright-core
```
`playwright` / `playwright-core` are only needed for direct CDP control, not for `agent.task` / `agentTask`.
Alias the env var the raw SDK actually reads, so code that does not call `setConfig` / `api_key=` still works:
```bash theme={null}
ANCHORBROWSER_API_KEY=${ANCHOR_API_KEY}
```
Put that on a Dockerfile `ENV` line or in the sandbox entrypoint. Without this alias, session and task calls fail auth (401) even when `ANCHOR_API_KEY` is set.
## API key (BYOK)
Each Tenki customer brings their own Anchor API key as a sandbox secret: `ANCHOR_API_KEY=sk-...`. List it in Tenki's secrets UI as a known integration.
Anchor bills the customer directly on usage — Tenki does not meter or bill browser usage.
## Expose a browser tool
Wrap the SDK so agents call it declaratively. `agent.task` (Python) / `agentTask` (Node) return an object; the result string is `result.data.result`.
```javascript Node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const result = await agentTask(
'Go to example.com and return the page title'
);
console.log(result.data.result);
```
```python Python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHORBROWSER_API_KEY'))
result = anchor_client.agent.task(
'Go to example.com and return the page title'
)
print(result.data.result)
```
### Optional: full Playwright control
Connect over CDP to the created cloud session (`session.data.cdp_url`).
> [!WARNING]
>
> That URL carries the API key in the query string — **never log it**. Surface `session.data.live_view_url` to humans instead (`https://live.anchorbrowser.io/inspector.html?sessionId=...`). Closing Playwright only disconnects — it does not end the cloud session.
```javascript Playwright theme={null}
import { chromium } from 'playwright-core';
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
const session = await Sessions.createSession({
body: {
session: {
timeout: { max_duration: 30, idle_timeout: 10 },
},
},
});
const browser = await chromium.connectOverCDP(session.data.cdp_url);
const page = browser.contexts()[0].pages()[0] ?? await browser.newPage();
await page.goto('https://example.com');
console.log('Title:', await page.title());
await browser.close();
await Sessions.deleteSession({ path: { session_id: session.data.id } });
```
```python Playwright theme={null}
import os
from anchorbrowser import Anchorbrowser
from playwright.sync_api import sync_playwright
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHORBROWSER_API_KEY'))
session = anchor_client.sessions.create_session(
session={'timeout': {'max_duration': 30, 'idle_timeout': 10}}
)
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(session.data.cdp_url)
page = browser.contexts[0].pages[0] if browser.contexts[0].pages else browser.new_page()
page.goto('https://example.com')
print('Title:', page.title())
browser.close()
anchor_client.sessions.delete_session(session.data.id)
```
## Session hygiene
* Reuse **one** session per agent run — do not create a session per page.
* Set `timeout.max_duration` / `timeout.idle_timeout` (minutes) so abandoned sandboxes do not hold browsers open. See [Session Timeout](/advanced/session-timeout).
* Delete the session on sandbox teardown (`delete_session` / `deleteSession`).
* Show `live_view_url` in the sandbox UI so users can watch the browser run.
## Egress
If Tenki sandboxes restrict egress, allowlist:
* `https://api.anchorbrowser.io`
* `wss://connect.anchorbrowser.io`
* `https://live.anchorbrowser.io`
See the [Sandboxes overview](/integrations/sandboxes) and [Create a Session](/quickstart/create-session).
# Stagehand
Source: https://docs.anchorbrowser.io/integrations/stagehand
Integrate Stagehand with Anchor Browser for AI-powered browser automation
## Basic Usage
This example demonstrates how to:
1. Create an AnchorBrowser session using the AnchorBrowser SDK
2. Get the CDP URL from the session
3. Connect Stagehand to the browser via CDP
4. Perform AI-powered browser automation
### Prerequisites
```bash python theme={null}
pip install stagehand anchorbrowser
```
```bash node.js theme={null}
npm install @browserbasehq/stagehand anchorbrowser
```
Set the following environment variables:
* `ANCHORBROWSER_API_KEY` - Your Anchorbrowser API key
* `MODEL_API_KEY`, `OPENAI_API_KEY`, or `GOOGLE_API_KEY` - Your LLM provider API key
```python python theme={null}
from __future__ import annotations
import asyncio
import os
import sys
from typing import Any, Optional
from anchorbrowser import AsyncAnchorbrowser
from stagehand import AsyncStagehand
async def main() -> None:
# 1. Check for required environment variables
anchor_api_key = os.environ.get("ANCHORBROWSER_API_KEY")
if not anchor_api_key:
sys.exit(
"❌ ANCHORBROWSER_API_KEY environment variable is required. "
"Get your API key from https://anchorbrowser.io"
)
model_api_key = os.environ.get("MODEL_API_KEY") or os.environ.get("OPENAI_API_KEY") or os.environ.get("GOOGLE_API_KEY")
if not model_api_key:
sys.exit("❌ MODEL_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY environment variable is required.")
# Detect model type from API key format
if model_api_key.startswith("AIza"):
model_name = "google/gemini-2.0-flash"
print(f" Detected Google API key, using model: {model_name}")
else:
model_name = "openai/gpt-4o-mini"
print(f" Detected OpenAI API key, using model: {model_name}")
anchorbrowser_session_id: Optional[str] = None
stagehand_session_id: Optional[str] = None
# Initialize Anchorbrowser client
anchor_client = AsyncAnchorbrowser(api_key=anchor_api_key)
try:
# 2. Create Anchorbrowser session using the SDK
print("🌐 Creating Anchorbrowser session...")
anchor_session = await anchor_client.sessions.create()
if not anchor_session.data or not anchor_session.data.cdp_url:
raise ValueError(f"Anchorbrowser session did not return a CDP URL. Response: {anchor_session}")
anchorbrowser_session_id = anchor_session.data.id
cdp_url = anchor_session.data.cdp_url
print("✅ Anchorbrowser session created!")
print(f" Session ID: {anchorbrowser_session_id}")
print(f" CDP URL: {cdp_url}")
# 3. Initialize Stagehand with the CDP URL
print("\n🚀 Initializing Stagehand with CDP URL...")
async with AsyncStagehand(
server="local",
model_api_key=model_api_key,
local_openai_api_key=model_api_key,
local_ready_timeout_s=30.0,
) as client:
# Start session with CDP URL pointing to Anchorbrowser
# Note: cdp_url must be inside launch_options for connecting to external browsers
session_response = await client.sessions.start(
model_name=model_name,
browser={
"type": "local",
"launch_options": {
"cdp_url": cdp_url,
},
},
)
stagehand_session_id = session_response.data.session_id
print("✅ Stagehand initialized successfully!")
print(f" Stagehand Session ID: {stagehand_session_id}")
try:
# 4. Navigate to Hacker News
print("\n📍 Navigating to Hacker News...")
await client.sessions.navigate(
id=stagehand_session_id,
url="https://news.ycombinator.com",
)
print("✅ Navigation complete")
# 5. Use Stagehand's AI-powered extraction
print("\n🔍 Extracting top stories using AI...")
extract_response = await client.sessions.extract(
id=stagehand_session_id,
instruction="Extract the titles and URLs of the first 5 stories on the page",
schema={
"type": "object",
"properties": {
"stories": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {"type": "string"},
"url": {"type": "string"},
},
"required": ["title"],
},
},
},
"required": ["stories"],
},
)
print("\n📰 Extracted stories:")
result: Any = extract_response.data.result
if isinstance(result, dict) and "stories" in result:
stories = result["stories"]
if isinstance(stories, list):
for i, story in enumerate(stories, 1):
if isinstance(story, dict):
title = story.get("title", "N/A")
url = story.get("url")
print(f" {i}. {title}")
if url:
print(f" URL: {url}")
else:
print(f" Raw result: {result}")
# 6. Use Stagehand's observe to find clickable elements
print("\n👁️ Observing page for login link...")
observe_response = await client.sessions.observe(
id=stagehand_session_id,
instruction="find the login link",
)
actions = observe_response.data.result
print(f" Found {len(actions)} possible actions")
if actions:
print(f" First action: {actions[0].description}")
# 7. Use Stagehand's act to perform an action
print("\n🖱️ Clicking on the first story...")
act_response = await client.sessions.act(
id=stagehand_session_id,
input="click on the first story title",
)
print(f" Act completed: {act_response.data.result.message}")
# Wait a moment for navigation
await asyncio.sleep(2)
print("\n✅ Test completed successfully!")
finally:
# 8. End the Stagehand session
if stagehand_session_id:
print("\n🛑 Ending Stagehand session...")
await client.sessions.end(id=stagehand_session_id)
print("✅ Stagehand session ended")
finally:
# 9. Delete the Anchorbrowser session using the SDK
if anchorbrowser_session_id:
print("\n🧹 Deleting Anchorbrowser session...")
try:
await anchor_client.sessions.delete(anchorbrowser_session_id)
print("✅ Anchorbrowser session deleted")
except Exception as e:
print(f"⚠️ Failed to delete Anchorbrowser session: {e}")
# Close the Anchorbrowser client
await anchor_client.close()
if __name__ == "__main__":
asyncio.run(main())
```
```typescript node.js theme={null}
import { Stagehand } from "@browserbasehq/stagehand";
import { client, Sessions } from "anchorbrowser";
import { z } from "zod";
async function main(): Promise {
// 1. Check for required environment variables
const anchorApiKey = process.env.ANCHORBROWSER_API_KEY;
if (!anchorApiKey) {
console.error(
"❌ ANCHORBROWSER_API_KEY environment variable is required. " +
"Get your API key from https://anchorbrowser.io"
);
process.exit(1);
}
const modelApiKey =
process.env.MODEL_API_KEY ||
process.env.OPENAI_API_KEY ||
process.env.GOOGLE_API_KEY;
if (!modelApiKey) {
console.error(
"❌ MODEL_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY environment variable is required."
);
process.exit(1);
}
// Detect model type from API key format
let modelName: string;
if (modelApiKey.startsWith("AIza")) {
modelName = "gemini-2.0-flash";
console.log(` Detected Google API key, using model: ${modelName}`);
} else {
modelName = "gpt-4o-mini";
console.log(` Detected OpenAI API key, using model: ${modelName}`);
}
let anchorbrowserSessionId: string | undefined;
let stagehand: Stagehand | undefined;
// Initialize Anchorbrowser client
client.setConfig({
auth: () => anchorApiKey,
});
try {
// 2. Create Anchorbrowser session using the SDK
console.log("🌐 Creating Anchorbrowser session...");
const anchorSession = await Sessions.createSession();
if (!anchorSession.data?.cdp_url) {
throw new Error(
`Anchorbrowser session did not return a CDP URL. Response: ${JSON.stringify(anchorSession)}`
);
}
anchorbrowserSessionId = anchorSession.data.id;
const cdpUrl = anchorSession.data.cdp_url;
console.log("✅ Anchorbrowser session created!");
console.log(` Session ID: ${anchorbrowserSessionId}`);
console.log(` CDP URL: ${cdpUrl}`);
// 3. Initialize Stagehand V3 with the CDP URL
console.log("\n🚀 Initializing Stagehand V3 with CDP URL...");
stagehand = new Stagehand({
env: "LOCAL",
model: modelName,
localBrowserLaunchOptions: {
cdpUrl: cdpUrl,
},
verbose: 1,
});
await stagehand.init();
console.log("✅ Stagehand V3 initialized successfully!");
try {
// Get the active page
const page = stagehand.context.activePage();
if (!page) {
throw new Error("No active page found");
}
// 4. Navigate to Hacker News
console.log("\n📍 Navigating to Hacker News...");
await page.goto("https://news.ycombinator.com");
console.log("✅ Navigation complete");
// 5. Use Stagehand's AI-powered extraction
console.log("\n🔍 Extracting top stories using AI...");
const StoriesSchema = z.object({
stories: z.array(
z.object({
title: z.string(),
url: z.string().optional(),
})
),
});
const extractResult = await stagehand.extract(
"Extract the titles and URLs of the first 5 stories on the page",
StoriesSchema
);
console.log("\n📰 Extracted stories:");
if (extractResult.stories) {
extractResult.stories.forEach((story, i) => {
console.log(` ${i + 1}. ${story.title}`);
if (story.url) {
console.log(` URL: ${story.url}`);
}
});
}
// 6. Use Stagehand's observe to find clickable elements
console.log("\n👁️ Observing page for login link...");
const actions = await stagehand.observe("find the login link");
console.log(` Found ${actions.length} possible actions`);
if (actions.length > 0) {
console.log(` First action: ${actions[0].description}`);
}
// 7. Use Stagehand's act to perform an action
console.log("\n🖱️ Clicking on the first story...");
const actResult = await stagehand.act("click on the first story title");
console.log(` Act completed: ${actResult.message}`);
// Wait a moment for navigation
await new Promise((resolve) => setTimeout(resolve, 2000));
console.log("\n✅ Test completed successfully!");
} finally {
// 8. Close Stagehand
if (stagehand) {
console.log("\n🛑 Closing Stagehand...");
await stagehand.close();
console.log("✅ Stagehand closed");
}
}
} finally {
// 9. Delete the Anchorbrowser session using the SDK
if (anchorbrowserSessionId) {
console.log("\n🧹 Deleting Anchorbrowser session...");
try {
await Sessions.deleteSession({
path: { session_id: anchorbrowserSessionId },
});
console.log("✅ Anchorbrowser session deleted");
} catch (e) {
console.log(`⚠️ Failed to delete Anchorbrowser session: ${e}`);
}
}
}
}
main().catch((error) => {
console.error("Fatal error:", error);
process.exit(1);
});
```
> [!TIP]
>
> Set `ANCHOR_BROWSER_API_KEY` for AnchorBrowser authentication, and one of `MODEL_API_KEY`, `OPENAI_API_KEY`, or `GOOGLE_API_KEY` for your LLM provider.
# Zapier
Source: https://docs.anchorbrowser.io/integrations/zapier
Integrate Anchor Browser with Zapier for no-code automation workflows
## About Zapier
[Zapier](https://zapier.com/) is a no-code automation platform that connects apps and services so you can build workflows — called Zaps — without writing code.
The [Anchor (Agentic Browser Automation)](https://zapier.com/apps/anchor-agentic-browser/integrations) integration brings Anchor Browser's cloud browser automation into your Zaps. Use it to run AI-powered web tasks, manage browser sessions, execute [Automation Tasks](/advanced/tasks), and control the browser at the OS level — all from Zapier's visual builder.
## Quick Start
**1. Add the Anchor Browser app**
In Zapier, create a new Zap and search for **Anchor (Agentic Browser Automation)** when choosing an app.
**2. Connect your account**
When prompted, paste your Anchor Browser API key. You can create or copy a key from the [API Keys page](https://app.anchorbrowser.io/api-keys) in the Anchor dashboard.
Zapier validates the connection by calling the Anchor API. Make sure the test succeeds before continuing.
**3. Choose an action**
Select the action that matches your use case. For most agentic automations, start with **Agent Task** — see [AI-powered actions](#ai-powered-actions) below.
**4. Configure and test**
Fill in the required fields (typically a prompt and either a URL or session ID), then run a test step to confirm the action works before turning the Zap on.
## Available Actions
The integration exposes actions across four categories: AI-powered tools, browser sessions, saved tasks, and OS-level browser control.
### AI-powered actions
These actions use Anchor's AI agents to complete web tasks from natural language prompts. See [AI Task Completion](/agentic-browser-control/ai-task-completion) for configuration details such as agents, providers, and models.
| Action | Description |
| - | - |
| **Agent Task** | Start an AI-powered web task asynchronously. Returns a workflow ID you can pass to **Agent Task Result**. Requires a prompt and either a URL or session ID. |
| **Agent Task Result** | Retrieve the result of an async **Agent Task** execution. |
| **Fetch Webpage** | Get webpage content as HTML or Markdown. |
| **Take Screenshot** | Take a screenshot of a webpage. |
### Browser session actions
Manage cloud browser sessions and retrieve session artifacts.
| Action | Description |
| - | - |
| **Create Browser Session** | Start a new browser session with configurable proxy, profile, viewport, and recording settings. |
| **End Browser Session** | Terminate a specific browser session. |
| **End All Sessions** | Terminate all active browser sessions. |
| **Get Session Recordings** | Retrieve recordings for a session. |
| **Get Session Downloads** | Retrieve files downloaded during a session. |
| **Take Session Screenshot** | Capture a screenshot of the current session viewport. |
**Search actions** (find existing resources):
| Action | Description |
| - | - |
| **Get Browser Session** | Retrieve details of a specific browser session. |
| **Get Profile** | Retrieve details of a specific profile. |
### Task management actions
Create, run, and manage [Automation Tasks](/advanced/tasks) - reusable browser automation scripts you create in Anchor.
| Action | Description |
| - | - |
| **Create Task** | Create a new task or update an existing one. |
| **Run Task** | Execute a saved task by ID. Supports draft/latest version selection, input variables, and async execution. |
| **Deploy Task** | Deploy a task version. |
| **Delete Task** | Delete a task. |
| **Get Task Execution Result** | Retrieve the result of a specific task execution. |
### OS control actions
Low-level browser control for multi-step Zaps that operate on an existing session. Each action requires a session ID from **Create Browser Session** or a previous step.
| Action | Description |
| - | - |
| **Navigate to URL** | Navigate the browser to a URL. |
| **Mouse Click** | Click at a given coordinate. |
| **Mouse Double Click** | Double-click at a given coordinate. |
| **Mouse Move** | Move the mouse cursor. |
| **Drag and Drop** | Perform a drag-and-drop operation. |
| **Scroll** | Scroll the page. |
| **Type Text** | Type text with the keyboard. |
| **Keyboard Shortcut** | Send a keyboard shortcut. |
| **Get Clipboard** | Read clipboard content. |
| **Set Clipboard** | Set clipboard content. |
| **Copy Selected Text** | Copy the currently selected text to the clipboard. |
| **Paste Text** | Paste text from the clipboard. |
### Profile actions
| Action | Description |
| - | - |
| **Delete Profile** | Delete a browser profile. |
***
## Getting Help
If you experience any issues with the Anchor Browser Zapier integration, contact our support team at [support@anchorbrowser.io](mailto:support@anchorbrowser.io).
# Documentation
Source: https://docs.anchorbrowser.io/introduction
Cloud browsers for AI agents and automation: sessions over CDP or REST, natural-language web tasks, managed authentication, volumes, recordings, batch sessions, and stealth browsing. Get a key at https://app.anchorbrowser.io/api-keys.
Secure cloud browsers for agents
Enterprise ready browser infrastructure
Anchor gives agents a real browser in the cloud - navigate, authenticate, fill forms, and extract data on sites that were never built for automation.
[Get your API key →](https://app.anchorbrowser.io/api-keys)
Copy prompt
```javascript Node.js theme={null}
import { client, agentTask } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const result = await agentTask(
'Go to example.com and return the page title'
);
console.log(result.data.result);
```
```python Python theme={null}
import os
from anchorbrowser import Anchorbrowser
client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
result = client.agent.task(
'Go to example.com and return the page title'
)
print(result.data.result)
```
## Get started
> [card] [Open the playground](https://app.anchorbrowser.io/playground)
>
> No install, no API key. Build and run browser flows in your browser right now.
> [card] [Start your first task](/agentic-browser-control/ai-task-completion)
>
> Demonstrate a flow or send a natural-language prompt - the agent navigates, clicks, and extracts data for you.
> [card] [Start your first browser](/quickstart/use-via-code)
>
> Create a cloud session and connect with Playwright or Puppeteer over CDP.
> [card] [Install the SDK](/quickstart/use-via-sdk)
>
> Official Node.js and Python client for tasks, sessions, and auth in your app.
> [card] [Call the API](/quickstart/use-via-api)
>
> Integrate directly with REST or through Make, LangChain, and CrewAI.
### Building a product?
> [card] [Add a browser to your agent platform](/use-cases/agent-platform)
>
> Give your AI agents cloud browsers they can open on demand — via SDK, MCP, or REST — when they need to navigate, click, or extract data.
> [card] [Collect data from a SaaS that doesn't have an API](/use-cases/saas-without-api)
>
> Sign in to dashboards and portals, navigate the UI, and pull reports or records from web apps with no public API.
> [card] [Enterprise automation](/use-cases/enterprise-automation)
>
> Deploy versioned, repeatable workflows with managed identities, scheduling, and session control built for production teams.
> [card] [Overcome bot detection challenges](/use-cases/bot-detection)
>
> Use residential proxies, extra-stealth fingerprints, and captcha solving to automate sites that block standard browsers.
## Platform overview
> [card] [Managed authentication](/essentials/managed-authentication)
>
> Applications, identities, and OmniConnect for persistent logins across sessions.
> [card] [Proxy and IP management](/advanced/proxy)
>
> Residential proxies, dedicated sticky IPs, and VPN routing for geo-specific access.
> [card] [Extra stealth mode](/essentials/stealth)
>
> Anti-detection fingerprinting and bot bypass for sensitive sites.
> [card] [Agentic browser control](/agentic-browser-control/ai-task-completion)
>
> Natural-language tasks, computer-use agents, and human-in-the-loop workflows.
> [card] [Automation tasks](/tasks/creating-a-task)
>
> Versioned TypeScript workflows you deploy once and run on demand.
## Next steps
> [card] [Example use-cases](/examples/form-filling)
>
> Form filling, research, configuration collection, and more.
> [card] [Build tools](/essentials/control-a-session)
>
> Wrap browser flows as tools your AI agent can call.
> [card] [MCP integration](/advanced/mcp)
>
> Connect Anchor to Claude Desktop and other MCP clients.
> [card] [API reference](/api-reference)
>
> Full endpoint catalog with request and response schemas.
# Network and Stealth
Source: https://docs.anchorbrowser.io/network-and-stealth/overview
Get past IP blocks, bot detection, and CAPTCHAs on automated browser sessions.
Sites block automation in two places: the **network** (IP reputation, geography, rate limits) and the **browser** (fingerprinting, bot checks, CAPTCHAs). The options below address each layer. Set them in `session` and `browser` at create time, or once per task in `task_default_browser_configuration`.
### [Proxy](/advanced/proxy)
Most automation failures start at the IP. Datacenter addresses get flagged, the wrong country gets geo-blocked, and shared proxy pools burn out fast. A proxy puts your session on an IP and location the target site expects — US retail from a US address, EU compliance from an EU exit, or your own corporate proxy when policy requires it. Anchor provides built-in residential-style routing with country/region/city targeting.
### [Bring Your Own Proxy](/advanced/bring-your-own-proxy)
When policy or compliance requires your own egress, plug in an HTTP, HTTPS, or SOCKS5 server you already operate. You control the provider, credentials, and network path; Anchor routes the browser session through it.
### [Dedicated Sticky IP](/advanced/dedicated-sticky-ip)
Some sites don't just care *where* you are — they care that your IP *stays the same*. Banking, SaaS accounts, and fraud systems lock or challenge users whose IP jumps between sessions. A dedicated sticky IP reserves one egress address for a profile so every run looks like the same device coming from the same place.
### [Anchor VPN](/advanced/anchor-vpn)
Rotating proxies trade consistency for scale. When you need a **stable, private egress path** at enterprise volume — one IP that belongs only to you, on infrastructure Anchor operates end-to-end — VPN replaces the commodity proxy hop. Fewer reputation surprises, fewer mid-flow auth breaks.
### [Extra Stealth](/essentials/stealth)
A clean IP is not enough if the browser itself screams "bot." Sites inspect fingerprints: automation flags, headless signals, canvas/WebGL consistency, and dozens of other tells. Extra Stealth runs a hardened Chrome environment built to pass those checks — so your session is less likely to be identified as automated before it ever clicks a link. Requires proxy. Growth plan.
### [CAPTCHA solving](/advanced/captcha-solving)
CAPTCHAs exist to stop bots at the front door — image puzzles, Cloudflare turnstiles, "verify you're human" gates. When one appears mid-flow, automation stops unless something solves it. Anchor watches for CAPTCHA UI in the session and resolves it automatically using vision-based detection, so your workflow continues without a human in the loop. Requires proxy (or a profile with its own stable egress).
### [Web Bot Auth](/advanced/cloudflare-web-bot-auth)
Not every site wants to block all bots — some participate in Cloudflare's Web Bot Auth program and will **allow verified automated clients** that cryptographically identify themselves. If you are building an approved integration, signed requests prove you are Anchor Browser rather than a scraper spoofing a user agent. Different path than hiding; you are declaring yourself as a legitimate bot.
### [Web Unlocker](/advanced/web-unlocker)
Sometimes you do not need a full browser — you need the HTML. Web Unlocker is a single API call that fetches a rendered page from a URL. Anchor handles proxy rotation, CAPTCHA, and fingerprinting internally. Good for read-only extraction at scale; use a session when you need to log in, click, or maintain state across steps.
## Enterprise IP allowlisting
Some platforms require you to allowlist Anchor's outbound IP addresses before browser automation can reach protected endpoints. Static egress routing is enabled for your project upon request — [contact us](mailto:support@anchorbrowser.io?subject=Static%20egress%20IP%20allowlist) to turn it on.
Add these addresses to your firewall, WAF, or platform allowlist:
```
3.19.204.234
16.58.4.236
18.219.69.116
3.143.75.163
18.189.45.103
3.21.249.234
```
> [!NOTE]
>
> Allowlisting is a change on your side — Anchor does not block access from our end.
# Browser Sessions
Source: https://docs.anchorbrowser.io/quickstart/browser-sessions
How cloud browser sessions work — what you get back, how to create one, and what you can configure at creation time.
A **browser session** is a cloud Chromium instance you control over CDP (Playwright, Puppeteer) or Anchor's APIs. Create one, automate, then end it when done.
## What you get back
Every successful create returns:
| Field | Use it for |
| - | - |
| `id` | Session identity — reconnect, run tasks, fetch recordings |
| `cdp_url` | Connect Playwright or Puppeteer over Chrome DevTools Protocol |
| `live_view_url` | Embed or share a live view of the browser — see [Embedded Browser Live UI](/advanced/browser-live-view) |
By default sessions start **headful** with **recording enabled**. See [Start Browser Session](/api-reference/browser-sessions/start-browser-session) for defaults and full schema.
## How to create
| Guide | When to use |
| - | - |
| [Create a Session](/quickstart/create-session) | Standard create — blocks until the browser is ready. Best for scripts and single sessions. |
| [Async Session](/essentials/async-session) | Returns immediately; poll until ready. Best for parallel provisioning or long proxy/stealth setups. |
| [Batch Browser Sessions](/advanced/batch-browser-sessions) | Many sessions in one call (up to 5,000). Best for large-scale scraping or load tests. |
## Configure at create
Pass optional `session` and `browser` blocks in the create request body. The shape is the same for sync, async, and batch creates. Full schema: [Start Browser Session](/api-reference/browser-sessions/start-browser-session).
```json theme={null}
{
"session": {
"initial_url": "https://app.example.com"
},
"browser": {
"headless": { "active": true }
},
"identities": [{ "id": "your-identity-id" }]
}
```
Attach **`identities`** to start signed in, or set **`browser.profile`** to load a saved browser state — see the auth rows below.
Setup for each option lives on its own page — this section only links there:
| Configurable at create | Learn more |
| - | - |
| Proxy, VPN, sticky IP | [Proxy](/advanced/proxy), [Anchor VPN](/advanced/anchor-vpn), [Dedicated sticky IP](/advanced/dedicated-sticky-ip) |
| Stealth, captcha, web bot auth | [Stealth](/essentials/stealth), [CAPTCHA solving](/advanced/captcha-solving), [Web Bot Auth](/advanced/cloudflare-web-bot-auth) |
| Extensions, adblock, popups, sensitive data masking, timeouts, tags, CA certs | **Customize** in the sidebar |
| Tracing (`browser.tracing`) | Console and network logs are on by default. Query values, cookies, and credential headers are omitted. Set `snapshots: true` to store document HTML for the DOM tab; HTML is saved as-is. |
| Profiles (`browser.profile`) | [Managed Authentication — Browser profiles](/essentials/managed-authentication#browser-profiles) |
| Identities (`identities[]`) | [Managed Authentication](/essentials/managed-authentication) |
| Email OTP, Custom MFA, 1Password | [Email MFA](/advanced/email-otp), [Custom MFA](/advanced/mfa), [1Password](/integrations/1password) |
| Live view / embed (`live_view_url`) | [Embedded Browser Live UI](/advanced/browser-live-view) |
## Rate limits
`POST /v1/sessions` and `POST /v1/sessions/async` each have their own per-minute budget. The caps match:
| Plan | Sessions per minute |
| - | - |
| Free | 5 |
| Starter | 25 |
| Team | 50 |
| Growth | 100 |
| Enterprise | 200+ |
A higher cap is an account override.
The per-minute limiter returns `429` before a session exists. That response includes `RateLimit`, `RateLimit-Policy`, and `Retry-After`, so retrying it does not create a second session. A `429` with no `Retry-After` is a concurrency cap: the API key's concurrent-browser limit, which clears when a session ends, or too many session creations in flight at once.
The API does not read an `Idempotency-Key` header. Retrying a `5xx` or `409` can create a second session. `400`, `401`, `402`, `403`, `404`, `412`, and `422` are terminal.
`GET /v1/sessions/{session_id}/recordings` is capped per API key per minute and returns `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset`. `GET /v1/sessions/{session_id}/recordings/{recording_id}/fetch` is capped per team per hour and sends the same `RateLimit` and `RateLimit-Policy` headers as the session limiter. The caps differ by region:
| Region | Recordings list, per API key per minute | Recording fetch, per team per hour |
| - | - | - |
| US | 200 | 5,000 |
| EU | 50 | 2,000 |
## Next steps
> [card] [Create a session](/quickstart/create-session)
>
> SDK quick start — create, connect with Playwright or Puppeteer, automate.
> [card] [Async sessions](/essentials/async-session)
>
> Non-blocking create and poll until ready.
> [card] [Batch sessions](/advanced/batch-browser-sessions)
>
> Create many sessions in one API call.
> [card] [Session recordings](/essentials/recording)
>
> Record and replay sessions after they end.
# Create a Session
Source: https://docs.anchorbrowser.io/quickstart/create-session
Create a cloud browser session and connect with Playwright or Puppeteer over CDP.
Create a browser session, then connect over CDP to automate. For an overview of session outputs, create APIs, and configuration options, see [Browser Sessions](/quickstart/browser-sessions).
**1. Get your API key**
Copy your key from [Anchor UI](https://app.anchorbrowser.io/api-keys).
**2. Install dependencies**
```bash Node.js theme={null}
npm install anchorbrowser playwright-core
```
```bash Python theme={null}
pip install anchorbrowser playwright
```
**3. Create a session**
```javascript node.js theme={null}
import { client, Sessions } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const session = await Sessions.createSession();
console.log('Session ID:', session.data.id);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
session = anchor_client.sessions.create_session()
print('Session ID:', session.data.id)
print('CDP URL:', session.data.cdp_url)
print('Live view:', session.data.live_view_url)
```
The response includes `id`, `cdp_url`, and `live_view_url`. Use `live_view_url` to [embed the browser](/advanced/browser-live-view) in your app. Pass `identities` or `browser.profile` in the request body to start authenticated — see [Browser Sessions](/quickstart/browser-sessions#configure-at-create).
**4. Connect and automate**
```javascript Playwright theme={null}
import { chromium } from 'playwright-core';
const browser = await chromium.connectOverCDP(session.data.cdp_url);
const page = browser.contexts()[0].pages()[0] ?? await browser.newPage();
await page.goto('https://example.com');
console.log('Title:', await page.title());
await browser.close();
```
```javascript Puppeteer theme={null}
import puppeteer from 'puppeteer-core';
const browser = await puppeteer.connect({
browserWSEndpoint: session.data.cdp_url,
});
const pages = await browser.pages();
const page = pages[0] ?? await browser.newPage();
await page.goto('https://example.com');
console.log('Title:', await page.title());
await browser.close();
```
```python Playwright theme={null}
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(session.data.cdp_url)
page = browser.contexts[0].pages[0] if browser.contexts[0].pages else browser.new_page()
page.goto('https://example.com')
print('Title:', page.title())
browser.close()
```
> [!TIP]
>
> You should see a session ID, CDP URL, and the page title printed in your terminal.
## Next steps
* [Browser Sessions](/quickstart/browser-sessions) — sync vs async vs batch, configuration links
* [Async sessions](/essentials/async-session) — create without blocking on provisioning
* [Embedded Browser Live UI](/advanced/browser-live-view) — use `live_view_url` in your product
* [API Reference](/api-reference/browser-sessions/start-browser-session) — full create request schema
# API Quick Start
Source: https://docs.anchorbrowser.io/quickstart/use-via-api
Our APIs can be used directly (See our [API Reference](/api-reference)) or through integrations to automation platforms. We've created modules for our most commonly used API routes in each of the supported platforms.
Pick your preferred platform to view a quick-start for its usage:
> [card] [Direct API Usage](/api-reference)
>
> Use the API directly as you like, See our [API Reference](/api-reference) for more details.
> [card] [OpenAPI Specification](/openapi.yaml)
>
> Download the raw OpenAPI spec for code generation or API client tooling.
> [card] [Browser-use Integration](/integrations/browseruse-deployment)
>
> Enhance Browser-Use capabilities with Anchor tools and cloud-based browser sessions
> [card] [Make Integration](/integrations/make)
>
> Integrate with Make (formerly Integromat) for no-code automation
> [card] [Zapier Integration](/integrations/zapier)
>
> Connect Anchor Browser to Zapier for no-code workflow automation
> [card] [CrewAI Integration](/agent-frameworks/crewai)
>
> Integrate with CrewAI to gain robust qualities of Anchor Browser implementing no-code automation.
> [card] [Langchain Integration](/agent-frameworks/langchain)
>
> Integrate with Langchain to leverage Anchor Browser's browser tools in your LLM workflows.
> [card] [Custom Integration](/agent-frameworks/custom-agent-framework)
>
> Integrate with your own platform to leverage Anchor Browser's in your automations.
## Quick API Examples
### Single Step Browser Tool Call
The easiest way to utilize Anchor Browser is through browser tools. Browser tools are API endpoints that wrap end-to-end browser functionality in a single API call.
```bash curl theme={null}
curl -X POST "https://api.anchorbrowser.io/v1/tools/perform-web-task" \
-H "anchor-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "go to ycombinator hacker news and get top 10 news"
}'
```
```javascript node.js theme={null}
const axios = require('axios');
const response = await axios.post('https://api.anchorbrowser.io/v1/tools/perform-web-task', {
prompt: 'go to ycombinator hacker news and get top 10 news'
}, {
headers: {
'anchor-api-key': process.env.ANCHOR_API_KEY,
'Content-Type': 'application/json'
}
});
console.log(response.data);
```
```python python theme={null}
import os
import requests
response = requests.post('https://api.anchorbrowser.io/v1/tools/perform-web-task',
json={
'prompt': 'go to ycombinator hacker news and get top 10 news'
},
headers={
'anchor-api-key': os.getenv('ANCHOR_API_KEY'),
'Content-Type': 'application/json'
}
)
print(response.json())
```
### Multi-Step Browser Flow
For use cases where a custom browser configuration is required, or a multi-step browser flow is needed:
**1. Fetch API Key**
In [Anchor UI](https://app.anchorbrowser.io/api-key), copy your API key
**2. Create a session**
[Create a session](/api-reference/browser-sessions/start-browser-session) with the desired configuration
**3. Use tools on the created session**
Perform [browser tool calls](/api-reference/ai-tools/perform-web-task) while referencing the created session ID
# Code Quick Start
Source: https://docs.anchorbrowser.io/quickstart/use-via-code
> [!NOTE]
>
> To **create a browser session** and connect with Playwright or Puppeteer, use [Create a Session](/quickstart/create-session). For configuration options at create time, see [Browser Sessions](/quickstart/browser-sessions).
This page covers additional patterns when calling the API directly without the SDK. For integrations (Make, LangChain, CrewAI), see [API Quick Start](/quickstart/use-via-api).
## Session reconnection
Reconnect to an existing session using the session CDP URL from a prior create response.
```javascript Node.js theme={null}
const { chromium } = require('playwright-core');
(async () => {
// sessionCdpUrl is the cdp_url returned when you created the session.
const browser = await chromium.connectOverCDP(sessionCdpUrl);
const page = await browser.newPage();
// ipinfo.io/json returns IP + geolocation as JSON, so there's no dependency
// on a specific page layout or CSS selector.
await page.goto('https://ipinfo.io/json');
const info = JSON.parse(await page.locator('pre').textContent());
console.log('IP:', info.ip);
console.log('Region:', info.region);
console.log('City:', info.city);
console.log('Country:', info.country);
await browser.close();
})().catch(console.error);
```
```python Python theme={null}
import os
import json
from playwright.sync_api import sync_playwright
ANCHOR_API_KEY = os.getenv('ANCHOR_API_KEY')
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(
f'wss://connect.anchorbrowser.io?apiKey={ANCHOR_API_KEY}&sessionId={session_id}'
)
page = browser.new_page()
# ipinfo.io/json returns IP + geolocation as JSON.
page.goto('https://ipinfo.io/json')
info = json.loads(page.locator('pre').text_content())
print('IP:', info['ip'])
print('Region:', info['region'])
print('City:', info['city'])
print('Country:', info['country'])
browser.close()
```
Closing the Playwright/Puppeteer connection does not end the Anchor session — the cloud browser stays active until it times out or you call [End Browser Session](/api-reference/browser-sessions/end-browser-session).
## Next steps
* [Create a Session](/quickstart/create-session) — SDK quick start
* [Browser Sessions](/quickstart/browser-sessions) — overview and configuration links
* [API Reference](/api-reference) — full endpoint catalog
# SDK Quick Start
Source: https://docs.anchorbrowser.io/quickstart/use-via-sdk
This page is a quick start using our official SDK.
For complete documentation and advanced usage examples, visit our package repositories:
* **Node.js**: [anchorbrowser on npm](https://www.npmjs.com/package/anchorbrowser)
* **Python**: [anchorbrowser on PyPI](https://pypi.org/project/anchorbrowser/)
**1. Fetch API Key**
In [Anchor UI](https://app.anchorbrowser.io/api-keys), copy your API key
**2. Install the SDK**
```bash node.js theme={null}
npm install anchorbrowser
```
```bash python theme={null}
pip install anchorbrowser
```
**3. Initialize the SDK**
Set up the Anchor Browser client with your API key:
```javascript node.js theme={null}
import { client } from "anchorbrowser";
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(
api_key=os.getenv("ANCHOR_API_KEY")
)
```
**4. AI Agent Browser Automation**
Use AI agents to automate browser tasks with natural language commands:
```javascript node.js theme={null}
import { agentTask } from "anchorbrowser";
(async () => {
// Simple navigation task
const result = await agentTask(
"go to news.ycombinator.com and get the title of the first story"
);
console.log("Task result:", result);
// Task with execution step monitoring
const executionStepLogs = [];
const navigationResult = await agentTask(
"go to news.ycombinator.com and get the title of the first story",
{
taskOptions: {
onAgentStep: (executionStep) => {
console.log("Agent step:", executionStep);
executionStepLogs.push(executionStep);
},
},
}
);
console.log("Navigation result:", navigationResult)
console.log("Execution step logs count:", executionStepLogs.length)
})();
```
```python python theme={null}
# Simple navigation task
result = anchor_client.agent.task(
"go to news.ycombinator.com and get the title of the first story"
)
print("Task result:", result)
# Task with execution step monitoring
execution_step_logs = []
def on_agent_step(execution_step):
print("Agent step:", execution_step)
execution_step_logs.append(execution_step)
navigation_result = anchor_client.agent.task(
"go to news.ycombinator.com and get the title of the first story",
task_options={
"on_agent_step": on_agent_step
}
)
print("Navigation result:", navigation_result)
print("Execution step logs count:", len(execution_step_logs))
```
## Additional Usage
### Structured Data Extraction
Extract structured data from webpages using schemas:
```javascript node.js theme={null}
import { z } from "zod";
import { agentTask } from "anchorbrowser";
(async () => {
// Define your data schema
const extractionSchema = z.object({
title: z.string(),
description: z.string(),
price: z.string().optional(),
});
// Extract structured data from product page
const structuredResult = await agentTask(
"Extract the product title, description, and price from this Amazon product page",
{
taskOptions: {
outputSchema: z.toJSONSchema(extractionSchema),
url: "https://www.amazon.com/dp/B0D7D9N7X3",
},
}
);
// agentTask returns { data: { result } }, where result is a JSON string.
const rawResult = structuredResult.data.result;
const parsedResult = JSON.parse(rawResult);
// Validate the result against your schema
const validatedData = extractionSchema.safeParse(parsedResult);
if (validatedData.success) {
console.log("Product title:", validatedData.data.title);
console.log("Description:", validatedData.data.description);
console.log("Price:", validatedData.data.price);
} else {
console.error("Validation failed:", validatedData.error);
}
})();
```
```python python theme={null}
from pydantic import BaseModel
from typing import Optional
import ast
# Define your data schema
class ProductSchema(BaseModel):
title: str
description: str
price: Optional[str] = None
# Extract structured data from product page
structured_result = anchor_client.agent.task(
"Extract the product title, description, and price from this Amazon product page",
task_options={
"output_schema": ProductSchema.model_json_schema(),
"url": "https://www.amazon.com/dp/B0D7D9N7X3"
}
)
# Validate the result
validated_data = ProductSchema.model_validate(ast.literal_eval(structured_result))
print("Product title:", validated_data.title)
print("Description:", validated_data.description)
print("Price:", validated_data.price)
```
### Screenshots
Capture screenshots of your current session view.
```javascript node.js theme={null}
import fs from "fs/promises";
import { Sessions, Tools, connectBrowser } from "anchorbrowser";
(async () => {
// Create a session for screenshot
const screenshotSession = await Sessions.createSession();
const screenshotBrowser = await connectBrowser(screenshotSession.data.id);
const screenshotPage = screenshotBrowser.contexts()[0].pages()[0];
await screenshotPage.goto("https://example.com");
// Capture screenshot from the session
const screenshot = await Tools.screenshotWebpage({
query: { sessionId: screenshotSession.data.id },
body: {},
});
// Get screenshot data
const buffer = await screenshot.arrayBuffer();
console.log("Screenshot captured, size:", buffer.byteLength);
// Save screenshot to file
await fs.writeFile("screenshot.png", Buffer.from(buffer));
console.log("Screenshot saved as screenshot.png");
})();
```
```python python theme={null}
# Create a session for screenshot
screenshot_session = anchor_client.sessions.create_session()
with anchor_client.browser.connect(screenshot_session.data.id) as screenshot_browser:
screenshot_page = screenshot_browser.contexts[0].pages[0]
screenshot_page.goto("https://example.com")
# Capture screenshot from the session
screenshot = anchor_client.tools.screenshot_webpage(
session_id=screenshot_session.data.id
)
# Get screenshot data
screenshot_data = screenshot.read()
print("Screenshot captured, size:", len(screenshot_data))
# Save screenshot to file
with open("screenshot.png", "wb") as f:
f.write(screenshot_data)
print("Screenshot saved as screenshot.png")
```
### Advanced Configuration
Configure browser sessions with proxies, timeouts, and other options:
```javascript node.js theme={null}
import { Sessions, agentTask } from "anchorbrowser";
// Create session with advanced configuration
const sessionConfig = {
session: {
recording: {active: false}, // Disable session recording
proxy: {
active: true,
country_code: "us",
},
timeout: {
max_duration: 5, // 5 minutes
idle_timeout: 1, // 1 minute
}
},
};
const configuredSession = await Sessions.createSession({ body: sessionConfig });
const result = await agentTask(
"What is my IP address and where am I?",
{
sessionId: configuredSession.data.id,
});
console.log(result);
```
```python python theme={null}
# Create session with advanced configuration
session_config = {
"recording": {"active": False}, # Disable session recording
"proxy": {
"active": True,
"country_code": "us"
},
"timeout": {
"max_duration": 5,
"idle_timeout": 1
}
}
configured_session = anchor_client.sessions.create_session(session=session_config)
result = anchor_client.agent.task(
session_options=configured_session,
prompt="What is my IP address and where am I?"
)
print(result)
```
## From SDK to Browser: Run Extra Playwright Code
### Standalone Browser Creation
Create a standalone browser instance:
```javascript node.js theme={null}
import { createBrowser } from "anchorbrowser";
(async () => {
// Create standalone browser
const { browser: standaloneBrowser } = await createBrowser();
const page = standaloneBrowser.contexts()[0].pages()[0];
await page.goto("https://httpbin.org/ip");
console.log("Current URL:", page.url());
// Disconnect (session keeps running)
standaloneBrowser.close();
})();
```
```python python theme={null}
# Create standalone browser
with anchor_client.browser.create() as standalone_browser:
page = standalone_browser.contexts[0].pages[0]
page.goto("https://httpbin.org/ip")
print("Current URL:", page.url)
```
### Browser Task with Session Control
Use AI agents with direct browser control:
```javascript node.js theme={null}
import { agentBrowserTask } from "anchorbrowser";
// browserTask starts the agent in the background and immediately returns the
// live Playwright browser for the same session.
const browserTask = await agentBrowserTask(
"go to github.com/trending and find the most popular JavaScript repository"
);
console.log("Session ID:", browserTask.sessionId);
// Let the agent finish its task BEFORE you drive the page yourself, otherwise
// your Playwright navigation and the agent fight over the same tab.
const taskResult = await browserTask.taskResultPromise;
console.log("Agent result:", taskResult.data.result);
// Now take manual control of the same session with Playwright.
const playwrightBrowser = browserTask.playwrightBrowser;
const page = playwrightBrowser.contexts()[0].pages()[0];
await page.goto("https://stackoverflow.com/");
console.log("Current URL:", page.url());
browserTask.playwrightBrowser.close();
```
```python python theme={null}
# Browser task with session control
browser_task = anchor_client.agent.browser_task(
"go to github.com/trending and find the most popular JavaScript repository"
)
print("Session ID:", browser_task["session_id"])
# Access the Playwright browser instance
playwright_browser = browser_task["playwright_browser"]
with playwright_browser as browser:
page = browser.contexts[0].pages[0]
# Direct Playwright manipulation
page.goto("https://stackoverflow.com/")
print("Current URL:", page.url)
# Wait for task completion (a concurrent.futures.Future)
task_result = browser_task["task_result_task"].result()
print("Final result:", task_result.data.result)
```
### Manual Session Management
Create and manage browser sessions manually:
```javascript node.js theme={null}
import { Sessions, connectBrowser } from "anchorbrowser";
// Create session and connect it later
const sessionResponse = await Sessions.createSession();
const sessionId = sessionResponse.data.id;
const browser = await connectBrowser(sessionId);
const context = browser.contexts()[0];
const page = context.pages()[0];
await page.goto("https://reddit.com/r/programming");
console.log("Current URL:", page.url());
browser.close();
```
```python python theme={null}
# Create session and connect it later
session_response = anchor_client.sessions.create_session()
session_id = session_response.data.id
with anchor_client.browser.connect(session_id) as browser:
context = browser.contexts[0]
page = context.pages[0]
page.goto("https://reddit.com/r/programming")
print("Current URL:", page.url)
```
## Key SDK Benefits
The Anchor Browser SDK provides several advantages over direct API usage:
* **AI Agent Integration**: Use natural language to automate complex browser tasks
* **Structured Data Extraction**: Define schemas and extract data in a predictable format
* **Seamless Playwright Integration**: Full access to Playwright's powerful browser automation capabilities
* **Session Management**: Easy creation and management of persistent browser sessions
* **Built-in Tools**: Screenshot capture, proxy management, and more
* **Type Safety**: Full TypeScript support with proper type definitions
## Retries
The Node.js client retries status `408`, `409`, `429`, and any `5xx`, plus connection failures and request timeouts, up to 2 more times (`maxRetries` defaults to `2`). The default timeout is 1 hour. It does not send an `Idempotency-Key`. Pass `maxRetries: 0` to turn retries off for a call.
A retried `5xx`, `409`, or timeout on session create can start a second session, because the server may still be provisioning. A `429` from the per-minute session-create limiter is safe to retry.
## Next Steps
* Explore the [API Reference](/api-reference) for detailed documentation
* Learn about [Managed Authentication](/essentials/managed-authentication)
* Check out [Advanced Proxy Configuration](/advanced/proxy) for location-specific browsing
# Creating a Task
Source: https://docs.anchorbrowser.io/tasks/creating-a-task
Create reusable browser tasks from a demonstration or prompt.
## Overview
Automation Tasks are reusable browser automations you define once and run reliably in production. Anchor generates a versioned task from your input — combining deterministic automation with AI-assisted steps where needed.
> [card] [Automation Tasks Overview](/tasks/overview)
>
> Visual tour of prompts, demonstrations, the workflow UI, runs, editing, and self-healing.
## Ways to create a task
| Method | Best for |
| - | - |
| [**Demonstration**](#create-from-a-demonstration) | Show the flow once in a live browser |
| [**Prompt**](#create-from-a-prompt) | Describe what the task should accomplish in natural language |
Both paths produce the same result: a task you can test and call from your application.
> [card] [Create from a demonstration](#create-from-a-demonstration)
>
> Demonstrate a task in a live browser. Anchor captures your actions and builds a reusable task.
> [card] [Create from a prompt](#create-from-a-prompt)
>
> Describe what the task should accomplish. Anchor generates the task from your description.
## Create from a demonstration
Demonstrate a task in a live browser — navigate, click, fill forms, download files. As you work, Anchor captures every browser event and compiles them into **deterministic, repeatable code**.
### In the Anchor UI
**1. Open the Tasks page**
Go to [Tasks](https://app.anchorbrowser.io/tools) and click **Create Task**.
**2. Set up identity and describe the task**
The creation wizard walks you through four steps:
1. **Identity** — enter the application URL (and an identity, if the task requires login).
2. **Task Definition** — describe what the task should do in natural language.
3. **Demonstration** — choose to demonstrate the task yourself.
4. **Review** — confirm the task name, inputs, and outputs before saving.
**3. Start the demonstration**
On the **Demonstration** step, select the option to demonstrate the task manually, then click **Continue**.
A live browser opens at your start URL. Perform the task — navigate, click, fill forms, download files. Anchor captures every browser event as you go.
> [!TIP]
>
> **Pro tip:** Right-click anywhere to investigate elements or data. Those inspection moments give richer context to your final task.
**4. Finish and create the task**
Click **Finish Demonstration** when you're done. Review the generated inputs and outputs on the **Review** step, then save the task.
### Shareable demonstrations
To collect a demonstration from someone who works outside your Anchor workspace, use the [Demonstrations API](/advanced/demonstrations-api) to issue a secure demonstration link. They complete the task in a hosted browser session; Anchor processes the session and delivers the generated task to your workspace.
> [card] [Demonstrations API](/advanced/demonstrations-api)
>
> Create demonstration links, monitor session status, and retrieve the generated task.
## Create from a prompt
Describe what the task should do. Anchor generates the automation from your `taskPrompt`.
> [accordion] How to structure your prompt
>
> | Section | Include |
> | - | - |
> | **Objective** | What the task should accomplish |
> | **Start URL** | Where the browser opens |
> | **Inputs** | Runtime values as `{{parameter_name}}` |
> | **Steps** | Ordered actions, one per line |
> | **Output** | Fields to return when the task completes |
>
> **Example prompt**
>
> ```text theme={null}
> Objective: Export the monthly invoice report as a PDF.
>
> Start URL: https://www.princexml.com/samples/
>
> Inputs:
> - report_name (required): The report to export
>
> Steps:
> 1. Open Reports
> 2. Search for {{report_name}}
> 3. Open the first matching result
> 4. Click Export → PDF
> 5. Wait 5 seconds after clicking the download
> 6. Confirm the download completed
>
> Output: report_title, exported_file_name
> ```
>
> Add edge cases when they matter — e.g. "If no exact match is found, use the closest result."
### In the UI
1. Open [Tasks](https://app.anchorbrowser.io/tools) and click **Create Task**.
2. Enter a name and describe the task — what site to visit, what to click, what data to return.
3. Wait for generation to finish, then test with sample inputs.
### Via API
Call `POST /v2/tasks/generate`, then poll `GET /v2/tasks/{taskId}/generation-status` until `status` is `ready`.
```javascript node.js theme={null}
import { client } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const { data: { id: taskId } } = await client.post({
url: '/v2/tasks/generate',
body: {
taskName: 'invoice-report-export',
description: 'Export the monthly invoice report as a PDF',
taskPrompt: `Objective:
Export the monthly invoice report as a PDF.
Start URL:
https://www.princexml.com/samples/
Inputs:
- report_name (required): The report to export
Steps:
1. Open Reports
2. Search for {{report_name}}
3. Open the first matching result
4. Click Export → PDF
5. Wait 5 seconds after clicking the download
6. Confirm the download completed
Output:
- report_title
- exported_file_name`,
},
});
let status;
do {
({ data: { status } } = await client.get({ url: `/v2/tasks/${taskId}/generation-status` }));
if (status === 'failed') throw new Error('Task generation failed');
if (status !== 'ready') await new Promise((r) => setTimeout(r, 3000));
} while (status !== 'ready');
console.log('Task ready:', taskId);
```
```python python theme={null}
import os
import time
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
response = anchor_client.tasks.generate_task(
task_name='invoice-report-export',
description='Export the monthly invoice report as a PDF',
task_prompt="""Objective:
Export the monthly invoice report as a PDF.
Start URL:
https://www.princexml.com/samples/
Inputs:
- report_name (required): The report to export
Steps:
1. Open Reports
2. Search for {{report_name}}
3. Open the first matching result
4. Click Export → PDF
5. Wait 5 seconds after clicking the download
6. Confirm the download completed
Output:
- report_title
- exported_file_name""",
)
task_id = response.id
while True:
status_response = anchor_client.tasks.get_task_generation_status(task_id)
status = status_response.status
if status == 'failed':
raise RuntimeError('Task generation failed')
if status == 'ready':
break
time.sleep(3)
print('Task ready:', task_id)
```
**Optional fields** on `POST /v2/tasks/generate`:
| Field | Purpose |
| - | - |
| `application_id` | Tie the task to a managed application |
| `identity_id` | Pre-authenticate with a saved identity |
| `input_schema` / `output_schema` | Define typed inputs and outputs up front |
| `human_intervention` | Allow the task to pause for human input |
| `retries` | Retry a failed run on a new browser, `0` to `3`. Defaults to `0`. See [Retries](/tasks/run-a-task#retries). |
| `task_browser_default_configuration` | Default browser session settings for runs |
## Next steps
* [Run a Task](/tasks/run-a-task) — execute a task via API with inputs, identity, and session options
* [Which task type?](/tasks/which-task-type) — compare Automation Tasks with Perform Web Task
* [Demonstrations API](/advanced/demonstrations-api) — shareable links for demonstrating a task
* [Task Examples](/examples/task-examples) — browse ready-made tasks in the library
# Automation Tasks Overview
Source: https://docs.anchorbrowser.io/tasks/overview
See how Automation Tasks work in the Anchor UI — demonstrate a flow, inspect the workflow, run it step by step, and apply self-healing fixes when sites change.
Automation Tasks let you automate any website workflow — download a report, fill a form, extract data — and run it reliably in production. You define the task once in the [Anchor UI](https://app.anchorbrowser.io/tools), then call it from your app or run it on demand.
This page walks through the main capabilities with screenshots from the product. For API integration, see [Creating a Task](/tasks/creating-a-task) and [Run a Task](/tasks/run-a-task).
## Create from a prompt or demonstration
There are two ways to create a task:
* **Prompt** — describe what the task should do in natural language (objective, start URL, steps, and expected output).
* **Demonstration** — perform the task once in a live browser while Anchor records your actions.
Both produce the same result: a versioned workflow you can test, edit, and deploy.
### Demonstrate the task
During creation, choose to demonstrate the task manually. A live browser opens at your start URL. As you navigate, click, and fill forms, Anchor captures every event in the sidebar.

Perform the task in a live browser — Anchor records navigation, clicks, and form fills as you go
> [!TIP]
>
> Right-click anywhere in the browser to inspect elements or data. Those moments give Anchor richer context when building the final task.
When you're done, click **Finish Demonstration**. Anchor compiles your actions into a repeatable workflow.
You can also send a [shareable demonstration link](/advanced/demonstrations-api) to someone outside your workspace.
### Describe it in a prompt
Prefer writing over clicking? Describe the task on the **Task Definition** step — what site to open, what to do, which values change between runs (`{{report_name}}`, `{{email}}`, and so on), and what to return. Anchor generates the workflow from your description.
See [Creating a Task](/tasks/creating-a-task#create-from-a-prompt) for a prompt template and examples.
## The workflow page
The **Workflow** tab is where you understand and refine how a task actually works. Anchor compiles your prompt or demonstration into a graph of segments — each segment is a discrete step with its own behavior, inputs, and outputs.
| Step type | What it does |
| - | - |
| **UI** | Interact with the page — navigate, click, fill forms, extract visible content. The default for most actions. |
| **Network** | Read data from API responses captured during the session. Use when the response payload is more reliable than the DOM. |
| **Logic** | Deterministic checks and control flow with no AI fallback — validation, hard errors, or branching on known values. |
| **Agent** | AI judgment for subjective decisions — for example choosing the "best" or most relevant match. |
> [!NOTE]
>
> UI and Network steps run Playwright code first and can [fall back to AI](/advanced/self-healing#ai-fallback) if that code fails. Logic steps never fall back. Agent steps are AI-only. See [Code Tasks](/advanced/legacy-tasks#segment-types) for the full schema reference.

The Workflow tab shows every step in your automation — click a step to inspect it, or use Edit Workflow to change the task
**Inspect any step.** Click a segment on the graph to open its detail panel. You'll see the prompt that drives the step, its input and output parameters, and — for deterministic segments — the actual Playwright code that runs when the task executes. Agent, logic, and network segments show their respective configuration instead. This is how you verify what Anchor generated and understand why a step behaves the way it does.
**Edit step code directly.** From the detail panel, click the pencil icon on a segment's deterministic code to open the snippet editor. Change selectors, add waits, or adjust logic — then save as a draft and test before publishing.
**Edit the whole workflow.** Use **Edit Workflow** in the header to describe changes in plain language — for example, "also return the downloaded filename in the output." Anchor applies the change across the workflow and saves it as a draft version.
**Run and version.** Click **Run Task** to test the current version with real inputs. The **Runs** tab lists every past execution; **Settings** controls identity, human-in-the-loop, [retries](/tasks/run-a-task#retries), and default browser configuration.
See [Code Tasks — Manually editing workflow JSON](/advanced/legacy-tasks#manually-editing-workflow-json) for hand-editing the full workflow JSON via API.
## Run a task
Starting a run opens a live execution view. Anchor launches a browser, authenticates if needed, and walks through each segment in order.

Watch the live browser, follow step-by-step logs, and see the workflow graph update as each step completes
While a run is in progress:
* The **live browser** shows what Anchor is doing on the site right now.
* The **steps panel** streams per-segment logs with timestamps — expand any step to see when it started, completed, or hit an error.
* The **workflow graph** at the bottom highlights each segment as it runs: green for success, spinner for in progress.
Use **Stop** to cancel a run that is still going.
## View a run
Once a run finishes — or when you need to debug a past failure — open it from the **Runs** tab via **View run**. This is the primary tool for understanding what actually happened.
The view-run page uses the same layout as the live run, but swaps the live browser for a **session recording** you can scrub through. Everything is tied to the workflow graph:
* **Replay what happened** — watch the full browser session recording to see exactly what Anchor did on the page.
* **Jump to a step** — click any segment on the graph and the recording seeks to that moment. Pair this with the step logs on the right to pinpoint where things went wrong.
* **Review inputs and output** — see the values passed into the run and the structured data returned (or the error message if it failed).
* **Spot AI fallback** — runs where deterministic code failed but an agent recovered are tagged **AI Fallback**, so you know which steps are fragile.
* **Check the attempts** — a run that retried is tagged **N attempts**, with a per-attempt breakdown of status, duration, and browser session. See [Retries](/tasks/run-a-task#retries).
From a completed run you can also **rerun** with the same inputs, open the underlying **browser session**, or — when self-healing applies — review and apply a suggested fix.
## Self-healing
Websites change. Buttons move, pages load slower, layouts shift. When you're reviewing a run in **View run**, Anchor surfaces what went wrong and how to fix it.
**During a run** — if a step's deterministic code fails, Anchor retries it with an AI agent so the run can still finish. Runs that used this path are tagged **AI Fallback**.
**After a run** — Anchor analyzes execution logs, browser actions, and page snapshots, then suggests a durable fix to the workflow itself.
Need runs to stay strictly deterministic? Turn **Allow AI in this task** off under **Settings** — the step then fails with its underlying error instead of being retried. Self-healing still proposes a fix as a draft version for you to review. See [Turning AI fallback off](/advanced/self-healing#turning-ai-fallback-off).

When a step needed AI fallback, Anchor explains what broke and offers a one-click fix
On runs where self-healing applies, you'll see:
* **Root cause** — a plain-language explanation of why the deterministic step failed.
* **Suggested fix** — what Anchor recommends changing so the next run doesn't need AI fallback.
* **Apply fix** — one click to update the workflow with the repair. Test the new version from the Workflow tab, then publish.
Subscribe to the `task.healed` [webhook event](/webhooks/events) to get notified automatically. See [Self-healing](/advanced/self-healing) for the full technical details.
## Next steps
> [card] [Creating a Task](/tasks/creating-a-task)
>
> Create tasks from a prompt or demonstration, in the UI and via API.
> [card] [Run a Task](/tasks/run-a-task)
>
> Execute tasks with inputs, identity, and sync or async modes.
> [card] [Self-healing](/advanced/self-healing)
>
> AI fallback during runs and automatic workflow repair after failures.
> [card] [Task Examples](/examples/task-examples)
>
> Browse ready-made tasks in the Anchor library.
# Run a Task
Source: https://docs.anchorbrowser.io/tasks/run-a-task
Execute an Automation Task via the API — inputs, identity, sessions, sync, and polling.
## Overview
Call `POST /v2/tasks/{taskId}/run` with `input_params` matching the task's input schema. The response includes `run_id` and `status`. By default runs are async — poll for the result, or set `sync: true` to block until completion.
The route does not read an `Idempotency-Key`. Calling it again starts a new run. That is separate from the task's own [retries](#retries), which re-run a failed attempt inside one run.
## Basic usage
```javascript node.js theme={null}
import { client, Tasks } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
const run = await Tasks.runTask({
path: { taskId },
body: {
input_params: { report_name: 'Monthly Invoice - February 2026' },
},
});
console.log('Run ID:', run.run_id, 'Status:', run.status);
```
```python python theme={null}
import os
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
run = anchor_client.tasks.run_task(
task_id,
input_params={'report_name': 'Monthly Invoice - February 2026'},
)
print('Run ID:', run.run_id, 'Status:', run.status)
```
## Request parameters
| Field | Required | Default | Description |
| - | - | - | - |
| `input_params` | Yes | — | Values matching the task's input schema |
| `identity_id` | No | — | Identity to authenticate before the run. See [Identities](/essentials/authenticated-applications). |
| `session_id` | No | — | Run inside an existing browser session instead of creating a new one |
| `cleanup_sessions` | No | `true` | End the browser session when the run finishes |
| `sync` | No | `false` | Wait for completion; response includes `result` or `error` |
| `version` / `version_id` | No | latest | Task version to run. List versions with `GET /v2/tasks/{taskId}/versions`. |
| `identity_skip_validation` | No | — | Skip identity validation before the run |
`input_params` keys must match names from the task's input schema. Pass `cleanup_sessions: false` with `session_id` to keep the session open for follow-up work.
> [!NOTE]
>
> Retries are **not** a request parameter. `retries` is stored on the task definition and applies to every run of that task, so it is not accepted in the `/run` body. Passing `session_id` does affect it: a run that supplies its own session takes a single attempt regardless of the task's `retries` value. See [Retries](#retries).
## Task config vs session config
Browser settings — proxy, viewport, profile, timeouts, CAPTCHA solver — live in a **session config**: a `session` block and a `browser` block, same schema as [starting a browser session](/api-reference/browser-sessions/start-browser-session).
A task stores its own copy of that schema as `task_default_browser_configuration`. This is **not** sent on each run request. It tells Anchor how to configure the browser when it **creates a session for you**.
| How the run gets a browser | Which config applies |
| - | - |
| Omit `session_id` (default) | Anchor creates a session using the task's `task_default_browser_configuration` |
| Pass `session_id` | The existing session's config — created earlier via `POST /v1/sessions` or another run |
Set task defaults once with `PATCH /v1/tools/{toolId}` (or `task_browser_default_configuration` on `POST /v2/tasks/generate`):
```javascript node.js theme={null}
await client.patch({
url: `/v1/tools/${toolId}`,
body: {
human_intervention: true,
task_default_browser_configuration: {
session: {
timeout: { max_duration: 30 },
proxy: { active: true, type: 'anchor_residential', country_code: 'US' },
},
browser: {
captcha_solver: { active: true },
profile: { name: 'my-task-profile', persist: true },
},
},
},
});
```
```python python theme={null}
anchor_client.patch(
f'/v1/tools/{tool_id}',
body={
'human_intervention': True,
'task_default_browser_configuration': {
'session': {
'timeout': {'max_duration': 30},
'proxy': {'active': True, 'type': 'anchor_residential', 'country_code': 'US'},
},
'browser': {
'captcha_solver': {'active': True},
'profile': {'name': 'my-task-profile', 'persist': True},
},
},
},
)
```
Set `task_default_browser_configuration` to `null` to clear it. Per-run, the only session-related fields on `/run` are `session_id` (use an existing session) and `identity_id` (authenticate that session). Everything else comes from the task default or the session you created.
See [Proxy](/advanced/proxy), [Session timeout](/advanced/session-timeout), and [CAPTCHA solving](/advanced/captcha-solving) for common `session` and `browser` options.
## Get results
**Sync** — add `"sync": true` to the run request. The response includes `result` on success or `error` on failure.
**Async** (default) — poll `GET /v2/tasks/runs/{runId}/status` until `status` is `success`, `failure`, `timeout`, or `cancelled`.
```javascript node.js theme={null}
import { client, Tasks } from 'anchorbrowser';
client.setConfig({ auth: () => process.env.ANCHOR_API_KEY });
// Sync
const syncRun = await Tasks.runTask({
path: { taskId },
body: { input_params: { report_name: 'Q1 Summary' }, sync: true },
});
// Async — poll after starting
let status = await Tasks.runTask({
path: { taskId },
body: { input_params: { report_name: 'Q1 Summary' } },
});
while (!['success', 'failure', 'timeout', 'cancelled'].includes(status.status)) {
await new Promise((r) => setTimeout(r, 2000));
status = await Tasks.getTaskRunStatus({ path: { runId: status.run_id } });
}
```
```python python theme={null}
import os
import time
from anchorbrowser import Anchorbrowser
anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))
# Sync
sync_run = anchor_client.tasks.run_task(
task_id,
input_params={'report_name': 'Q1 Summary'},
extra_body={'sync': True},
)
# Async — poll after starting
status = anchor_client.tasks.run_task(
task_id,
input_params={'report_name': 'Q1 Summary'},
)
while status.status not in ('success', 'failure', 'timeout', 'cancelled'):
time.sleep(2)
status = anchor_client.tasks.get_task_run_status(status.run_id)
```
> [!TIP]
>
> Use sync for short tasks and scripts. Poll for long-running production runs.
Tasks with **output file only** may return the file in the HTTP body when `sync: true` instead of JSON.
## Retries
`retries` is set on the **task**, not per run, so every run of that task uses it. It is an integer from `0` to `10` on task create and update (and in the dashboard **Settings** tab), and from `0` to `3` on `POST /v2/tasks/generate`. It defaults to `0`, and it counts retries rather than attempts: `retries: 2` means one initial attempt plus up to two retries, three attempts in total.
Every attempt runs on a brand-new browser session. Nothing carries over from the attempt before it: no cookies, no local storage, no open pages. Retrying stops as soon as an attempt succeeds, and the run reports that attempt's result.
**A run emits exactly one webhook.** A run that fails and then succeeds sends a single `task.completed` and zero `task.failed`. Intermediate attempts never reach your endpoint, so retry logic built on `task.failed` never sees them. See [Webhook events](/webhooks/events).
| Outcome | Retried |
| - | - |
| Task code failed | Yes |
| Browser session could not be created | Yes |
| Run timed out | No |
| Run was cancelled | No |
| Identity authentication failed | No |
A timed-out or cancelled run has already spent its budget. Identity authentication is excluded because each attempt performs a real login, and repeated failed logins from different IP addresses can lock the account. Passing `session_id` also forces a single attempt: a retry needs a new browser, and that session belongs to you.
`GET /v1/executions/{executionId}/metadata` returns the run's metadata, including an `attempts` array under `metadata.attempts` ordered by attempt number. It is empty for a run that never retried. Each entry carries its own `browserSessionId`, so you can open the browser session for any single attempt.
```json theme={null}
{
"metadata": {
"attempts": [
{
"attempt": 1,
"status": "failure",
"browserSessionId": "5f1c9a3e-1d2b-4f77-9a0e-7c3b8e5d1a44",
"errorMessage": "Timeout waiting for selector #export-pdf",
"executionTime": 41230
},
{
"attempt": 2,
"status": "success",
"browserSessionId": "b0a7d612-8c44-4a19-bb60-2f9e0c11d7a3",
"errorMessage": null,
"executionTime": 28870
}
]
}
}
```
Two things are stored per run rather than per attempt. **Logs and artifacts** are the final attempt's; earlier attempts' logs are not retained. **Duration** is the final attempt's execution time rather than the sum across attempts, so use the per-attempt timings when you need the total.
## Next steps
* [Creating a Task](/tasks/creating-a-task) — create tasks from a demonstration or prompt
* [Automation Tasks Overview](/tasks/overview) — UI walkthrough of workflows, runs, and self-healing
* [API Reference](/api-reference/tasks/run-a-task) — full endpoint schemas
# Which task type?
Source: https://docs.anchorbrowser.io/tasks/which-task-type
Anchor Browser supports two ways to control the browser: Perform Web Task and Automation Tasks.
## Perform Web Task
You pass a single natural-language instruction to an agent on the browser. The agent performs that one instruction — navigating, clicking, extracting — and returns the result. It does not manage a larger flow; you decide when to call it and what to do with the result.
Use it for ad hoc, exploratory, or frequently changing flows where you don't need the same result every time.
Call it with `agent.task` in the SDK or `perform-web-task` over REST. Supports async execution.
* [Perform Web Task](/agentic-browser-control/ai-task-completion)
* [Async execution](/agentic-browser-control/async-perform-web-task)
## Automation Tasks
You define a task by writing a prompt or demonstrating it, and Anchor compiles it into deterministic code and a reusable workflow. Runs repeat reliably and produce consistent output. If the deterministic code breaks — for example when a page changes — the workflow [falls back to AI](/advanced/self-healing#ai-fallback) to complete that step, and Anchor can [self-heal](/advanced/self-healing#workflow-self-healing) the workflow afterward.
Use it for repeated workflows that need to run the same way every time — production, CI, or anything you deploy and reuse.
Tasks can be versioned, edited by hand, and shared with end users as links.
**Code Tasks** — write TypeScript yourself or hand-edit workflow JSON when you need direct control over the automation code.
* [Automation Tasks Overview](/tasks/overview)
* [Creating a Task](/tasks/creating-a-task)
* [Run a Task](/tasks/run-a-task)
* [Self-healing](/advanced/self-healing)
* [Code Tasks](/advanced/legacy-tasks)
## Comparison
| | Perform Web Task | Automation Tasks |
| - | - | - |
| You provide | A natural-language instruction, per call | A prompt or a demonstration |
| Flow control | You decide each call; agent executes one instruction | Defined by the workflow |
| Behavior | Varies run to run | Deterministic, consistent across runs |
| Best for | Ad hoc, exploratory, changing flows | Repeated, reliable, cost heavy production runs |
# Execute Code Snippet
Source: https://docs.anchorbrowser.io/tools/execute-code-snippet
Run a TypeScript snippet inside an existing browser session
The execute-code tool runs a TypeScript snippet inside an existing browser session, letting you perform custom browser logic without managing your own automation infrastructure.
> [!NOTE]
>
> Code Execution is available from the [Growth tier](https://app.anchorbrowser.io/billing) and above.
Create a session with `POST /v1/sessions`, then call `POST /v1/tools/execute-code` with `sessionId` in the query string. The request body `code` field is an async function body with injected `page`, `browser`, `context`, `sessionId`, and `anchorClient`. On success, the API returns `output` as a JSON string of your return value.
See the full [API reference](/api-reference/tools/execute-code-snippet) for details.
### Code example
```javascript node.js theme={null}
const apiKey = process.env.ANCHOR_API_KEY;
async function createSession() {
const res = await fetch('https://api.anchorbrowser.io/v1/sessions', {
method: 'POST',
headers: {
'anchor-api-key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const json = await res.json();
if (!res.ok) {
throw new Error(`create session failed: ${res.status} ${JSON.stringify(json)}`);
}
return json.data.id;
}
const sessionId = await createSession();
console.log('session', sessionId);
const res = await fetch(`https://api.anchorbrowser.io/v1/tools/execute-code?sessionId=${sessionId}`, {
method: 'POST',
headers: {
'anchor-api-key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({
code: "await page.goto('https://news.ycombinator.com'); const title = await page.title(); return { title };",
}),
});
const body = await res.json();
console.log(body);
```
# Screenshot Webpage
Source: https://docs.anchorbrowser.io/tools/screenshot-webpage
Get a fully javascript-rendered screenshot of a given webpage
The screenshot tool captures a fully javascript-rendered screenshot of a given webpage using Chromium, without writing any automation code. Call `POST /v1/tools/screenshot` with the target `url`, and the API returns the captured image as a PNG.
The tool can run standalone or against an existing browser session — pass an optional `sessionId` query parameter to execute it on a running session (for example, to capture a page behind authentication).
> [!NOTE]
>
> PDF URLs are not supported by the screenshot tool.
### Request options
* **`url`**: The URL of the webpage to capture.
* **`width`** / **`height`**: Browser viewport dimensions in pixels.
* **`image_quality`**: Quality of the output image, on the range 1-100. 100 will not perform any compression.
* **`wait`**: Duration in milliseconds to wait after the page has loaded, mainly used for sites with JS animations.
* **`scroll_all_content`**: If true, scrolls the page and captures all visible content.
* **`capture_full_height`**: If true, captures the entire height of the page, ignoring the viewport height.
* **`s3_target_address`**: Presigned S3 url target to upload the image to.
See the full [API reference](/api-reference/tools/screenshot-webpage) for details.
### Code example
```javascript node.js theme={null}
const fs = require('fs');
const apiKey = process.env.ANCHOR_API_KEY;
const res = await fetch('https://api.anchorbrowser.io/v1/tools/screenshot', {
method: 'POST',
headers: {
'anchor-api-key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://news.ycombinator.com',
width: 1440,
height: 900,
capture_full_height: true,
}),
});
if (!res.ok) {
throw new Error(`screenshot failed: ${res.status} ${await res.text()}`);
}
const buffer = Buffer.from(await res.arrayBuffer());
fs.writeFileSync('screenshot.png', buffer);
console.log('saved screenshot.png');
```
# Events
Source: https://docs.anchorbrowser.io/webhooks/events
Catalog of webhook event types and the JSON payload each one carries.
Event names follow `.`.
## Envelope
All events share the same outer envelope:
```json theme={null}
{
"id": "evt_",
"type": "",
"created": "",
"project_id": "",
"text": "",
"data": { "...event-specific fields..." }
}
```
The `text` field is a one-line summary of the event built from `data`. It's intended for two use cases:
* **Slack incoming webhooks** — Slack expects `{ "text": "..." }` at the top level, so registering a Slack webhook URL as your receiver renders each event as a chat message with no relay needed.
* **Logs / CLI tools** — gives an at-a-glance description without per-type formatting.
The structured data you should integrate against still lives in `data`; treat `text` as presentation only.
The headers are described in [Overview → Receive events](/webhooks/overview#2-receive-events) and signed per [Signature verification](/webhooks/signature-verification).
## Tasks
| Event | Fired when |
| - | - |
| `task.completed` | A task execution finishes successfully. Carries artifacts and a recording link if a session was used. |
| `task.failed` | A task execution fails (any reason). The `data.error.type` field tells you whether it was `automation_failure`, `invalid_credentials`, `timeout`, `agent_error`, or `system_error`. |
| `task.cancelled` | A task execution was cancelled (e.g. via the API or dashboard). |
| `task.healed` | Anchor's self-heal produced a new task version after a failure. The notification points at the new `healed_task_version_id` so your CI/ops can review or auto-promote the fix. |
> [tab] completed
>
> `completed`, `failed`, and `cancelled` all include the same rich-output fields:
>
> * `run_id` — the same id returned synchronously by `POST /v2/tasks/{taskId}/run`. Present only for executions started through that endpoint; use it to correlate a webhook back to the run you started. `task_id` is shared by every run of a task, so use `run_id` (or `execution_id`) to identify a specific run.
> * `artifacts[]` — task artifacts and per-session downloads, each with a `name`, `url`, and (when known) `size` and `content_type`. Empty when nothing was captured.
> * `recording_url` — stable API link to the primary session recording (`/v1/sessions/{session_id}/recordings/{recording_id}/fetch`). Requesting it 302-redirects to a fresh short-lived presigned download URL, so the link keeps working even if you process the webhook later. Subscribe to `session.recording.ready` if you need a stable signal that the recording is ready (then fetch it via the [Recordings API](/api-reference/recordings)).
> * `session_dashboard_url` — direct link into the Anchor dashboard for the underlying session.
>
> ```json theme={null}
> {
> "type": "task.completed",
> "data": {
> "task_id": "tsk_4f8w9n2b-3d5a-45e7-89ab-cdef0123456f",
> "task_version_id": "tv_demo_v3",
> "execution_id": "exr_8d2c1fda-7b6e-4a3d-9c1f-0e2b3a4c5d6e",
> "run_id": "task-run-f26782d4",
> "session_id": "ses_8d2c1fda",
> "execution_mode": "deterministic",
> "duration_ms": 4218,
> "cost": { "amount": 0.012, "currency": "USD" },
> "output": { "value": { "order_id": "8421", "status": "confirmed" } },
> "artifacts": [
> {
> "name": "order-confirmation.pdf",
> "url": "https://api.anchorbrowser.io/v1/executions/exr_8d2c1fda/artifacts/art_1/fetch",
> "size": 38421,
> "content_type": "application/pdf"
> }
> ],
> "recording_url": "https://api.anchorbrowser.io/v1/sessions/ses_8d2c1fda/recordings/rec_8d2c1fda/fetch",
> "session_dashboard_url": "https://app.anchorbrowser.io/sessions/ses_8d2c1fda"
> }
> }
> ```
> [tab] failed
>
> Same shape as `task.completed` plus an `error` object. The `error.type` lets you route programmatically — one of `agent_error`, `timeout`, `automation_failure`, `invalid_credentials`, `system_error`.
>
> ```json theme={null}
> {
> "type": "task.failed",
> "data": {
> "task_id": "tsk_4f8w9n2b",
> "task_version_id": "tv_demo_v3",
> "execution_id": "exr_8d2c1fda",
> "run_id": "task-run-f26782d4",
> "session_id": "ses_8d2c1fda",
> "duration_ms": 1834,
> "cost": { "amount": 0.005, "currency": "USD" },
> "error": {
> "type": "automation_failure",
> "message": "Submit button selector did not match after 30s",
> "root_cause": "Selector drift after target site redesign"
> },
> "artifacts": [],
> "recording_url": "https://api.anchorbrowser.io/v1/sessions/ses_8d2c1fda/recordings/rec_8d2c1fda/fetch",
> "session_dashboard_url": "https://app.anchorbrowser.io/sessions/ses_8d2c1fda"
> }
> }
> ```
> [tab] cancelled
>
> Same shape as `task.completed`, with no `output` and `type: "task.cancelled"`.
>
> ```json theme={null}
> {
> "type": "task.cancelled",
> "data": {
> "task_id": "tsk_4f8w9n2b-3d5a-45e7-89ab-cdef0123456f",
> "task_version_id": "tv_demo_v3",
> "execution_id": "exr_8d2c1fda-7b6e-4a3d-9c1f-0e2b3a4c5d6e",
> "run_id": "task-run-f26782d4",
> "session_id": "ses_8d2c1fda",
> "execution_mode": "deterministic",
> "duration_ms": 2103,
> "cost": { "amount": 0.007, "currency": "USD" },
> "artifacts": [],
> "session_dashboard_url": "https://app.anchorbrowser.io/sessions/ses_8d2c1fda"
> }
> }
> ```
> [tab] healed
>
> ```json theme={null}
> {
> "type": "task.healed",
> "data": {
> "task_id": "tsk_4f8w9n2b",
> "healed_task_version_id": "tv_demo_v4",
> "source_execution_id": "exr_8d2c1fda",
> "run_id": "task-run-f26782d4",
> "error_explanation": "Submit button moved into a new container.",
> "fix_suggestion": "Use accessible label selector instead of XPath.",
> "confidence_score": 0.82,
> "published_as_draft": true
> }
> }
> ```
## Sessions
| Event | Fired when |
| - | - |
| `session.ready` | An [async](/essentials/async-session) or batch browser session finished provisioning and is connectable. Carries `cdp_url` and `live_view_url`, plus the `request_id` you got back from `POST /v1/sessions/async` — subscribe to this instead of polling the status endpoint. |
| `session.completed` | A browser session finished cleanly. Includes duration and resource-usage breakdown (proxy bytes, network bytes, steps, screenshots, visited domains). |
| `session.failed` | A browser session was terminated abnormally — pod gone, browser unreachable, or any other non-clean termination. |
| `session.recording.ready` | The session recording finished uploading. Carries the recording duration, size, and a dashboard URL — fetch the actual recording via the [Recordings API](/api-reference/recordings) to get a fresh presigned link. |
| `intervention.requested` | The agent paused and is waiting for a human (CAPTCHA, MFA, custom confirm). Includes a `live_view_url` for one-click takeover. |
| `intervention.resolved` | The intervention was responded to (by your code or a teammate). |
> [tab] session.ready
>
> Fired for sessions created through `POST /v1/sessions/async` (and batch sessions) the moment the browser is configured and reachable — the same moment the [async status endpoint](/essentials/async-session#poll-for-readiness) starts reporting `ready`. `request_id` matches the id returned when you created the async request, so you can correlate the event back to your request without polling. Connect over CDP using `cdp_url` exactly as you would for a standard session.
>
> ```json theme={null}
> {
> "type": "session.ready",
> "data": {
> "session_id": "ses_8d2c1fda",
> "request_id": "req_92ab7de1",
> "cdp_url": "wss://connect.anchorbrowser.io?sessionId=ses_8d2c1fda",
> "live_view_url": "https://live.anchorbrowser.io?sessionId=ses_8d2c1fda",
> "session_dashboard_url": "https://app.anchorbrowser.io/sessions/ses_8d2c1fda"
> }
> }
> ```
> [tab] session.completed
>
> ```json theme={null}
> {
> "type": "session.completed",
> "data": {
> "session_id": "ses_8d2c1fda",
> "duration_ms": 27540,
> "proxy_bytes": 2581234,
> "network_bytes_total": 4891204,
> "steps": 12,
> "domains": ["example.com", "api.example.com"],
> "session_dashboard_url": "https://app.anchorbrowser.io/sessions/ses_8d2c1fda"
> }
> }
> ```
> [tab] session.failed
>
> `reason` is a coarse machine-readable category (e.g. `browser_unreachable`, `browser_pod_not_found`); use it for routing, not user-facing messages.
>
> ```json theme={null}
> {
> "type": "session.failed",
> "data": {
> "session_id": "ses_8d2c1fda",
> "duration_ms": 6789,
> "reason": "browser_unreachable",
> "session_dashboard_url": "https://app.anchorbrowser.io/sessions/ses_8d2c1fda"
> }
> }
> ```
> [tab] session.recording.ready
>
> Minimal payload — the event is a "recording is ready, go fetch it" signal. To download the file, call the [Recordings API](/api-reference/recordings) with the `session_id` to get a fresh presigned URL.
>
> ```json theme={null}
> {
> "type": "session.recording.ready",
> "data": {
> "session_id": "ses_8d2c1fda",
> "duration_ms": 45000,
> "size_bytes": 1823456,
> "session_dashboard_url": "https://app.anchorbrowser.io/sessions/ses_8d2c1fda"
> }
> }
> ```
> [tab] intervention.requested
>
> ```json theme={null}
> {
> "type": "intervention.requested",
> "data": {
> "session_id": "ses_8d2c1fda",
> "request_id": "req_4d2e9c6a",
> "message": "Solve the captcha to continue",
> "input_type": "confirm",
> "live_view_url": "https://app.anchorbrowser.io/sessions/ses_8d2c1fda"
> }
> }
> ```
> [tab] intervention.resolved
>
> Carries just `session_id` and `request_id`. The user's actual response is **never** included in the payload.
>
> ```json theme={null}
> {
> "type": "intervention.resolved",
> "data": {
> "session_id": "ses_8d2c1fda",
> "request_id": "req_4d2e9c6a"
> }
> }
> ```
## Batches
| Event | Fired when |
| - | - |
| `batch.completed` | All sessions in a batch reached a terminal state and at least one succeeded. |
| `batch.failed` | Every session in the batch failed (or the batch produced zero sessions). |
Both events carry the same payload shape — only the `type` and `status` field differ.
```json theme={null}
{
"type": "batch.completed",
"data": {
"batch_id": "bat_92ab7de1",
"total_requests": 25,
"completed_requests": 25,
"failed_requests": 0,
"status": "completed"
}
}
```
```json theme={null}
{
"type": "batch.failed",
"data": {
"batch_id": "bat_92ab7de1",
"total_requests": 25,
"completed_requests": 18,
"failed_requests": 7,
"status": "failed"
}
}
```
## Identity
| Event | Fired when |
| - | - |
| `identity.authenticated` | An identity successfully authenticated and is now usable for subsequent runs. Use this if you need positive confirmation that a credential rotation or first-time login worked. |
| `identity.authentication_failed` | An identity-based login attempt failed. The `failure_type` field distinguishes `invalid_credentials` (the password was wrong) from `automation_failure`. |
> [tab] authenticated
>
> ```json theme={null}
> {
> "type": "identity.authenticated",
> "data": {
> "identity_id": "idn_acme_orders",
> "application_id": "app_acme",
> "session_id": "ses_8d2c1fda",
> "execution_id": "exr_8d2c1fda"
> }
> }
> ```
> [tab] authentication\_failed
>
> ```json theme={null}
> {
> "type": "identity.authentication_failed",
> "data": {
> "identity_id": "idn_acme_orders",
> "application_id": "app_acme",
> "execution_id": "exr_8d2c1fda",
> "failure_type": "invalid_credentials",
> "error_message": "login_succeeded was false"
> }
> }
> ```
# Webhooks
Source: https://docs.anchorbrowser.io/webhooks/overview
Receive real-time notifications when tasks, sessions and identities complete, fail, or need human input.
Anchor delivers webhook events to your endpoint the moment something interesting happens - a task completes, a login fails, the agent needs human input. Each delivery is signed with HMAC-SHA256 so you can verify it came from Anchor and not someone spoofing your endpoint.
## Quick Start
### 1. Create a webhook
From the dashboard, open **Webhooks** under the Account section and click **Add webhook**:
* Paste your HTTPS endpoint (`https://your-app.example.com/anchor/webhooks`).
* Pick the events you want to subscribe to. See [Events](/webhooks/events) for the full catalog.
* Click **Create webhook**.
Anchor shows the **signing secret exactly once**. Copy it now - in order to verify incoming requests, we do NOT show it again. If you lose it, click **Rotate signing secret** to issue a new one (the old secret remains valid for 24 hours).
You can also create webhooks via the API:
```bash theme={null}
curl -X POST "https://api.anchorbrowser.io/v1/webhooks" \
-H "anchor-api-key: $ANCHOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.example.com/anchor/webhooks",
"description": "Production task notifications",
"subscribed_events": ["task.completed", "task.failed", "task.healed"]
}'
```
The response includes the `secret` field - store it, it never appears in any subsequent API response.
### 2. Receive events
Each event arrives as a `POST` with a JSON body and a few `Anchor-*` headers:
```http theme={null}
POST /anchor/webhooks
Host: your-app.example.com
User-Agent: Anchor-Webhooks/1.0
Content-Type: application/json
Anchor-Event: task.completed
Anchor-Delivery-Id:
Anchor-Timestamp: 1716544084
Anchor-Signature: t=1716544084,v1=
{
"id": "evt_01HXJ4...",
"type": "task.completed",
"created": "2026-05-24T12:18:05.123Z",
"project_id": "5d2c31f6-ab7e-481a-b6fd-8b4a96a4e197",
"text": "✅ Task `tsk_4f8w9n2b` completed in 4.2s",
"data": { "...": "see Events for per-type payloads" }
}
```
**Always respond with a `2xx` status code within 10 seconds** - that's how Anchor knows the event was delivered. Anything else triggers a retry (see [Retries](#retries-and-delivery-guarantees)).
### 3. Verify the signature
Compute an HMAC-SHA256 of `v0:{Anchor-Timestamp}:{raw_body_bytes}` using your signing secret and compare it to the `v1=` value in the `Anchor-Signature` header in constant time. Reject anything you can't verify.
Full code examples (Node.js, Python, Go) are on the [Signature verification](/webhooks/signature-verification) page.
## Slack integration
Every event includes a top-level `text` field with a one-line human-readable summary. That's the same shape Slack incoming webhooks expect, so you can register a Slack URL as a webhook receiver with no relay:
1. In Slack, create an [Incoming Webhook](https://api.slack.com/messaging/webhooks) for the channel you want events posted to. Slack gives you a URL like `https://hooks.slack.com/services/T.../B.../...`.
2. In Anchor, **Webhooks → Add webhook**, paste the Slack URL, pick the events.
3. Done. Each delivery posts a message in the channel — for example:
> ✅ Task `tsk_4f8w9n2b` completed in 4.2s
For richer formatting (blocks, mentions, attachments) write a small relay that reads `data` and posts the message you want; the structured fields stay machine-readable while `text` covers the simple case.
## Testing your endpoint
The dashboard's **Send test event** button fires a synthetic event of the type you choose through the real signing + retry path. Use it during development:
1. Pick the event type from the dropdown next to the payload preview.
2. Click **Send test event**.
3. Inspect the request at your endpoint.
The test delivery counts toward your delivery log so you can verify retry behaviour by intentionally returning `503` from your endpoint.
You can also trigger via the API:
```bash theme={null}
curl -X POST "https://api.anchorbrowser.io/v1/webhooks//test" \
-H "anchor-api-key: $ANCHOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "event_type": "task.completed" }'
```
## Retries and delivery guarantees
Anchor retries failed deliveries with exponential backoff:
| Attempt | Time since first attempt | Schedule (after the previous) |
| - | - | - |
| 1 (initial) | 0 s | immediate |
| 2 | 5 s | +5 s |
| 3 | 15 s | +10 s |
| 4 | 30 s | +15 s |
| 5 | 50 s | +20 s |
| 6 | 80 s | +30 s |
A delivery is **retried** when:
* The HTTP request errors (DNS failure, timeout, TLS handshake failure).
* Your endpoint returns `5xx`, `408`, or `429`.
A delivery is **not retried** when your endpoint returns any other `4xx`. Use that intentionally for events you've already processed (`409 Conflict` after de-dupe is a common pattern).
After 6 attempts (\~80 s elapsed since the first attempt), the delivery is marked `dead` and won't be retried automatically. You can still see it in **Webhooks → Events** in the dashboard for 7 days.
**At-least-once delivery.** Because we retry on transient errors, your endpoint may receive the same event more than once. **Always** de-dupe by `id` (the envelope's top-level `id`, not `data.execution_id`).
## Idempotency and ordering
* Each delivery has a unique top-level `id` (`evt_...`). The same logical event will always carry the same `id`, so storing `(id, status)` in your database and checking before processing is enough to make your handler idempotent.
* Anchor does **not** guarantee delivery order. A retry may arrive after a later event for the same task. Use the `created` timestamp to order events on your side if you care about sequencing.
* An event delivered to multiple webhook endpoints carries the **same** `id` to every endpoint, so you can correlate deliveries across consumers.
## Inspecting deliveries
Every delivery - succeeded, failed, or dead - is visible in the dashboard's **Webhooks → Events** view for 7 days. The same data is available via the API:
```bash theme={null}
curl "https://api.anchorbrowser.io/v1/webhooks//events?status=failed&limit=25&offset=0" \
-H "anchor-api-key: $ANCHOR_API_KEY"
```
`limit` defaults to 25 and caps at 100. `offset` skips that many rows. Each row shows `event_type`, `status`, `attempt`, `response_status`, `error_message`, `scheduled_at`, and `completed_at`. Use this to debug failing endpoints or to confirm a missed event made it through.
## Sensitive data and what we never send
Anchor sanitizes every webhook payload before it leaves our infrastructure:
1. **Whitelist via schema.** Only fields explicitly declared in each event's schema are sent. Anything else is stripped.
2. **Schema-driven secret redaction.** Task inputs marked `secret` in your task schema are masked as `*****` before they appear in `output.value`.
3. **Free-text scrubbing.** Error messages and self-heal explanations are scanned for credential patterns and masked.
What is **never** in any payload:
* Identity credential values (passwords, API tokens).
* Raw `inputs` from task executions.
## Best practices
> [accordion] Verify the signature on every request
>
> Even if you trust your network perimeter - Anchor's signature is a proof that the request really came from us.
> [accordion] Acknowledge fast, work later
>
> Return `2xx` within 10 seconds. If processing takes longer (e.g. you write to a slow downstream system), enqueue the event in your own queue and process it asynchronously.
> [accordion] De-dupe by `id`
>
> Anchor delivers at-least-once. Persist `(id, status)` in your database and short-circuit duplicates with a `200 OK`.
> [accordion] Rotate secrets without downtime
>
> Click **Rotate signing secret** to get a new one. The old secret remains valid for 24 hours so you can deploy at your own pace. Update both, then drop the old one once your deploys are out.
> [accordion] Use the events log to spot regressions
>
> Filter by `status=failed` or `status=dead` in the dashboard or API. Anything that lingers there is either an endpoint bug, a network blip, or a real automation issue worth digging into.
## API reference
| Method | Path | Purpose |
| - | - | - |
| `POST` | `/v1/webhooks` | Create a webhook (returns the signing secret once). |
| `GET` | `/v1/webhooks` | List webhooks for the project. |
| `GET` | `/v1/webhooks/{id}` | Fetch a single webhook config. |
| `PATCH` | `/v1/webhooks/{id}` | Update url, description, subscribed events, or `enabled`. |
| `POST` | `/v1/webhooks/{id}/rotate-secret` | Rotate the signing secret. Old secret valid for 24 h. |
| `DELETE` | `/v1/webhooks/{id}` | Soft-delete a webhook. |
| `POST` | `/v1/webhooks/{id}/test` | Fire a synthetic event of a given type. |
| `GET` | `/v1/webhooks/{id}/events` | Paginated delivery history (last 7 days). |
All routes are authenticated with the `anchor-api-key` header (or the dashboard session cookie) and scoped to the current project.
## Limits
* Up to 5 webhook endpoints per project.
* HTTPS only. The following hosts are rejected at create/update time:
* Loopback / private / link-local IPs (`127.0.0.0/8`, `10.0.0.0/8`, `192.168.0.0/16`, `172.16.0.0/12`, `169.254.0.0/16`, IPv6 ULA `fc00::/7` and link-local `fe80::/10`).
* Cloud metadata services (`169.254.169.254`, `metadata.google.internal`, `metadata.azure.com`).
* Internal-only TLDs (`*.local`, `*.internal`).
* Cloud control-plane endpoints — AWS STS (`sts.*.amazonaws.com`, including FIPS, GovCloud, and China regions), AWS IAM, EKS auth.
* URLs with embedded basic-auth credentials.
* Maximum URL length: 2048 characters.
* Maximum payload size: 64 KB. Larger `output.value` is replaced with `"__truncated__"`; fetch the full result via the REST API.
* HTTP timeout: 10s per attempt.
* Maximum 6 delivery attempts (1 initial + 5 retries) over \~80 seconds.
* Delivery history retention: 7 days.
# Signature verification
Source: https://docs.anchorbrowser.io/webhooks/signature-verification
Verify that webhook requests really came from Anchor using HMAC-SHA256 and timestamp-based replay protection.
Anchor signs every delivery with HMAC-SHA256 over `v0:{timestamp}:{raw_body}` using your webhook's signing secret. The signature lives in the `Anchor-Signature` header:
```
Anchor-Signature: t=1716544084,v1=
```
To verify a request:
1. Read the `Anchor-Timestamp` and `Anchor-Signature` headers, plus the **raw request body bytes** (do **not** parse the JSON first - re-serializing changes whitespace and breaks the signature).
2. Reject the request if the timestamp is more than 2 minutes old (replay protection).
3. Compute `HMAC_SHA256(secret, "v0:" + timestamp + ":" + raw_body).hex()`.
4. Compare it against the `v1=` value in `Anchor-Signature` using a constant-time compare (`hmac.compare_digest`, `crypto.timingSafeEqual`, etc.).
5. Only accept the event if the signatures match.
> [!WARNING]
>
> Always compute the HMAC over the **raw request body bytes**. If your framework parses JSON before you read the body (e.g. body-parser, FastAPI's `Body(...)`, gin's `BindJSON`), you must opt out of that for the webhook route - re-serializing the parsed object will produce different bytes and the signature will fail.
## Code examples
Each example below performs four checks in order: presence of the headers, freshness (timestamp within 2 minutes of the time you received the request), HMAC signature, and finally a duplicate-id check so a retry doesn't re-trigger your business logic.
> [!NOTE]
>
> The dedupe maps below are kept **in-process** for clarity. In production you should swap them for a persistent store with a TTL of at least your retry budget (24 hours is safe) — Redis, DynamoDB, or a `seen_event_ids (id PRIMARY KEY, seen_at)` table all work. An in-memory map won't survive a restart and won't dedupe across replicas behind a load balancer.
```javascript Node.js (Express) theme={null}
import express from 'express';
import crypto from 'node:crypto';
const app = express();
const SECRET = process.env.ANCHOR_WEBHOOK_SECRET;
const REPLAY_WINDOW_SECONDS = 2 * 60; // 2 minutes — reject anything older
// ─── Idempotency store (in-memory; swap for Redis/DB in production) ──
// Maps event id (e.g. evt_01HXJ4...) -> expiry timestamp in ms.
// We keep entries for at least the retry budget so a late retry is still
// recognised as a duplicate. 24 h covers Anchor's worst-case retry window.
const DEDUPE_TTL_MS = 24 * 60 * 60 * 1000;
const seenEventIds = new Map();
setInterval(() => {
const now = Date.now();
for (const [id, expiresAt] of seenEventIds) {
if (expiresAt < now) seenEventIds.delete(id);
}
}, 60_000).unref();
// IMPORTANT: capture the raw bytes BEFORE JSON parsing.
app.post(
'/anchor/webhooks',
express.raw({ type: 'application/json' }),
(req, res) => {
const signatureHeader = req.header('Anchor-Signature') || '';
const timestamp = req.header('Anchor-Timestamp') || '';
if (!signatureHeader || !timestamp) return res.status(400).send('missing signature');
// 1. Freshness / replay protection (compare the request's `Anchor-Timestamp`
// against the local clock at the moment the request arrived).
const ageSeconds = Math.abs(Date.now() / 1000 - Number(timestamp));
if (Number.isNaN(Number(timestamp)) || ageSeconds > REPLAY_WINDOW_SECONDS) {
return res.status(400).send('stale request');
}
// 2. Parse the v1= value out of "t=...,v1=..."
const parts = Object.fromEntries(
signatureHeader.split(',').map((p) => p.split('=')),
);
const provided = parts.v1;
if (!provided) return res.status(400).send('missing v1 signature');
// 3. Constant-time HMAC compare
const baseString = `v0:${timestamp}:${req.body.toString('utf8')}`;
const expected = crypto
.createHmac('sha256', SECRET)
.update(baseString)
.digest('hex');
if (
expected.length !== provided.length ||
!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(provided))
) {
return res.status(401).send('invalid signature');
}
const event = JSON.parse(req.body.toString('utf8'));
// 4. Idempotency — short-circuit duplicates with 200 so Anchor stops retrying.
if (seenEventIds.has(event.id)) {
console.log('Duplicate event, acknowledging without re-processing:', event.id);
return res.status(200).send('ok');
}
seenEventIds.set(event.id, Date.now() + DEDUPE_TTL_MS);
console.log('Verified event:', event.type, event.id);
// ... business logic here ...
res.status(200).send('ok');
},
);
app.listen(3000);
```
```python Python (Flask) theme={null}
import hashlib
import hmac
import os
import threading
import time
from flask import Flask, abort, request
app = Flask(__name__)
SECRET = os.environ["ANCHOR_WEBHOOK_SECRET"].encode()
REPLAY_WINDOW_SECONDS = 2 * 60 # 2 minutes — reject anything older
# ─── Idempotency store (in-memory; swap for Redis/DB in production) ──
DEDUPE_TTL_SECONDS = 24 * 60 * 60
_seen_event_ids: dict[str, float] = {} # id -> expiry epoch seconds
_seen_lock = threading.Lock()
def _is_duplicate(event_id: str) -> bool:
now = time.time()
with _seen_lock:
# Opportunistic prune so the map doesn't grow indefinitely.
for k, exp in list(_seen_event_ids.items()):
if exp < now:
_seen_event_ids.pop(k, None)
if event_id in _seen_event_ids:
return True
_seen_event_ids[event_id] = now + DEDUPE_TTL_SECONDS
return False
@app.post("/anchor/webhooks")
def handle_webhook():
signature_header = request.headers.get("Anchor-Signature", "")
timestamp = request.headers.get("Anchor-Timestamp", "")
if not signature_header or not timestamp:
abort(400, "missing signature")
# 1. Freshness / replay protection
try:
ts = int(timestamp)
except ValueError:
abort(400, "bad timestamp")
if abs(time.time() - ts) > REPLAY_WINDOW_SECONDS:
abort(400, "stale request")
parts = dict(p.split("=", 1) for p in signature_header.split(","))
provided = parts.get("v1", "")
# 2. HMAC compare (raw bytes — do NOT call request.get_json() first).
raw = request.get_data()
base_string = f"v0:{timestamp}:".encode() + raw
expected = hmac.new(SECRET, base_string, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, provided):
abort(401, "invalid signature")
event = request.get_json()
# 3. Idempotency — short-circuit duplicates with 200.
if _is_duplicate(event["id"]):
print(f"Duplicate event, acknowledging without re-processing: {event['id']}")
return ("ok", 200)
print(f"Verified event: {event['type']} {event['id']}")
# ... business logic here ...
return ("ok", 200)
```
```go Go (net/http) theme={null}
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"io"
"net/http"
"os"
"strconv"
"strings"
"sync"
"time"
)
var secret = []byte(os.Getenv("ANCHOR_WEBHOOK_SECRET"))
const (
replayWindowSeconds = 2 * 60 // 2 minutes — reject anything older
dedupeTTLSeconds = 24 * 60 * 60 // remember an event id for the full retry budget
)
// In-memory idempotency store. Swap for Redis/DB in production.
var (
seenMu sync.Mutex
seenIDs = make(map[string]int64) // id -> expiry epoch seconds
)
func isDuplicate(eventID string) bool {
now := time.Now().Unix()
seenMu.Lock()
defer seenMu.Unlock()
// Opportunistic prune.
for id, exp := range seenIDs {
if exp < now {
delete(seenIDs, id)
}
}
if _, ok := seenIDs[eventID]; ok {
return true
}
seenIDs[eventID] = now + dedupeTTLSeconds
return false
}
func handle(w http.ResponseWriter, r *http.Request) {
timestamp := r.Header.Get("Anchor-Timestamp")
sigHeader := r.Header.Get("Anchor-Signature")
if timestamp == "" || sigHeader == "" {
http.Error(w, "missing signature", http.StatusBadRequest)
return
}
// 1. Freshness / replay protection
ts, err := strconv.ParseInt(timestamp, 10, 64)
if err != nil || abs(time.Now().Unix()-ts) > replayWindowSeconds {
http.Error(w, "stale request", http.StatusBadRequest)
return
}
var provided string
for _, p := range strings.Split(sigHeader, ",") {
if strings.HasPrefix(p, "v1=") {
provided = strings.TrimPrefix(p, "v1=")
}
}
body, _ := io.ReadAll(r.Body)
// 2. HMAC compare
mac := hmac.New(sha256.New, secret)
mac.Write([]byte("v0:" + timestamp + ":"))
mac.Write(body)
expected := hex.EncodeToString(mac.Sum(nil))
if !hmac.Equal([]byte(expected), []byte(provided)) {
http.Error(w, "invalid signature", http.StatusUnauthorized)
return
}
// 3. Idempotency — short-circuit duplicates with 200.
var event struct {
ID string `json:"id"`
Type string `json:"type"`
}
if err := json.Unmarshal(body, &event); err != nil {
http.Error(w, "bad json", http.StatusBadRequest)
return
}
if isDuplicate(event.ID) {
// Anchor counts 200 as delivered and stops retrying.
w.WriteHeader(http.StatusOK)
return
}
// ... business logic here, then ack ...
w.WriteHeader(http.StatusOK)
}
func abs(x int64) int64 { if x < 0 { return -x }; return x }
```
## Rotating your signing secret
Click **Rotate signing secret** in the dashboard (or call `POST /v1/webhooks/{id}/rotate-secret`) to issue a new secret. The **previous** secret remains valid for 24 hours so you can roll your verification code without dropping events:
1. Receive the new secret from the rotate-secret response. Anchor returns it **once**.
2. Update your verifier so it accepts deliveries signed by either secret during the overlap window.
3. Deploy.
4. After 24 hours, remove the old secret from your verifier - Anchor stops accepting it automatically.
## Common verification pitfalls
* **Re-serialized body.** Frameworks like Express's `body-parser` or FastAPI's `Body(...)` decode the JSON before you see it. Capture the raw bytes explicitly (`express.raw`, `request.get_data()`, `io.ReadAll(r.Body)`).
* **Wrong timestamp source.** Use the `t=` value from `Anchor-Signature` (equivalent to the `Anchor-Timestamp` header). Do not use the time you received the request - clock skew between your machine and Anchor will break the HMAC base string.
* **String comparison.** Use a constant-time compare (`hmac.compare_digest`, `crypto.timingSafeEqual`, `hmac.Equal`) to avoid timing-side-channel attacks.
* **Missing replay check.** Reject anything older than 2 minutes.
# Agent Access challenge data
Source: https://docs.anchorbrowser.io/api-reference/agent-access/agent-access-challenge-data
/openapi.yaml get /v1/agent-access/appendix/{appendixRef}
Supporting data for an active Agent Access challenge. Path comes from the challenge response.
# Agent Access guide
Source: https://docs.anchorbrowser.io/api-reference/agent-access/agent-access-guide
/openapi.yaml get /v1/agent-access
Unauthenticated onboarding guide. This GET does **not** issue an API key.
Follow the `next` field: GET `/v1/agent-access/challenge`, solve, then POST `/v1/agent-access`
with `{ token, answer }`. Optional `identity_token` (OIDC JWT) grants more credits.
Docs: https://docs.anchorbrowser.io/quickstart/agent-access
# Create Agent Access project
Source: https://docs.anchorbrowser.io/api-reference/agent-access/create-agent-access-project
/openapi.yaml post /v1/agent-access
Issue an Agent Access API key. Submit the challenge `token` and computed integer `answer`
from GET /v1/agent-access/challenge. GET on this path returns a guide, not a key.
Optional `identity_token` as an OIDC JWT grants more credits. `identity_provider` is optional
when the JWT `iss` is Google (`https://accounts.google.com`), GitHub Actions
(`https://token.actions.githubusercontent.com`), or Vercel (`https://vercel.com`).
Returns `api_key` for header `anchor-api-key`.
Docs: https://docs.anchorbrowser.io/quickstart/agent-access
# Get Agent Access challenge
Source: https://docs.anchorbrowser.io/api-reference/agent-access/get-agent-access-challenge
/openapi.yaml get /v1/agent-access/challenge
Get a puzzle and token. Follow next and challenge.prompt, then POST /v1/agent-access with token and answer.
# Get Perform Web Task Status
Source: https://docs.anchorbrowser.io/api-reference/ai-tools/get-perform-web-task-status
/openapi.yaml get /v1/tools/perform-web-task/{workflowId}/status
Get the status of an asynchronous perform-web-task execution by workflow ID.
# Perform Web Task
Source: https://docs.anchorbrowser.io/api-reference/ai-tools/perform-web-task
/openapi.yaml post /v1/tools/perform-web-task
Start from a URL and perform the given task.
# Create Application
Source: https://docs.anchorbrowser.io/api-reference/applications/create-application
/openapi.yaml post /v1/applications
Creates a new application for identity management.
# Create Authentication Flow
Source: https://docs.anchorbrowser.io/api-reference/applications/create-authentication-flow
/openapi.yaml post /v1/applications/{applicationId}/auth-flows
Creates a new authentication flow for an application.
# Create Identity Token
Source: https://docs.anchorbrowser.io/api-reference/applications/create-identity-token
/openapi.yaml post /v1/applications/{applicationId}/tokens
Creates an identity token for a specific application. This token is used to initiate
an authentication flow for linking user identities to the application.
The callback URL must use HTTPS and is where the user will be redirected after authentication.
# Delete Application
Source: https://docs.anchorbrowser.io/api-reference/applications/delete-application
/openapi.yaml delete /v1/applications/{applicationId}
Deletes an existing application.
# Delete Authentication Flow
Source: https://docs.anchorbrowser.io/api-reference/applications/delete-authentication-flow
/openapi.yaml delete /v1/applications/{applicationId}/auth-flows/{authFlowId}
Deletes an existing authentication flow.
# Get Application
Source: https://docs.anchorbrowser.io/api-reference/applications/get-application
/openapi.yaml get /v1/applications/{applicationId}
Retrieves details of a specific application by its ID.
# List Application Authentication Flows
Source: https://docs.anchorbrowser.io/api-reference/applications/list-application-authentication-flows
/openapi.yaml get /v1/applications/{applicationId}/auth-flows
Retrieves all authentication flows for a specific application.
# List Application Identities
Source: https://docs.anchorbrowser.io/api-reference/applications/list-application-identities
/openapi.yaml get /v1/applications/{applicationId}/identities
Retrieves all identities associated with a specific application.
# List Applications
Source: https://docs.anchorbrowser.io/api-reference/applications/list-applications
/openapi.yaml get /v1/applications
Retrieves all applications for the authenticated team.
# Update Authentication Flow
Source: https://docs.anchorbrowser.io/api-reference/applications/update-authentication-flow
/openapi.yaml patch /v1/applications/{applicationId}/auth-flows/{authFlowId}
Updates an existing authentication flow.
# Async Session Status
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/async-session-status
/openapi.yaml get /v1/sessions/async/{request_id}/status
Polling endpoint paired with `POST /v1/sessions/async`. Returns the
current lifecycle `status` of the async request and, once the pod is
up, the embedded `session` object containing `session_id`, `cdp_url`
and `live_view_url`.
# Create Session Tokens
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/create-session-tokens
/openapi.yaml post /v1/sessions/{session_id}/tokens
Mint URLs for a running session that can be handed to end users without exposing the session id.
Each scope gets its own token, carried as `?token=` in the URL:
- `live_view_read_only`: watch the browser only.
- `live_view`: watch and interact with the browser.
- `cdp`: full CDP control.
Every call mints new tokens. A token stops working when the session ends or when it is revoked.
On a session created with `live_view.read_only`, `live_view` is watch-only too: `live_view_url` is the
read-only URL.
The first token makes the session token-only, as `scoped_access` does: new connections with only
`?sessionId=` are refused from then on, even after the tokens are revoked. Connections already open stay up.
# Delete Session Tags
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/delete-session-tags
/openapi.yaml delete /v1/sessions/{session_id}/tags
Clears all tags from a browser session.
# End All Sessions
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/end-all-sessions
/openapi.yaml delete /v1/sessions/all
Terminates all active browser sessions associated with the provided API key.
# End Browser Session
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/end-browser-session
/openapi.yaml delete /v1/sessions/{session_id}
Deletes the browser session associated with the provided browser session ID. Requires a valid API key for authentication.
# Get Browser Session
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/get-browser-session
/openapi.yaml get /v1/sessions/{session_id}
Retrieves detailed information about a specific browser session.
# Get Browser Session Pages
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/get-browser-session-pages
/openapi.yaml get /v1/sessions/{session_id}/pages
Retrieves a list of pages associated with a specific browser session.
# Get Session Tags
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/get-session-tags
/openapi.yaml get /v1/sessions/{session_id}/tags
Retrieves the tags associated with a specific browser session.
# Get Sessions History
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/get-sessions-history
/openapi.yaml get /v1/sessions/history
Retrieves session usage analytics for the authenticated team.
# List All Sessions Status
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/list-all-sessions-status
/openapi.yaml get /v1/sessions/all/status
Retrieves status information for all browser sessions associated with the API key.
# List Session Downloads
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/list-session-downloads
/openapi.yaml get /v1/sessions/{session_id}/downloads
Retrieves metadata of files downloaded during a browser session. Requires a valid API key for authentication.
# List Sessions History Page
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/list-sessions-history-page
/openapi.yaml get /v1/sessions
Retrieves a paginated list of sessions for the authenticated team with support for
sorting and advanced filtering. This endpoint mirrors the backend session history-page
filtering behavior.
# Put Session Tags
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/put-session-tags
/openapi.yaml put /v1/sessions/{session_id}/tags
Create or replace tags on a browser session. This overwrites any existing tags
with the provided list. See [Session Tags](/advanced/session-tags).
# Revoke Session Token
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/revoke-session-token
/openapi.yaml delete /v1/sessions/{session_id}/tokens/{token}
Revoke a token minted for a session. Its URL stops opening new connections; connections already open stay until they close.
# Start Browser Session
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/start-browser-session
/openapi.yaml post /v1/sessions
Allocates a new browser session for the user, with optional configurations for ad-blocking, captcha solving, proxy usage, and idle timeout.
# Start Browser Session (async)
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/start-browser-session-async
/openapi.yaml post /v1/sessions/async
Non-blocking variant of `POST /v1/sessions`. Returns a `request_id`
immediately and provisions the underlying browser pod in the
background. Poll `GET /v1/sessions/async/{request_id}/status` until
`status` becomes `ready` to obtain the resolved `session_id`,
`cdp_url` and `live_view_url`.
# Upload Files
Source: https://docs.anchorbrowser.io/api-reference/browser-sessions/upload-files
/openapi.yaml post /v1/sessions/{sessionId}/uploads
Upload files directly to a browser session for use with web forms and file inputs.
Files are saved to the session's uploads directory and can be referenced in CDP commands
(for example `DOM.setFileInputFiles`). The saved paths are returned in `file_paths`.
A `.zip` upload is unpacked into the uploads directory by default and the archive itself is
not kept. Pass `extract=false` to store the archive as-is, for example to attach the zip
itself to a file input.
# Create Identity
Source: https://docs.anchorbrowser.io/api-reference/identities/create-identity
/openapi.yaml post /v1/identities
Creates a new identity for the given source. Credentials are optional.
# Delete Identity
Source: https://docs.anchorbrowser.io/api-reference/identities/delete-identity
/openapi.yaml delete /v1/identities/{identityId}
Deletes an existing identity.
# Finalize Dynamic Auth Flow
Source: https://docs.anchorbrowser.io/api-reference/identities/finalize-dynamic-auth-flow
/openapi.yaml post /v1/identities/dynamic/finalize/{session_id}
Persists the identity, browser profile, and captured credentials after the
flow reaches `authenticated`. The response reports whether the saved login
can be replayed unattended (`automatable`).
# Get Dynamic Auth Flow State
Source: https://docs.anchorbrowser.io/api-reference/identities/get-dynamic-auth-flow-state
/openapi.yaml get /v1/identities/dynamic/state/{session_id}
Read-only snapshot of an in-progress dynamic auth flow. Does not acquire the
flow lock or mutate state.
Poll this endpoint when:
- start/resolve returned `type: detection_failed` with `retryable: true`
(the next login step is still being determined and may take longer than
the request timeout)
- start/resolve timed out or returned 409 while a transition is in flight
- you need the current presentation without submitting an answer
`view` is that presentation — the same object start/resolve return. Treat it
as the live step when `phase` is `settled`. While `phase` is `navigating`,
`view` may already describe the next step; `target` is only a progress
label for the in-flight transition.
Keep polling until `view.type` is `decision`, `form`, `authenticated`, a
non-retryable `detection_failed`, or a non-retryable `failed`. Then call
`/resolve` only for `decision`/`form`, `/finalize` for `authenticated`, or
open `live_view_url` for `detection_failed`.
# Get Identity
Source: https://docs.anchorbrowser.io/api-reference/identities/get-identity
/openapi.yaml get /v1/identities/{identityId}
Retrieves details of a specific identity by its ID.
# Reauthenticate Identity
Source: https://docs.anchorbrowser.io/api-reference/identities/reauthenticate-identity
/openapi.yaml post /v1/identities/{identityId}/reauthenticate
Re-authenticates an identity on demand: validates the saved browser profile and runs login if
it is no longer signed in, then persists the refreshed profile and tears the temporary session
down. Equivalent to a session with `identity_skip_validation: false` that ends after auth.
# Resolve Dynamic Auth Flow Step
Source: https://docs.anchorbrowser.io/api-reference/identities/resolve-dynamic-auth-flow-step
/openapi.yaml post /v1/identities/dynamic/resolve/{session_id}
Advances the flow by answering the current step. The body depends on the
last presentation's `type` — do not mix the two shapes:
- **`decision`**: send only `choice` (a `step_id` from `options`).
Do not send `option_index` or `values`.
- **`form`**: send `option_index` (index into `options`) and `values`
(field name → string). Do not send `choice`.
Do not call `/resolve` for `detection_failed`, `authenticated`, or `failed`.
For retryable `detection_failed`, a timeout, or a 409 (another transition
still in flight), poll `GET .../state/{session_id}` until a
`decision`/`form`/`authenticated` view appears, then continue. If
`detection_failed` is not retryable, open `live_view_url` to finish signing in.
# Start Dynamic Auth Flow
Source: https://docs.anchorbrowser.io/api-reference/identities/start-dynamic-auth-flow
/openapi.yaml post /v1/identities/dynamic/start/{session_id}
Starts (or restarts) a dynamic auth flow in an existing browser session.
`session_id` is required in the path. Advances until the next presentation
(`decision`, `form`, `detection_failed`, `authenticated`, or `failed`).
If the response is `detection_failed` with `retryable: true`, or the request
times out, keep polling `GET /v1/identities/dynamic/state/{session_id}` —
some login steps take longer than a single start/resolve call. If
`detection_failed` and `retryable` is false, open `live_view_url` to finish
signing in. Do not treat a timeout as a hard stop until `view.type` is
`failed` or `detection_failed` and `retryable` is false.
# Update Identity
Source: https://docs.anchorbrowser.io/api-reference/identities/update-identity
/openapi.yaml put /v1/identities/{identityId}
Updates an existing identity's name, metadata, or credentials.
# Mouse Click
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/mouse-click
/openapi.yaml post /v1/sessions/{sessionId}/mouse/click
Performs a mouse click at the specified coordinates
# Mouse Double Click
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/mouse-double-click
/openapi.yaml post /v1/sessions/{sessionId}/mouse/doubleClick
Performs a double click at the specified coordinates
# Mouse Down
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/mouse-down
/openapi.yaml post /v1/sessions/{sessionId}/mouse/down
Performs a mouse button down action at the specified coordinates
# Mouse Move
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/mouse-move
/openapi.yaml post /v1/sessions/{sessionId}/mouse/move
Moves the mouse cursor to the specified coordinates
# Mouse Up
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/mouse-up
/openapi.yaml post /v1/sessions/{sessionId}/mouse/up
Performs a mouse button up action at the specified coordinates
# Take Screenshot
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/take-screenshot
/openapi.yaml get /v1/sessions/{sessionId}/screenshot
Takes a screenshot of the current browser session and returns it as an image.
# Create Profile
Source: https://docs.anchorbrowser.io/api-reference/profiles/create-profile
/openapi.yaml post /v1/profiles
Creates a new profile from a browser session. A Profile stores cookies, local storage, and cache.
# Delete Profile
Source: https://docs.anchorbrowser.io/api-reference/profiles/delete-profile
/openapi.yaml delete /v1/profiles/{name}
Deletes an existing profile by its name.
# Get Profile
Source: https://docs.anchorbrowser.io/api-reference/profiles/get-profile
/openapi.yaml get /v1/profiles/{name}
Retrieves details of a specific profile by its name.
# List Profiles
Source: https://docs.anchorbrowser.io/api-reference/profiles/list-profiles
/openapi.yaml get /v1/profiles
Fetches all stored profiles.
# Generate a Task
Source: https://docs.anchorbrowser.io/api-reference/tasks/generate-a-task
/openapi.yaml post /v2/tasks/generate
Starts asynchronous generation of a new task from a natural-language prompt.
Poll `GET /v2/tasks/{taskId}/generation-status` until the status is `ready`.
# Get Task Generation Status
Source: https://docs.anchorbrowser.io/api-reference/tasks/get-task-generation-status
/openapi.yaml get /v2/tasks/{taskId}/generation-status
Returns the generation status of a task created via `POST /v2/tasks/generate`.
# Get Task Run Status
Source: https://docs.anchorbrowser.io/api-reference/tasks/get-task-run-status
/openapi.yaml get /v2/tasks/runs/{runId}/status
Retrieves the current status and result of a task run in the non-deprecated Tasks endpoints.
# Run a Task
Source: https://docs.anchorbrowser.io/api-reference/tasks/run-a-task
/openapi.yaml post /v2/tasks/{taskId}/run
Triggers execution of a task by ID using the non-deprecated Tasks endpoints.
# Execute Code Snippet
Source: https://docs.anchorbrowser.io/api-reference/tools/execute-code-snippet
/openapi.yaml post /v1/tools/execute-code
Run a TypeScript snippet in the sandbox against the browser session (query `sessionId` required).
# Get Page PDF
Source: https://docs.anchorbrowser.io/api-reference/tools/get-page-pdf
/openapi.yaml post /v1/tools/page-pdf
Generates a PDF of the current page for a browser session and returns it as a binary PDF file.
# Screenshot Webpage
Source: https://docs.anchorbrowser.io/api-reference/tools/screenshot-webpage
/openapi.yaml post /v1/tools/screenshot
This endpoint captures a screenshot of the specified webpage using Chromium. Users can customize the viewport dimensions and capture options.
# Web Unlocker
Source: https://docs.anchorbrowser.io/api-reference/tools/web-unlocker
/openapi.yaml post /v1/tools/fetch/webpage
Fetch the fully rendered HTML of any URL — including CAPTCHA- and bot-protected sites — with a single sessionless request.
Each request runs in a stealth browser behind a residential proxy. JavaScript is fully rendered, cookie-consent dialogs are dismissed,
and CAPTCHA or bot-detection challenges (Cloudflare, reCAPTCHA, FunCaptcha, DataDome, Kasada, Akamai, PerimeterX) are solved automatically —
you receive the page behind the challenge, never the interstitial. No browser session is created and the request does not count
against your concurrent-browser limit.
**Response:** the page body is returned directly (not wrapped in JSON). HTML pages return `text/html`; PDFs and file downloads are
passed through as binary with their original content type and a `Content-Disposition: attachment` header.
**Limits:** 2,000 requests per minute per API key by default. Requests can take up to about two minutes when a challenge must be
solved, so configure client timeouts of at least 120 seconds.
**Billing:** 0.005 credits per `200` response, regardless of page content. `4xx` and `5xx` responses are not billed.
See the [Web Unlocker guide](/advanced/web-unlocker) for examples, retry guidance, and a comparison with browser sessions.
# Airtable
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/airtable
Automate Airtable database workflows with Playwright when APIs aren't available.
# How to Automate Airtable with Playwright
Automate critical Airtable database workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual data entry and reduce record management errors by automating repetitive database management processes. Use Playwright to interact with Airtable's web interface programmatically.
[View Airtable's API documentation](https://airtable.com/developers/web/api/introduction) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Airtable tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Airtable
await page.goto('https://airtable.com/login');
await page.fill('[data-testid="email-input"]', process.env.AIRTABLE_EMAIL);
await page.fill('[data-testid="password-input"]', process.env.AIRTABLE_PASSWORD);
await page.click('[data-testid="submit-button"]');
// Navigate to workspace and base
await page.click('[data-testid="workspace-switcher"]');
await page.click('text=Marketing Team');
await page.click('text=Campaign Tracker');
// Add new record to table
await page.click('[data-testid="add-record-button"]');
await page.fill('[data-testid="field-Campaign Name"]', 'Q1 Product Launch');
await page.selectOption('[data-testid="field-Status"]', 'In Progress');
await page.fill('[data-testid="field-Budget"]', '50000');
await page.fill('[data-testid="field-Start Date"]', '2024-01-15');
await page.click('[data-testid="save-record"]');
// Create filtered view
await page.click('[data-testid="view-switcher"]');
await page.click('[data-testid="create-view"]');
await page.fill('[data-testid="view-name"]', 'Active Campaigns');
await page.click('[data-testid="add-filter"]');
await page.selectOption('[data-testid="filter-field"]', 'Status');
await page.selectOption('[data-testid="filter-condition"]', 'is');
await page.selectOption('[data-testid="filter-value"]', 'In Progress');
await page.click('[data-testid="save-view"]');
await browser.close();
```
Playwright handles field validation, view creation, and record linking automatically. You can automate data imports, report generation, and workflow automation processes.
## Scale your Airtable automation with Anchor Browser
Run your Playwright Airtable automations on cloud browsers with enterprise-grade reliability and persistent Airtable sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Attio
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/attio
Automate Attio CRM workflows with Playwright when APIs aren't available.
# How to Automate Attio with Playwright
Automate critical Attio CRM workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual contact management and reduce data entry errors by automating repetitive customer relationship processes. Use Playwright to interact with Attio's web interface programmatically.
[View Attio's API documentation](https://docs.attio.com/) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Attio tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Attio
await page.goto('https://app.attio.com/login');
await page.fill('[data-testid="email-input"]', process.env.ATTIO_EMAIL);
await page.fill('[data-testid="password-input"]', process.env.ATTIO_PASSWORD);
await page.click('[data-testid="login-button"]');
// Navigate to contacts
await page.click('[data-testid="nav-people"]');
await page.click('[data-testid="add-person-button"]');
// Create new contact
await page.fill('[data-testid="first-name"]', 'Sarah');
await page.fill('[data-testid="last-name"]', 'Johnson');
await page.fill('[data-testid="email-field"]', 'sarah.johnson@company.com');
await page.fill('[data-testid="company-field"]', 'Tech Innovations Inc');
await page.selectOption('[data-testid="status-select"]', 'qualified-lead');
// Add deal to pipeline
await page.click('[data-testid="deals-tab"]');
await page.click('[data-testid="add-deal-button"]');
await page.fill('[data-testid="deal-name"]', 'Enterprise Software License');
await page.fill('[data-testid="deal-value"]', '25000');
await page.click('[data-testid="save-contact"]');
await browser.close();
```
Playwright handles dynamic form fields, relationship linking, and pipeline updates automatically. You can automate lead qualification, deal progression, and contact enrichment workflows.
## Scale your Attio automation with Anchor Browser
Run your Playwright Attio automations on cloud browsers with enterprise-grade reliability and persistent Attio sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Bill.com
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/bill
Automate Bill.com accounts payable workflows with Playwright when APIs aren't available.
# How to Automate Bill.com with Playwright
Automate critical Bill.com accounts payable workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual invoice processing and reduce payment errors by automating repetitive financial management processes. Use Playwright to interact with Bill.com's web interface programmatically.
[View Bill.com's API documentation](https://developer.bill.com/hc/en-us) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Bill.com tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Bill.com
await page.goto('https://app.bill.com/login');
await page.fill('[data-testid="email-input"]', process.env.BILL_EMAIL);
await page.fill('[data-testid="password-input"]', process.env.BILL_PASSWORD);
await page.click('[data-testid="login-button"]');
// Navigate to bills section
await page.click('[data-testid="nav-bills"]');
await page.click('[data-testid="create-bill-button"]');
// Create new bill
await page.fill('[data-testid="vendor-search"]', 'Office Supply Co');
await page.click('[data-testid="vendor-select"]');
await page.fill('[data-testid="invoice-number"]', 'INV-2024-001');
await page.fill('[data-testid="invoice-date"]', '01/15/2024');
await page.fill('[data-testid="due-date"]', '02/15/2024');
await page.fill('[data-testid="amount"]', '1250.00');
// Add line item details
await page.click('[data-testid="add-line-item"]');
await page.fill('[data-testid="description"]', 'Office supplies - January');
await page.selectOption('[data-testid="expense-account"]', 'Office Expenses');
await page.click('[data-testid="save-bill"]');
// Approve and schedule payment
await page.click('[data-testid="approve-button"]');
await page.click('[data-testid="schedule-payment"]');
await page.selectOption('[data-testid="payment-date"]', '02/10/2024');
await page.click('[data-testid="confirm-payment"]');
await browser.close();
```
Playwright handles vendor lookups, approval workflows, and payment scheduling automatically. You can automate invoice processing, expense categorization, and cash flow management workflows.
## Scale your Bill.com automation with Anchor Browser
Run your Playwright Bill.com automations on cloud browsers with enterprise-grade reliability and persistent Bill.com sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Clickup
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/clickup
Automate ClickUp project management workflows with Playwright when APIs aren't available.
# How to Automate ClickUp with Playwright
Automate critical ClickUp project management workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual task creation and reduce project tracking errors by automating repetitive productivity processes. Use Playwright to interact with ClickUp's web interface programmatically.
[View ClickUp's API documentation](https://clickup.com/api/) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common ClickUp tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to ClickUp
await page.goto('https://app.clickup.com/login');
await page.fill('[data-test="login-email-input"]', process.env.CLICKUP_EMAIL);
await page.fill('[data-test="login-password-input"]', process.env.CLICKUP_PASSWORD);
await page.click('[data-test="login-submit"]');
// Navigate to workspace
await page.click('[data-test="sidebar-workspace"]');
await page.click('text=Development Team');
// Create new task
await page.click('[data-test="new-task-button"]');
await page.fill('[data-test="draft-view__title"]', 'Implement user dashboard');
await page.fill('[data-test="description-input"]', 'Create responsive dashboard with analytics widgets');
await page.selectOption('[data-test="priority-select"]', 'high');
await page.click('[data-test="assignee-dropdown"]');
await page.click('text=John Developer');
// Set due date and create task
await page.click('[data-test="due-date-picker"]');
await page.click('[data-test="date-next-week"]');
await page.click('[data-test="save-task"]');
// Update task status
await page.click('[data-test="status-dropdown"]');
await page.click('text=In Progress');
await browser.close();
```
Playwright handles task creation, status updates, and team assignments automatically. You can automate sprint planning, time tracking, and project reporting workflows.
## Scale your Clickup automation with Anchor Browser
Run your Playwright Clickup automations on cloud browsers with enterprise-grade reliability and persistent Clickup sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# CrowdStrike
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/crowdstrike
Automate CrowdStrike security workflows with Playwright when APIs aren't available.
# How to Automate CrowdStrike with Playwright
Automate critical CrowdStrike security workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual threat investigation and reduce incident response time by automating repetitive cybersecurity processes. Use Playwright to interact with CrowdStrike's web interface programmatically.
[View CrowdStrike's API documentation](https://developer.crowdstrike.com/) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common CrowdStrike tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to CrowdStrike Falcon
await page.goto('https://falcon.crowdstrike.com/');
await page.fill('[data-testid="username"]', process.env.CROWDSTRIKE_USERNAME);
await page.fill('[data-testid="password"]', process.env.CROWDSTRIKE_PASSWORD);
await page.click('[data-testid="login-button"]');
// Navigate to Incident Workbench
await page.click('[data-testid="nav-incident-workbench"]');
await page.click('[data-testid="view-all-incidents"]');
// Create new incident investigation
await page.click('[data-testid="create-incident"]');
await page.fill('[data-testid="incident-name"]', 'Suspicious Network Activity Investigation');
await page.selectOption('[data-testid="severity-level"]', 'Medium');
await page.fill('[data-testid="description"]', 'Unusual outbound traffic detected from workstation');
// Assign to security team
await page.click('[data-testid="assignee-dropdown"]');
await page.click('text=SOC Team Alpha');
await page.selectOption('[data-testid="priority"]', 'High');
// Add affected hosts
await page.click('[data-testid="add-hosts-tab"]');
await page.fill('[data-testid="hostname-search"]', 'DESKTOP-001');
await page.click('[data-testid="add-host"]');
// Generate investigation report
await page.click('[data-testid="generate-report"]');
await page.selectOption('[data-testid="report-format"]', 'PDF');
await page.click('[data-testid="download-report"]');
await browser.close();
```
Playwright handles threat detection workflows, incident management, and security reporting automatically. You can automate host isolation, malware analysis, and compliance reporting workflows.
## Scale your CrowdStrike automation with Anchor Browser
Run your Playwright CrowdStrike automations on cloud browsers with enterprise-grade reliability and persistent CrowdStrike sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# DocuSign
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/docusign
Automate DocuSign electronic signature workflows with Playwright when APIs aren't available.
# How to Automate DocuSign with Playwright
Automate critical DocuSign electronic signature workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual document sending and reduce signature processing errors by automating repetitive contract management processes. Use Playwright to interact with DocuSign's web interface programmatically.
[View DocuSign's API documentation](https://developers.docusign.com/) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common DocuSign tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to DocuSign
await page.goto('https://account.docusign.com/');
await page.fill('[data-qa="Username"]', process.env.DOCUSIGN_EMAIL);
await page.fill('[data-qa="Password"]', process.env.DOCUSIGN_PASSWORD);
await page.click('[data-qa="Log In"]');
// Navigate to envelope creation
await page.click('[data-qa="nav-send"]');
await page.click('[data-qa="start-sending"]');
// Upload document
await page.click('[data-qa="upload-document"]');
const fileInput = await page.locator('input[type="file"]');
await fileInput.setInputFiles('./contracts/employment-agreement.pdf');
// Add recipients
await page.click('[data-qa="add-recipient"]');
await page.fill('[data-qa="recipient-name"]', 'John Smith');
await page.fill('[data-qa="recipient-email"]', 'john.smith@company.com');
await page.selectOption('[data-qa="recipient-role"]', 'signer');
// Position signature fields
await page.click('[data-qa="tag-document"]');
await page.click('[data-qa="signature-tab"]');
await page.click('[data-qa="signature-placement"]', { position: { x: 200, y: 400 } });
// Send envelope
await page.click('[data-qa="send-envelope"]');
await browser.close();
```
Playwright handles document uploads, recipient management, and signature field positioning automatically. You can automate contract distribution, template creation, and signing ceremony workflows.
## Scale your DocuSign automation with Anchor Browser
Run your Playwright DocuSign automations on cloud browsers with enterprise-grade reliability and persistent DocuSign sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Dropbox
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/dropbox
Automate Dropbox file management workflows with Playwright when APIs aren't available.
# How to Automate Dropbox with Playwright
Automate critical Dropbox file management workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual file organization and reduce sharing errors by automating repetitive document management processes. Use Playwright to interact with Dropbox's web interface programmatically.
[View Dropbox's API documentation](https://www.dropbox.com/developers/documentation) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Dropbox tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Dropbox
await page.goto('https://www.dropbox.com/login');
await page.fill('[name="login_email"]', process.env.DROPBOX_EMAIL);
await page.fill('[name="login_password"]', process.env.DROPBOX_PASSWORD);
await page.click('[data-testid="real-login-button"]');
// Navigate to team folder
await page.click('[data-testid="browse-folders"]');
await page.click('text=Team Shared');
// Create new folder structure
await page.click('[data-testid="new-folder-button"]');
await page.fill('[data-testid="folder-name-input"]', 'Q1 Reports');
await page.click('[data-testid="create-folder"]');
// Upload files to folder
await page.click('text=Q1 Reports');
await page.click('[data-testid="upload-button"]');
const fileInput = await page.locator('input[type="file"]');
await fileInput.setInputFiles(['./reports/january.pdf', './reports/february.pdf']);
// Share folder with team
await page.click('[data-testid="share-button"]');
await page.fill('[data-testid="share-email"]', 'team@company.com');
await page.selectOption('[data-testid="permission-level"]', 'edit');
await page.click('[data-testid="send-invitation"]');
await browser.close();
```
Playwright handles file uploads, folder permissions, and sharing workflows automatically. You can automate document organization, team collaboration setup, and backup processes.
## Scale your Dropbox automation with Anchor Browser
Run your Playwright Dropbox automations on cloud browsers with enterprise-grade reliability and persistent Dropbox sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Figma
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/figma
Automate Figma design workflows with Playwright when APIs aren't available.
# How to Automate Figma with Playwright
Automate critical Figma design workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual design handoffs and reduce version control errors by automating repetitive design collaboration processes. Use Playwright to interact with Figma's web interface programmatically.
[View Figma's API documentation](https://www.figma.com/developers/api) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Figma actions:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Figma
await page.goto('https://www.figma.com/login');
await page.fill('[data-testid="email"]', process.env.FIGMA_EMAIL);
await page.fill('[data-testid="password"]', process.env.FIGMA_PASSWORD);
await page.click('[data-testid="submit"]');
// Navigate to team files
await page.click('[data-testid="dashboard-team-switcher"]');
await page.click('text=Design Team');
await page.click('text=Mobile App Redesign');
// Create new frame
await page.click('[data-testid="toolbar-frame-tool"]');
await page.click('[data-testid="canvas"]');
await page.selectOption('[data-testid="frame-preset"]', 'iPhone 14');
// Add components and export
await page.click('[data-testid="assets-panel"]');
await page.dragAndDrop('[data-testid="button-component"]', '[data-testid="canvas-frame"]');
await page.fill('[data-testid="text-input"]', 'Get Started');
// Export assets
await page.click('[data-testid="export-button"]');
await page.selectOption('[data-testid="export-format"]', 'PNG');
await page.selectOption('[data-testid="export-scale"]', '2x');
await page.click('[data-testid="export-download"]');
// Share with developer
await page.click('[data-testid="share-button"]');
await page.fill('[data-testid="share-email"]', 'developer@company.com');
await page.selectOption('[data-testid="permission-level"]', 'can view');
await page.click('[data-testid="send-invite"]');
await browser.close();
```
Playwright handles component manipulation, export processes, and collaboration workflows automatically. You can automate design system updates, asset generation, and developer handoff processes.
## Scale your Figma automation with Anchor Browser
Run your Playwright Figma automations on cloud browsers with enterprise-grade reliability and persistent Figma sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# HubSpot
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/hubspot
Automate HubSpot CRM workflows with Playwright when APIs aren't available.
# How to Automate HubSpot with Playwright
Automate critical HubSpot CRM workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual lead processing and reduce sales pipeline errors by automating repetitive marketing and sales processes. Use Playwright to interact with HubSpot's web interface programmatically.
[View HubSpot's API documentation](https://developers.hubspot.com/docs/api/overview) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common HubSpot tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to HubSpot
await page.goto('https://app.hubspot.com/login');
await page.fill('#username', process.env.HUBSPOT_EMAIL);
await page.fill('#password', process.env.HUBSPOT_PASSWORD);
await page.click('#loginBtn');
// Navigate to contacts
await page.click('[data-selenium-test="nav-primary-contacts-contacts"]');
await page.click('[data-selenium-test="create-contact-button"]');
// Create new contact
await page.fill('[data-field="firstname"]', 'Michael');
await page.fill('[data-field="lastname"]', 'Chen');
await page.fill('[data-field="email"]', 'michael.chen@techcorp.com');
await page.fill('[data-field="company"]', 'TechCorp Solutions');
await page.selectOption('[data-field="lifecyclestage"]', 'marketingqualifiedlead');
// Create associated deal
await page.click('[data-selenium-test="associations-tab"]');
await page.click('[data-selenium-test="create-deal-button"]');
await page.fill('[data-field="dealname"]', 'TechCorp Enterprise Package');
await page.fill('[data-field="amount"]', '75000');
await page.selectOption('[data-field="dealstage"]', 'qualifiedtobuy');
await page.click('[data-selenium-test="save-contact"]');
await browser.close();
```
Playwright handles form validations, association creation, and pipeline updates automatically. You can automate lead scoring, email campaign management, and sales forecasting workflows.
## Scale your HubSpot automation with Anchor Browser
Run your Playwright HubSpot automations on cloud browsers with enterprise-grade reliability and persistent HubSpot CRM sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Jira
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/jira
Automate Jira project management workflows with Playwright when APIs aren't available.
# How to Automate Jira with Playwright
Automate critical Jira project management workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual ticket creation and reduce project tracking errors by automating repetitive development processes. Use Playwright to interact with Jira's web interface programmatically.
[View Jira's REST API documentation](https://developer.atlassian.com/server/jira/platform/rest/v11000/intro/#gettingstarted) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Jira tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Jira
await page.goto('https://your-company.atlassian.net/');
await page.fill('#username', process.env.JIRA_USERNAME);
await page.click('#login-submit');
await page.fill('#password', process.env.JIRA_PASSWORD);
await page.click('#login-submit');
// Navigate to project
await page.click('[data-testid="global-pages.directories.projects-directory-v2"]');
await page.click('text=Development Project');
// Create new issue
await page.click('[data-testid="project-sidebar.create-issue-button"]');
await page.selectOption('[data-testid="issue-type-select"]', 'Story');
await page.fill('[data-testid="issue-summary-field"]', 'Implement user authentication');
await page.fill('[data-testid="issue-description-field"]', 'Add OAuth login functionality');
await page.selectOption('[data-testid="assignee-select"]', 'john.doe');
await page.click('[data-testid="issue-create-submit"]');
// Update issue status
await page.click('text=DEV-123');
await page.click('[data-testid="issue-workflow-transition"]');
await page.click('text=In Progress');
await browser.close();
```
Playwright handles issue creation, workflow transitions, and field updates automatically. You can automate sprint planning, bulk status updates, and project reporting workflows.
## Scale your Jira automation with Anchor Browser
Run your Playwright Jira automations on cloud browsers with enterprise-grade reliability and persistent Jira sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Miro
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/miro
Automate Miro collaboration workflows with Playwright when APIs aren't available.
# How to Automate Miro with Playwright
Automate critical Miro collaboration workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual board setup and reduce brainstorming session errors by automating repetitive visual collaboration processes. Use Playwright to interact with Miro's web interface programmatically.
[View Miro's API documentation](https://developers.miro.com/docs) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Miro actions:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Miro
await page.goto('https://miro.com/login/');
await page.fill('[data-testid="mr-form-login-btn-start-1"]', process.env.MIRO_EMAIL);
await page.click('[data-testid="mr-form-login-btn-start-1"]');
await page.fill('[data-testid="password"]', process.env.MIRO_PASSWORD);
await page.click('[data-testid="mr-form-login-btn-signin-1"]');
// Create new board
await page.click('[data-testid="create-board-button"]');
await page.fill('[data-testid="board-title-input"]', 'Sprint Planning Session');
await page.selectOption('[data-testid="template-select"]', 'Agile Planning');
await page.click('[data-testid="create-button"]');
// Add sticky notes for user stories
await page.click('[data-testid="toolbar-sticky-note"]');
await page.click('[data-testid="canvas"]', { position: { x: 200, y: 200 } });
await page.fill('[data-testid="sticky-note-text"]', 'As a user, I want to login easily');
await page.press('[data-testid="sticky-note-text"]', 'Escape');
// Create swimlanes
await page.click('[data-testid="toolbar-shapes"]');
await page.click('[data-testid="rectangle-shape"]');
await page.dragAndDrop('[data-testid="canvas"]', '[data-testid="canvas"]', {
sourcePosition: { x: 100, y: 100 },
targetPosition: { x: 800, y: 150 }
});
// Share board with team
await page.click('[data-testid="share-board-button"]');
await page.fill('[data-testid="invite-email"]', 'team@company.com');
await page.selectOption('[data-testid="permission-level"]', 'can edit');
await page.click('[data-testid="send-invitation"]');
await browser.close();
```
Playwright handles canvas interactions, shape creation, and collaboration features automatically. You can automate template setup, workshop facilitation, and board organization workflows.
## Scale your Miro automation with Anchor Browser
Run your Playwright Miro automations on cloud browsers with enterprise-grade reliability and persistent Miro sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Monday
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/monday
Automate Monday.com project management workflows with Playwright when APIs aren't available.
# How to Automate Monday with Playwright
Automate critical Monday.com project management workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual board setup and reduce task tracking errors by automating repetitive project management processes. Use Playwright to interact with Monday.com's web interface programmatically.
[View Monday.com's API documentation](https://developer.monday.com/api-reference/docs) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Monday.com tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Monday.com
await page.goto('https://auth.monday.com/login');
await page.fill('[data-testid="email-field"]', process.env.MONDAY_EMAIL);
await page.fill('[data-testid="password-field"]', process.env.MONDAY_PASSWORD);
await page.click('[data-testid="login-button"]');
// Create new board
await page.click('[data-testid="create-board-button"]');
await page.fill('[data-testid="board-name-input"]', 'Product Launch Campaign');
await page.selectOption('[data-testid="board-template"]', 'Marketing Campaign');
await page.click('[data-testid="create-board-confirm"]');
// Add new item to board
await page.click('[data-testid="add-item-button"]');
await page.fill('[data-testid="item-name"]', 'Website Landing Page');
await page.selectOption('[data-testid="status-column"]', 'Working on it');
await page.fill('[data-testid="person-column"]', 'Sarah Marketing');
await page.click('[data-testid="date-column"]');
await page.fill('[data-testid="due-date"]', '2024-03-15');
// Update item progress
await page.click('[data-testid="timeline-column"]');
await page.dragAndDrop('[data-testid="timeline-bar"]', '[data-testid="timeline-bar"]', {
sourcePosition: { x: 0, y: 0 },
targetPosition: { x: 100, y: 0 }
});
// Add automation
await page.click('[data-testid="board-menu"]');
await page.click('[data-testid="automations-tab"]');
await page.click('[data-testid="add-automation"]');
await page.selectOption('[data-testid="automation-trigger"]', 'when status changes to Done');
await page.selectOption('[data-testid="automation-action"]', 'notify person');
await page.click('[data-testid="save-automation"]');
await browser.close();
```
Playwright handles board creation, item management, and automation setup automatically. You can automate project tracking, team notifications, and reporting workflows.
## Scale your Monday.com automation with Anchor Browser
Run your Playwright Monday automations on cloud browsers with enterprise-grade reliability and persistent Monday sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Pipedrive
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/pipedrive
Automate Pipedrive CRM workflows with Playwright when APIs aren't available.
# How to Automate Pipedrive with Playwright
Automate critical Pipedrive CRM workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual deal tracking and reduce sales pipeline errors by automating repetitive sales processes. Use Playwright to interact with Pipedrive's web interface programmatically.
[View Pipedrive's API documentation](https://developers.pipedrive.com/docs/api/v1) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Pipedrive tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Pipedrive
await page.goto('https://your-company.pipedrive.com/');
await page.fill('[data-testid="login-email"]', process.env.PIPEDRIVE_EMAIL);
await page.fill('[data-testid="login-password"]', process.env.PIPEDRIVE_PASSWORD);
await page.click('[data-testid="login-button"]');
// Navigate to deals pipeline
await page.click('[data-testid="menu-deals"]');
await page.click('[data-testid="add-deal-button"]');
// Create new deal
await page.fill('[data-testid="deal-title"]', 'Enterprise Software License');
await page.fill('[data-testid="deal-value"]', '45000');
await page.selectOption('[data-testid="deal-stage"]', 'qualified-to-buy');
await page.fill('[data-testid="person-name"]', 'Lisa Rodriguez');
await page.fill('[data-testid="organization-name"]', 'Global Tech Solutions');
// Set follow-up activity
await page.click('[data-testid="add-activity-button"]');
await page.selectOption('[data-testid="activity-type"]', 'call');
await page.fill('[data-testid="activity-subject"]', 'Follow-up demo call');
await page.click('[data-testid="save-deal"]');
await browser.close();
```
Playwright handles pipeline navigation, deal progression, and activity scheduling automatically. You can automate lead qualification, sales forecasting, and customer follow-up workflows.
## Scale your Pipedrive automation with Anchor Browser
Run your Playwright Pipedrive automations on cloud browsers with enterprise-grade reliability and persistent Pipedrive sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# ServiceNow
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/servicenow
Automate ServiceNow IT service management workflows with Playwright when APIs aren't available.
# How to Automate ServiceNow with Playwright
Automate critical ServiceNow IT service management workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual ticket processing and reduce service delivery errors by automating repetitive ITSM processes. Use Playwright to interact with ServiceNow's web interface programmatically.
[View ServiceNow's API documentation](https://docs.servicenow.com/csh?topicname=c_RESTAPI.html) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common ServiceNow tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to ServiceNow
await page.goto('https://your-instance.service-now.com/');
await page.fill('[name="user_name"]', process.env.SERVICENOW_USERNAME);
await page.fill('[name="user_password"]', process.env.SERVICENOW_PASSWORD);
await page.click('[name="not_important"]');
// Navigate to Incident Management
await page.click('[data-testid="nav-incident-management"]');
await page.click('[data-testid="create-new-incident"]');
// Create new incident
await page.fill('[data-testid="caller-field"]', 'John Smith');
await page.selectOption('[data-testid="category-select"]', 'Hardware');
await page.selectOption('[data-testid="subcategory-select"]', 'Monitor');
await page.fill('[data-testid="short-description"]', 'Monitor display issues');
await page.fill('[data-testid="description"]', 'User reports flickering and color distortion on primary monitor');
await page.selectOption('[data-testid="priority-select"]', '3 - Moderate');
await page.selectOption('[data-testid="assignment-group"]', 'Desktop Support');
// Add work notes and resolve
await page.fill('[data-testid="work-notes"]', 'Replaced monitor cable. Issue resolved.');
await page.selectOption('[data-testid="incident-state"]', 'Resolved');
await page.selectOption('[data-testid="resolution-code"]', 'Solved (Permanently)');
await page.click('[data-testid="update-incident"]');
// Create change request
await page.click('[data-testid="change-management"]');
await page.click('[data-testid="create-change-request"]');
await page.fill('[data-testid="change-short-description"]', 'Server memory upgrade');
await page.selectOption('[data-testid="change-type"]', 'Standard');
await page.selectOption('[data-testid="risk-level"]', 'Low');
await page.click('[data-testid="submit-change"]');
await browser.close();
```
Playwright handles form navigation, dropdown selections, and workflow transitions automatically. You can automate incident resolution, change approvals, and asset management workflows.
## Scale your ServiceNow automation with Anchor Browser
Run your Playwright ServiceNow automations on cloud browsers with enterprise-grade reliability and persistent ServiceNow sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# UiPath
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/uipath
Automate UiPath RPA management workflows with Playwright when APIs aren't available.
# How to Automate UiPath with Playwright
Automate critical UiPath RPA management workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual bot deployment and reduce automation management errors by automating repetitive RPA administration processes. Use Playwright to interact with UiPath's web interface programmatically.
[View UiPath's API documentation](https://docs.uipath.com/orchestrator/reference) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common UiPath tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to UiPath Orchestrator
await page.goto('https://your-tenant.uipath.com/');
await page.fill('[data-testid="email"]', process.env.UIPATH_EMAIL);
await page.fill('[data-testid="password"]', process.env.UIPATH_PASSWORD);
await page.click('[data-testid="login-button"]');
// Navigate to Automation Cloud
await page.click('[data-testid="orchestrator-tile"]');
await page.click('[data-testid="processes-menu"]');
// Deploy new process
await page.click('[data-testid="add-process-button"]');
await page.fill('[data-testid="process-name"]', 'Invoice Processing Bot');
await page.selectOption('[data-testid="package-select"]', 'InvoiceBot_v1.2');
await page.selectOption('[data-testid="environment-select"]', 'Production');
await page.click('[data-testid="deploy-process"]');
// Schedule automation job
await page.click('[data-testid="jobs-menu"]');
await page.click('[data-testid="create-job-button"]');
await page.selectOption('[data-testid="process-dropdown"]', 'Invoice Processing Bot');
await page.selectOption('[data-testid="robot-select"]', 'Robot-01');
await page.fill('[data-testid="job-priority"]', 'High');
await page.click('[data-testid="start-job"]');
// Monitor job status
await page.click('[data-testid="monitoring-tab"]');
await expect(page.locator('[data-testid="job-status"]')).toContainText('Running');
await browser.close();
```
Playwright handles process deployment, job scheduling, and monitoring workflows automatically. You can automate bot management, queue processing, and performance reporting workflows.
## Scale your UiPath automation with Anchor Browser
Run your Playwright UiPath automations on cloud browsers with enterprise-grade reliability and persistent UiPath sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Wrike
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/business-applications/wrike
Automate Wrike project management workflows with Playwright when APIs aren't available.
# How to Automate Wrike with Playwright
Automate critical Wrike project management workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual project setup and reduce task management errors by automating repetitive work management processes. Use Playwright to interact with Wrike's web interface programmatically.
[View Wrike's API documentation](https://developers.wrike.com/) for integration services when available.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common Wrike tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Login to Wrike
await page.goto('https://www.wrike.com/login/');
await page.fill('[data-testid="email-input"]', process.env.WRIKE_EMAIL);
await page.fill('[data-testid="password-input"]', process.env.WRIKE_PASSWORD);
await page.click('[data-testid="login-button"]');
// Create new project
await page.click('[data-testid="create-project-button"]');
await page.fill('[data-testid="project-title"]', 'Website Redesign Project');
await page.selectOption('[data-testid="project-template"]', 'Marketing Project');
await page.click('[data-testid="create-project-confirm"]');
// Add new task
await page.click('[data-testid="add-task-button"]');
await page.fill('[data-testid="task-title"]', 'Design homepage mockup');
await page.fill('[data-testid="task-description"]', 'Create responsive design mockups for new homepage');
await page.selectOption('[data-testid="task-status"]', 'In Progress');
await page.click('[data-testid="assignee-dropdown"]');
await page.click('text=Design Team');
// Set task dates and priority
await page.click('[data-testid="start-date-picker"]');
await page.click('[data-testid="today-button"]');
await page.click('[data-testid="due-date-picker"]');
await page.click('[data-testid="next-week-button"]');
await page.selectOption('[data-testid="priority-select"]', 'High');
await page.click('[data-testid="save-task"]');
// Create custom dashboard
await page.click('[data-testid="dashboards-menu"]');
await page.click('[data-testid="create-dashboard"]');
await page.fill('[data-testid="dashboard-name"]', 'Project Overview');
await page.click('[data-testid="add-widget"]');
await page.selectOption('[data-testid="widget-type"]', 'Tasks by Status');
await page.click('[data-testid="save-dashboard"]');
await browser.close();
```
Playwright handles project creation, task assignment, and dashboard customization automatically. You can automate time tracking, resource allocation, and progress reporting workflows.
## Scale your Wrike automation with Anchor Browser
Run your Playwright Wrike automations on cloud browsers with enterprise-grade reliability and persistent Wrike sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# BLM Form 3510
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/blm-3510
Automate BLM mineral operations reporting workflows with Playwright when APIs aren't available.
# How to Automate BLM Form 3510 with Playwright
Automate critical BLM mineral operations reporting workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual lease documentation and reduce compliance errors by automating repetitive mineral rights declaration processes. Use Playwright to interact with BLM's minerals management system programmatically.
[View BLM's developer resources](https://www.blm.gov/) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [BLM Form 3510](https://www.blm.gov/sites/blm.gov/files/uploads/Services_National-Operations-Center_Eforms_Fluid-and-Solid-Minerals_3510-001.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to BLM minerals system
await page.goto('https://www.blm.gov/services/electronic-forms');
// Start new mineral operations report
await page.click('[data-testid="new-form-3510"]');
await page.selectOption('[name="report_type"]', 'drilling_operations');
// Lease information
await page.fill('[name="lease_serial_number"]', 'NM-12345-67890');
await page.fill('[name="operator_number"]', 'OP-98765');
await page.selectOption('[name="state"]', 'NM');
await page.fill('[name="county"]', 'Eddy');
// Operator information
await page.fill('[name="operator_name"]', 'Southwest Energy Resources LLC');
await page.fill('[name="operator_address"]', '456 Oil Field Road');
await page.fill('[name="operator_city"]', 'Carlsbad');
await page.selectOption('[name="operator_state"]', 'NM');
await page.fill('[name="operator_zip"]', '88220');
// Well information
await page.fill('[name="well_name"]', 'Federal Well #1');
await page.fill('[name="api_number"]', '30-015-12345');
await page.selectOption('[name="well_type"]', 'oil');
await page.fill('[name="spud_date"]', '10/01/2024');
await page.fill('[name="total_depth"]', '8500');
// Production data
await page.fill('[name="oil_production_bbls"]', '1250');
await page.fill('[name="gas_production_mcf"]', '5600');
await page.fill('[name="water_production_bbls"]', '450');
await page.selectOption('[name="reporting_month"]', '11');
await page.fill('[name="reporting_year"]', '2024');
// Surface operations
await page.fill('[name="surface_disturbance_acres"]', '5.2');
await page.check('[name="reclamation_required"]');
await page.fill('[name="reclamation_bond_amount"]', '50000');
// Certification and submission
await page.check('[name="certify_accuracy"]');
await page.fill('[name="certifier_name"]', 'Robert Operations Manager');
await page.fill('[name="certifier_title"]', 'Operations Manager');
await page.click('[data-testid="submit-report"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles lease validation, production calculations, and BLM submission processes automatically. You can automate monthly reporting, lease modifications, and environmental compliance workflows.
## Scale your BLM Form 3510 automation with Anchor Browser
Run your Playwright BLM automations on cloud browsers with enterprise-grade reliability and persistent minerals management sessions. Learn more and get started for free: Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# BOP Form BP-S0243
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/bop-s243
Automate Bureau of Prisons inmate request workflows with Playwright when APIs aren't available.
# How to Automate BOP Form BP-S0243 with Playwright
Automate Bureau of Prisons administrative request workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual inmate records processing and reduce administrative delays by automating repetitive BOP filing processes. Use Playwright to interact with BOP's TRULINCS system programmatically.
[View BOP's developer resources](https://www.bop.gov/resources/) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [BOP Form BP-S0243](https://www.bop.gov/policy/forms/BP_A0243.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to Bureau of Prisons website
await page.goto('https://www.bop.gov/mobile/policy/forms.jsp');
// Start new BP-S0243 request
await page.click('[data-testid="new-form-s0243"]');
await page.selectOption('[name="request_type"]', 'administrative_remedy');
// Inmate information
await page.fill('[name="register_number"]', '12345-678');
await page.fill('[name="inmate_name"]', 'Smith, John Michael');
await page.fill('[name="date_of_birth"]', '06/20/1980');
await page.selectOption('[name="facility"]', 'FCI_TERMINAL_ISLAND');
await page.fill('[name="unit"]', 'B-2');
await page.fill('[name="cell_number"]', '215');
// Request details
await page.selectOption('[name="subject_category"]', 'medical_services');
await page.fill('[name="request_title"]', 'Request for Specialist Consultation');
await page.fill('[name="request_date"]', '01/15/2025');
// Statement of facts
await page.fill('[name="statement_of_facts"]', 'Requested medical consultation with orthopedic specialist on 12/01/2024. No appointment scheduled after 45 days. Medical staff acknowledged request but provided no timeline.');
// Relief requested
await page.fill('[name="relief_sought"]', 'Schedule consultation with orthopedic specialist within 30 days to address ongoing knee injury documented in medical records.');
// Supporting documentation
await page.check('[name="attachments_included"]');
await page.click('[data-testid="upload-supporting-docs"]');
await page.setInputFiles('[name="supporting_documents"]', './documents/medical_request_form.pdf');
// Previous attempts to resolve
await page.selectOption('[name="informal_resolution_attempted"]', 'yes');
await page.fill('[name="informal_resolution_date"]', '12/15/2024');
await page.fill('[name="staff_contacted"]', 'Medical Unit Manager Thompson');
await page.fill('[name="resolution_outcome"]', 'No resolution provided. Staff stated request was pending review.');
// Witness information (if applicable)
await page.fill('[name="witness_name"]', 'Johnson, Robert');
await page.fill('[name="witness_register"]', '98765-432');
await page.fill('[name="witness_unit"]', 'B-2');
// Emergency request designation
await page.check('[name="expedited_review"]');
await page.fill('[name="expedited_justification"]', 'Ongoing pain affecting daily activities and work assignment performance.');
// Signature and certification
await page.check('[name="certify_accuracy"]');
await page.fill('[name="signature_name"]', 'John Michael Smith');
await page.fill('[name="signature_date"]', '01/15/2025');
await page.fill('[name="register_number_confirm"]', '12345-678');
await page.click('[data-testid="submit-request"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles request categorization, documentation attachment, and BOP submission processes automatically. You can automate remedy requests, appeal filings, and administrative tracking workflows.
## Scale your BOP Form BP-S0243 automation with Anchor Browser
Run your Playwright BOP automations on cloud browsers with enterprise-grade reliability and persistent federal corrections system sessions.
Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# CBP Form 7501
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/cbp-7501
Automate CBP Form 7501 entry documentation workflows with Playwright when APIs aren't available.
# How to Automate CBP Form 7501 with Playwright
Automate critical CBP Form 7501 entry documentation workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual customs entry processing and reduce import clearance delays by automating repetitive trade compliance processes. Use Playwright to interact with CBP's entry system programmatically.
[View CBP's developer resources](https://www.cbp.gov/trade/automated/getting-started) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [CBP Form 7501](https://www.cbp.gov/sites/default/files/2025-07/CBP_Form_7501.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to CBP website
await page.goto('https://www.cbp.gov/document/forms/form-7501-entry-summary-continuation-sheets');
// Start new entry filing
await page.click('[data-testid="new-entry"]');
await page.selectOption('[name="entry_type"]', 'consumption');
// Entry summary information
await page.fill('[name="entry_number"]', '12345678901');
await page.selectOption('[name="port_of_entry"]', '2704'); // Port of Los Angeles
await page.fill('[name="entry_date"]', '12/15/2024');
await page.fill('[name="import_date"]', '12/14/2024');
// Importer information
await page.fill('[name="importer_name"]', 'Global Trade Solutions Inc');
await page.fill('[name="importer_address"]', '456 Commerce St');
await page.fill('[name="importer_city"]', 'Los Angeles');
await page.selectOption('[name="importer_state"]', 'CA');
await page.fill('[name="importer_zip"]', '90210');
await page.fill('[name="importer_ein"]', '12-3456789');
// Transportation details
await page.fill('[name="vessel_name"]', 'MSC MAYA');
await page.fill('[name="voyage_number"]', '024W');
await page.fill('[name="bill_of_lading"]', 'MSCU1234567890');
await page.selectOption('[name="country_of_origin"]', 'CN');
// Merchandise line items
await page.click('[data-testid="add-line-item"]');
await page.fill('[name="line_number"]', '1');
await page.fill('[name="hts_number"]', '6204.62.4040');
await page.fill('[name="merchandise_description"]', 'Women cotton trousers');
await page.fill('[name="quantity"]', '500');
await page.selectOption('[name="unit_of_measure"]', 'DZ'); // Dozen
await page.fill('[name="entered_value"]', '12500.00');
// Duty and fee calculations
await page.fill('[name="duty_rate"]', '16.6');
await page.click('[data-testid="calculate-duties"]');
await page.waitForSelector('[data-testid="duty-amount"]');
// Broker certification
await page.fill('[name="broker_name"]', 'ABC Customs Brokerage');
await page.fill('[name="broker_license"]', '12345');
await page.check('[name="certify_accuracy"]');
// Submit entry
await page.click('[data-testid="submit-entry"]');
await page.waitForSelector('[data-testid="entry-confirmation"]');
// Download entry summary
await page.click('[data-testid="download-summary"]');
await browser.close();
```
Playwright handles HTS code validation, duty calculations, and customs submission processes automatically. You can automate entry modifications, drawback claims, and trade compliance reporting workflows.
## Scale your CBP Form 7501 automation with Anchor Browser
Run your Playwright EPA automations on cloud browsers with enterprise-grade reliability and persistent environmental compliance sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# CCC Form 941
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/ccc-941
Automate USDA farm program income certification workflows with Playwright when APIs aren't available.
# How to Automate CCC Form 941 with Playwright
Automate USDA average adjusted gross income (AGI) certification workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual farm program eligibility documentation and reduce compliance errors by automating repetitive income certification processes. Use Playwright to interact with USDA's farmers.gov system programmatically.
[View USDA's developer resources](https://www.farmers.gov/#tools) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [CCC Form 941](https://www.farmers.gov/sites/default/files/documents/form-ccc-941.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to farmers.gov system
await page.goto('https://www.farmers.gov/working-with-us/common-forms');
// Start new CCC-941 certification
await page.click('[data-testid="new-form-941"]');
await page.selectOption('[name="certification_year"]', '2024');
// Producer information
await page.fill('[name="producer_name"]', 'Johnson Family Farms LLC');
await page.fill('[name="tax_id"]', '12-3456789');
await page.fill('[name="farm_number"]', 'IA-045-678');
await page.fill('[name="tract_number"]', '1234');
// Contact information
await page.fill('[name="address"]', '789 County Road 45');
await page.fill('[name="city"]', 'Des Moines');
await page.selectOption('[name="state"]', 'IA');
await page.fill('[name="zip"]', '50310');
await page.fill('[name="phone"]', '515-555-0123');
await page.fill('[name="email"]', 'operations@johnsonfarms.com');
// AGI certification - three-year average
await page.fill('[name="agi_year_1"]', '2021');
await page.fill('[name="agi_amount_1"]', '675000');
await page.fill('[name="agi_year_2"]', '2022');
await page.fill('[name="agi_amount_2"]', '720000');
await page.fill('[name="agi_year_3"]', '2023');
await page.fill('[name="agi_amount_3"]', '695000');
// Certification statement
await page.check('[name="certify_below_900k"]');
await page.fill('[name="average_agi"]', '696667');
// Farm income breakdown
await page.fill('[name="farm_income_percentage"]', '85');
await page.fill('[name="non_farm_income_percentage"]', '15');
// Program eligibility
await page.check('[name="arc_plc_eligible"]');
await page.check('[name="conservation_eligible"]');
await page.check('[name="disaster_eligible"]');
// Spouse information (if applicable)
await page.check('[name="spouse_separate_filing"]');
await page.fill('[name="spouse_name"]', 'Mary Johnson');
await page.fill('[name="spouse_tax_id"]', '98-7654321');
// Signature and certification
await page.check('[name="certify_accuracy"]');
await page.fill('[name="signature_name"]', 'Robert Johnson');
await page.fill('[name="signature_title"]', 'Managing Partner');
await page.fill('[name="signature_date"]', '12/15/2024');
await page.click('[data-testid="submit-certification"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles AGI calculations, eligibility verification, and USDA submission processes automatically. You can automate annual certifications, multi-entity filings, and program payment tracking workflows.
## Scale your CCC Form 941 automation with Anchor Browser
Run your Playwright USDA automations on cloud browsers with enterprise-grade reliability and persistent farm program sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# CMS Form 10069
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/cms-10069
Automate Medicare provider enrollment and certification workflows with Playwright when APIs aren't available.
# How to Automate CMS Form 10069 with Playwright
Automate CMS Medicare provider enrollment and certification workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual credentialing processes and reduce enrollment delays by automating repetitive Medicare provider application workflows. Use Playwright to interact with CMS's Provider Enrollment, Chain, and Ownership System (PECOS) programmatically.
[View CMS developer resources](https://data.cms.gov/provider-data/) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [CMS Form 10069](https://www.cms.gov/medicare/cms-forms/cms-forms/downloads/cms10069.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to CMS PECOS system
await page.goto('https://www.cms.gov/medicare/forms-notices/cms-forms-list');
// Start new provider enrollment application
await page.click('[data-testid="new-enrollment"]');
await page.selectOption('[name="provider_type"]', 'physician');
// Provider information
await page.fill('[name="npi_number"]', '1234567890');
await page.fill('[name="first_name"]', 'Sarah');
await page.fill('[name="middle_name"]', 'Elizabeth');
await page.fill('[name="last_name"]', 'Williams');
await page.fill('[name="ssn"]', '123-45-6789');
await page.fill('[name="date_of_birth"]', '04/12/1978');
// Contact information
await page.fill('[name="practice_address"]', '456 Medical Plaza, Suite 200');
await page.fill('[name="city"]', 'Houston');
await page.selectOption('[name="state"]', 'TX');
await page.fill('[name="zip"]', '77002');
await page.fill('[name="phone"]', '713-555-0147');
await page.fill('[name="fax"]', '713-555-0148');
await page.fill('[name="email"]', 'swilliams@houstonmedical.com');
// Practice information
await page.fill('[name="practice_name"]', 'Houston Medical Associates');
await page.fill('[name="tax_id"]', '12-3456789');
await page.selectOption('[name="organization_type"]', 'professional_corporation');
await page.fill('[name="group_npi"]', '9876543210');
// Specialty and certification
await page.selectOption('[name="primary_specialty"]', 'internal_medicine');
await page.selectOption('[name="board_certification"]', 'abim');
await page.fill('[name="certification_date"]', '06/15/2005');
await page.fill('[name="certification_expiration"]', '06/15/2025');
// Medical education
await page.fill('[name="medical_school"]', 'Baylor College of Medicine');
await page.fill('[name="graduation_year"]', '2002');
await page.fill('[name="residency_program"]', 'Massachusetts General Hospital');
await page.fill('[name="residency_completion"]', '2005');
// License information
await page.fill('[name="license_number"]', 'TX-M12345');
await page.selectOption('[name="license_state"]', 'TX');
await page.fill('[name="license_issue_date"]', '07/01/2005');
await page.fill('[name="license_expiration"]', '07/01/2026');
await page.check('[name="license_active_status"]');
// Medicare enrollment
await page.selectOption('[name="enrollment_type"]', 'initial');
await page.fill('[name="effective_date"]', '02/01/2025');
await page.check('[name="opt_in_assignment"]');
// Practice locations
await page.click('[data-testid="add-practice-location"]');
await page.fill('[name="location_address"]', '789 Community Health Center');
await page.fill('[name="location_city"]', 'Katy');
await page.selectOption('[name="location_state"]', 'TX');
await page.fill('[name="location_zip"]', '77494');
await page.fill('[name="location_phone"]', '281-555-0199');
// Hospital affiliations
await page.fill('[name="hospital_name"]', 'Memorial Hermann Hospital');
await page.fill('[name="hospital_npi"]', '5555555555');
await page.selectOption('[name="admitting_privileges"]', 'active');
// Malpractice insurance
await page.fill('[name="insurance_carrier"]', 'Texas Medical Liability Trust');
await page.fill('[name="policy_number"]', 'TMLT-2024-789456');
await page.fill('[name="coverage_amount"]', '1000000');
await page.fill('[name="policy_effective']', '01/01/2024');
await page.fill('[name="policy_expiration"]', '12/31/2024');
// Background information
await page.selectOption('[name="felony_conviction"]', 'no');
await page.selectOption('[name="license_revocation"]', 'no');
await page.selectOption('[name="medicare_sanctions"]', 'no');
await page.selectOption('[name="medicaid_exclusion"]', 'no');
// Banking information for EFT
await page.fill('[name="bank_name"]', 'Wells Fargo Bank');
await page.fill('[name="routing_number"]', '111000025');
await page.fill('[name="account_number"]', '1234567890123');
await page.selectOption('[name="account_type"]', 'checking');
// Supporting documentation
await page.click('[data-testid="upload-medical-license"]');
await page.setInputFiles('[name="license_document"]', './documents/tx_medical_license.pdf');
await page.click('[data-testid="upload-board-certification"]');
await page.setInputFiles('[name="certification_document"]', './documents/abim_certificate.pdf');
await page.click('[data-testid="upload-malpractice-insurance"]');
await page.setInputFiles('[name="insurance_document"]', './documents/malpractice_policy.pdf');
// Signature and certification
await page.check('[name="certify_accuracy"]');
await page.check('[name="agree_to_terms"]');
await page.fill('[name="signature_name"]', 'Sarah Elizabeth Williams MD');
await page.fill('[name="signature_title"]', 'Physician');
await page.fill('[name="signature_date"]', '01/20/2025');
await page.click('[data-testid="submit-enrollment"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles credential verification, documentation upload, and CMS submission processes automatically. You can automate provider enrollments, revalidation filings, and practice location updates workflows.
## Scale your CMS Form 10069 automation with Anchor Browser
Run your Playwright CMS automations on cloud browsers with enterprise-grade reliability and persistent Medicare enrollment sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# DOE Form 1845-0031
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/doe-1845-0031
Automate federal student loan forbearance request workflows with Playwright when APIs aren't available.
# How to Automate DOE Form 1845-0031 with Playwright
Automate federal student loan general forbearance request workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual forbearance application processing and reduce approval delays by automating repetitive student loan relief processes. Use Playwright to interact with Federal Student Aid systems programmatically.
[View Federal Student Aid developer resources](https://studentaid.gov/data-center/) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [DOE Form 1845-0031](https://studentaid.gov/sites/default/files/GeneralForbearance.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to Department of Education website
await page.goto('https://www.ed.gov/grants-and-programs/apply-grant/grant-application-and-other-forms');
// Start new forbearance request
await page.click('[data-testid="manage-loans"]');
await page.click('[data-testid="request-forbearance"]');
await page.selectOption('[name="forbearance_type"]', 'general_discretionary');
// Borrower information
await page.fill('[name="first_name"]', 'Jennifer');
await page.fill('[name="middle_initial"]', 'L');
await page.fill('[name="last_name"]', 'Martinez');
await page.fill('[name="ssn"]', '987-65-4321');
await page.fill('[name="date_of_birth"]', '08/25/1995');
// Contact information
await page.fill('[name="address"]', '234 University Avenue, Apt 5C');
await page.fill('[name="city"]', 'Austin');
await page.selectOption('[name="state"]', 'TX');
await page.fill('[name="zip"]', '78705');
await page.fill('[name="phone"]', '512-555-0176');
await page.fill('[name="email"]', 'j.martinez@email.com');
// Loan servicer information
await page.selectOption('[name="loan_servicer"]', 'nelnet');
await page.fill('[name="servicer_account_number"]', '1234567890');
// Forbearance request details
await page.selectOption('[name="reason"]', 'financial_hardship');
await page.fill('[name="requested_start_date"]', '02/01/2025');
await page.selectOption('[name="requested_duration"]', '12_months');
// Financial hardship details
await page.fill('[name="monthly_income"]', '2400');
await page.fill('[name="monthly_expenses"]', '2650');
await page.fill('[name="total_loan_balance"]', '45000');
await page.fill('[name="monthly_loan_payment"]', '485');
// Employment status
await page.selectOption('[name="employment_status"]', 'employed_part_time');
await page.fill('[name="employer_name"]', 'Downtown Coffee Shop');
await page.fill('[name="hours_per_week"]', '25');
await page.fill('[name="employment_start_date"]', '11/15/2024');
// Hardship explanation
await page.fill('[name="hardship_explanation"]', 'Reduced work hours due to business downsizing. Currently seeking full-time employment while maintaining part-time position. Unable to meet loan payment obligations without forbearance.');
// Loan types to include
await page.check('[name="include_direct_loans"]');
await page.check('[name="include_ffel_loans"]');
await page.check('[name="subsidized_loans"]');
await page.check('[name="unsubsidized_loans"]');
// Interest capitalization acknowledgment
await page.check('[name="understand_interest_accrual"]');
await page.check('[name="understand_capitalization"]');
await page.check('[name="acknowledge_payment_increase"]');
// Alternative options reviewed
await page.check('[name="reviewed_income_driven"]');
await page.check('[name="reviewed_deferment"]');
await page.check('[name="reviewed_consolidation"]');
// Supporting documentation
await page.click('[data-testid="upload-income-docs"]');
await page.setInputFiles('[name="income_verification"]', './documents/paystubs_recent.pdf');
await page.click('[data-testid="upload-expense-docs"]');
await page.setInputFiles('[name="expense_documentation"]', './documents/monthly_bills.pdf');
// Notification preferences
await page.check('[name="email_notifications"]');
await page.check('[name="sms_notifications"]');
await page.fill('[name="mobile_number"]', '512-555-0176');
// Signature and certification
await page.check('[name="certify_accuracy"]');
await page.check('[name="authorize_credit_check"]');
await page.fill('[name="signature_name"]', 'Jennifer L Martinez');
await page.fill('[name="signature_date"]', '01/25/2025');
await page.click('[data-testid="submit-request"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles eligibility verification, documentation upload, and Federal Student Aid submission processes automatically. You can automate forbearance renewals, servicer communications, and repayment plan transitions workflows.
## Scale your DOE Form 1845-0031 automation with Anchor Browser
Run your Playwright Federal Student Aid automations on cloud browsers with enterprise-grade reliability and persistent loan servicing sessions. [https://anchorbrowser.io](https://anchorbrowser.io)
# DOJ Form 361
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/doj-361
Automate Department of Justice identity certification workflows with Playwright when APIs aren't available.
# How to Automate DOJ Form 361 with Playwright
Automate Department of Justice identity certification workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual FOIA and Privacy Act request processing and reduce verification delays by automating repetitive identity certification processes. Use Playwright to interact with DOJ records request systems programmatically.
[View Department of Justice developer resources](https://www.justice.gov/developer) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [DOJ Form 361](https://www.justice.gov/ust/file/doj361_form.pdf/dl?inline) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to Department of Justice website
await page.goto('https://www.justice.gov/forms');
// Start new identity certification
await page.click('[data-testid="new-request"]');
await page.click('[data-testid="form-361"]');
await page.selectOption('[name="request_type"]', 'privacy_act_request');
// Full name of requester
await page.fill('[name="requester_last_name"]', 'Thompson');
await page.fill('[name="requester_first_name"]', 'Rebecca');
await page.fill('[name="requester_middle_name"]', 'Anne');
await page.fill('[name="requester_suffix"]', '');
// Citizenship status
await page.selectOption('[name="citizenship_status"]', 'us_citizen');
// Social Security Number (optional but recommended)
await page.fill('[name="ssn"]', '123-45-6789');
// Current address
await page.fill('[name="address_line_1"]', '456 Constitution Avenue');
await page.fill('[name="address_line_2"]', 'Apt 12B');
await page.fill('[name="city"]', 'Washington');
await page.selectOption('[name="state"]', 'DC');
await page.fill('[name="zip"]', '20001');
// Date of birth
await page.fill('[name="date_of_birth"]', '06/14/1982');
// Place of birth
await page.fill('[name="place_of_birth_city"]', 'Philadelphia');
await page.selectOption('[name="place_of_birth_state"]', 'PA');
await page.selectOption('[name="place_of_birth_country"]', 'USA');
// Contact information
await page.fill('[name="phone"]', '202-555-0156');
await page.fill('[name="email"]', 'rthompson@email.com');
// Records being requested
await page.fill('[name="records_description"]', 'All records relating to employment with the Federal Bureau of Investigation from 2005 to 2015, including personnel files, training records, and performance evaluations.');
// Time period for records
await page.fill('[name="date_range_start"]', '01/01/2005');
await page.fill('[name="date_range_end"]', '12/31/2015');
// DOJ component
await page.selectOption('[name="doj_component"]', 'fbi');
// Optional: Authorization to release information to another person
await page.check('[name="authorize_release_to_another"]');
// Authorized person information
await page.fill('[name="authorized_person_name"]', 'David Thompson');
await page.fill('[name="authorized_relationship"]', 'Spouse');
await page.fill('[name="authorized_address"]', '456 Constitution Avenue, Apt 12B');
await page.fill('[name="authorized_city"]', 'Washington');
await page.selectOption('[name="authorized_state"]', 'DC');
await page.fill('[name="authorized_zip"]', '20001');
await page.fill('[name="authorized_phone"]', '202-555-0157');
await page.fill('[name="authorized_email"]', 'dthompson@email.com');
// Purpose of authorization
await page.fill('[name="authorization_purpose"]', 'Authorized to receive and review records on my behalf for legal proceedings.');
// Previous names (if applicable)
await page.check('[name="has_previous_names"]');
await page.fill('[name="previous_name"]', 'Rebecca Miller');
await page.fill('[name="name_change_date"]', '08/2010');
// Previous addresses (if relevant to records)
await page.check('[name="has_previous_addresses"]');
await page.fill('[name="previous_address"]', '789 Market Street, Philadelphia, PA 19107');
await page.fill('[name="previous_address_dates"]', '2005-2010');
// Employment information (if relevant)
await page.fill('[name="employer_during_period"]', 'Federal Bureau of Investigation');
await page.fill('[name="job_title"]', 'Special Agent');
await page.fill('[name="employee_id"]', 'FBI-SA-12345');
await page.fill('[name="employment_dates"]', '2005-2015');
// Identity verification documents
await page.click('[data-testid="upload-id-front"]');
await page.setInputFiles('[name="identification_front"]', './documents/drivers_license_front.pdf');
await page.click('[data-testid="upload-id-back"]');
await page.setInputFiles('[name="identification_back"]', './documents/drivers_license_back.pdf');
// Supporting documentation
await page.click('[data-testid="upload-supporting-docs"]');
await page.setInputFiles('[name="supporting_documents"]', './documents/birth_certificate.pdf');
// Notarization (if required)
await page.check('[name="notarized"]');
await page.fill('[name="notary_name"]', 'John Notary Public');
await page.fill('[name="notary_commission_number"]', 'DC-12345');
await page.fill('[name="notary_expiration"]', '12/31/2026');
await page.fill('[name="notarization_date"]', '03/15/2025');
// Fee waiver request (if applicable)
await page.selectOption('[name="fee_waiver_requested"]', 'no');
// Expedited processing request
await page.selectOption('[name="expedited_processing"]', 'yes');
await page.fill('[name="expedited_justification"]', 'Records needed for pending litigation with court-imposed deadline.');
// Certification under penalty of perjury
await page.check('[name="certify_true_and_correct"]');
await page.check('[name="certify_identity"]');
await page.check('[name="understand_penalties_false_statement"]');
await page.check('[name="understand_penalties_false_pretenses"]');
// Privacy Act acknowledgment
await page.check('[name="acknowledge_privacy_act"]');
await page.check('[name="consent_to_disclosure"]');
// Request delivery preference
await page.selectOption('[name="delivery_method"]', 'electronic');
await page.check('[name="email_notification"]');
// Declaration statement
await page.fill('[name="declaration_text"]', 'I declare under penalty of perjury under the laws of the United States of America that the foregoing is true and correct, and that I am the person named above.');
// Signature
await page.fill('[name="signature_name"]', 'Rebecca Anne Thompson');
await page.fill('[name="signature_date"]', '03/15/2025');
// Digital signature or attestation
await page.check('[name="electronic_signature_consent"]');
await page.fill('[name="electronic_signature']', 'Rebecca Anne Thompson');
// Authorized representative signature (if applicable)
await page.fill('[name="authorized_signature"]', 'David Thompson');
await page.fill('[name="authorized_signature_date"]', '03/15/2025');
// Request tracking preferences
await page.check('[name="track_request_online"]');
await page.check('[name="sms_notifications"]');
await page.fill('[name="mobile_number"]', '202-555-0156');
await page.click('[data-testid="submit-certification"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles identity verification, authorization processing, and DOJ submission processes automatically. You can automate FOIA requests, Privacy Act requests, and identity certification workflows.
## Scale your DOJ Form 361 automation with Anchor Browser
Run your Playwright DOJ automations on cloud browsers with enterprise-grade reliability and persistent PACER sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# EPA Form 8700-22
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/epa-8200
Automate EPA hazardous waste notification workflows with Playwright when APIs aren't available.
# How to Automate EPA Form 8700-22 with Playwright
Automate critical EPA hazardous waste notification workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual compliance reporting and reduce environmental violation risks by automating repetitive hazardous waste declaration processes. Use Playwright to interact with EPA's notification system programmatically.
[View EPA's developer resources](https://www.epa.gov/enviro/web-services) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [EPA Form 8700-22](https://www.epa.gov/sites/default/files/2018-05/documents/uniform_hazardous_waste_manifest.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to EPA RCRAInfo system
await page.goto('https://www.epa.gov/hwgenerators/uniform-hazardous-waste-manifest-instructions-sample-form-and-continuation-sheet');
// Start new hazardous waste notification
await page.click('[data-testid="new-notification"]');
await page.selectOption('[name="notification_type"]', 'initial');
// Facility information
await page.fill('[name="facility_name"]', 'ABC Manufacturing Plant');
await page.fill('[name="facility_address"]', '123 Industrial Blvd');
await page.fill('[name="city"]', 'Detroit');
await page.selectOption('[name="state"]', 'MI');
await page.fill('[name="zip_code"]', '48201');
await page.fill('[name="epa_id_number"]', 'MID987654321');
// Handler classification
await page.check('[name="generator"]');
await page.check('[name="transporter"]');
await page.fill('[name="estimated_annual_quantity"]', '2500');
await page.selectOption('[name="quantity_units"]', 'tons');
// Waste stream information
await page.click('[data-testid="add-waste-stream"]');
await page.selectOption('[name="waste_code"]', 'D001');
await page.fill('[name="waste_description"]', 'Ignitable waste solvents');
await page.selectOption('[name="physical_form"]', 'liquid');
await page.fill('[name="annual_quantity"]', '500');
// Contact person details
await page.fill('[name="contact_first_name"]', 'Sarah');
await page.fill('[name="contact_last_name']', 'Johnson');
await page.fill('[name="contact_title"]', 'Environmental Manager');
await page.fill('[name="contact_phone"]', '555-123-4567');
await page.fill('[name="contact_email"]', 'sarah.johnson@abcmfg.com');
// Certification and submission
await page.check('[name="certify_accuracy"]');
await page.fill('[name="certifier_name"]', 'Sarah Johnson');
await page.fill('[name="certifier_title"]', 'Environmental Manager');
await page.click('[data-testid="submit-notification"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles waste code validation, quantity calculations, and regulatory submission processes automatically. You can automate facility updates, annual reporting, and compliance tracking workflows.
## Scale your EPA Form 8700-22 automation with Anchor Browser
Run your Playwright EPA automations on cloud browsers with enterprise-grade reliability and persistent environmental compliance sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# FDA Form 2579
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/fda-2579
Automate FDA food facility registration workflows with Playwright when APIs aren't available.
# How to Automate FDA Form 2579 with Playwright
Automate critical FDA food facility registration workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual compliance paperwork and reduce food safety violation risks by automating repetitive facility registration processes. Use Playwright to interact with FDA's registration system programmatically.
[View FDA's developer resources](https://www.fda.gov/food/guidance-regulation-food-and-dietary-supplements/registration-food-facilities-and-other-submissions) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [FDA Form 2579](https://www.fda.gov/media/144454/download) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to FDA Food forms
await page.goto('https://www.fda.gov/about-fda/reports-manuals-forms/forms');
// Start new facility registration
await page.click('[data-testid="new-registration"]');
await page.selectOption('[name="registration_type"]', 'initial');
// Facility information
await page.fill('[name="facility_name"]', 'Fresh Valley Food Processing LLC');
await page.fill('[name="facility_address"]', '123 Processing Plant Road');
await page.fill('[name="city"]', 'Fresno');
await page.selectOption('[name="state"]', 'CA');
await page.fill('[name="zip_code"]', '93701');
await page.selectOption('[name="country"]', 'United States');
// Business operations
await page.check('[name="food_manufacturing"]');
await page.check('[name="food_processing"]');
await page.check('[name="food_packing"]');
await page.fill('[name="duns_number"]', '123456789');
// Food categories and processes
await page.click('[data-testid="add-food-category"]');
await page.selectOption('[name="food_category"]', 'fruits_vegetables');
await page.fill('[name="food_description"]', 'Fresh cut vegetables and salad mixes');
await page.selectOption('[name="process_type"]', 'processing_packing');
// Contact information
await page.fill('[name="contact_first_name"]', 'Maria');
await page.fill('[name="contact_last_name']', 'Rodriguez');
await page.fill('[name="contact_title']', 'Quality Assurance Manager');
await page.fill('[name="contact_phone"]', '559-123-4567');
await page.fill('[name="contact_email"]', 'maria.rodriguez@freshvalley.com');
// Emergency contact
await page.fill('[name="emergency_contact_name"]', 'David Chen');
await page.fill('[name="emergency_contact_phone"]', '559-123-4568');
await page.fill('[name="emergency_contact_email"]', 'david.chen@freshvalley.com');
// Certification and submission
await page.check('[name="certify_accuracy"]');
await page.fill('[name="certifier_name"]', 'Maria Rodriguez');
await page.fill('[name="certifier_title']', 'Quality Assurance Manager');
await page.click('[data-testid="submit-registration"]');
// Download registration confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles food category validation, contact verification, and FDA submission processes automatically. You can automate registration renewals, facility updates, and compliance tracking workflows.
## Scale your FDA Form 2579 automation with Anchor Browser
Run your Playwright FDA automations on cloud browsers with enterprise-grade reliability and persistent food safety compliance sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# FinCEN 105 (CMIR)
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/fincen-105
Automate FinCEN 105 currency reporting workflows with Playwright when APIs aren't available.
# How to Automate FinCEN 105 with Playwright
Automate critical FinCEN 105 Currency and Monetary Instrument Report workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual form completion and reduce customs reporting errors by automating repetitive currency declaration processes. Use Playwright to interact with the FinCEN 105 web interface programmatically.
[View more about FinCEN 105](https://fincen105.cbp.dhs.gov/) for available web forms when applicable.
## Setup
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [FinCEN 105](https://www.fincen.gov/system/files/shared/fin105_cmir.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to FinCEN 105 portal
await page.goto('https://www.fincen.gov/resources/filing-information');
// Start new CMIR filing
await page.click('[data-testid="new-filing-button"]');
await page.selectOption('[name="report_type"]', 'import');
// Fill traveler information
await page.fill('[name="first_name"]', 'John');
await page.fill('[name="last_name"]', 'Smith');
await page.fill('[name="date_of_birth"]', '01/15/1980');
await page.fill('[name="passport_number"]', 'A12345678');
await page.selectOption('[name="country_of_citizenship"]', 'Canada');
// Transportation details
await page.fill('[name="flight_number"]', 'AC123');
await page.fill('[name="arrival_date"]', '12/15/2024');
await page.selectOption('[name="port_of_entry"]', 'JFK');
await page.fill('[name="departure_city"]', 'Toronto, ON');
// Currency information
await page.selectOption('[name="currency_type"]', 'cash');
await page.fill('[name="currency_amount"]', '15000');
await page.selectOption('[name="currency_denomination"]', 'USD');
await page.fill('[name="source_of_funds"]', 'Business proceeds from sale');
// Submit declaration
await page.click('[name="certify_accuracy"]');
await page.fill('[name="electronic_signature"]', 'John Smith');
await page.click('[data-testid="submit-declaration"]');
// Download confirmation receipt
await page.click('[data-testid="download-receipt"]');
await browser.close();
```
Playwright handles form validation, currency calculations, and submission processes automatically. You can automate bulk filings, compliance reporting, and traveler declaration workflows.
## Scale your FinCEN 105 automation with Anchor Browser
Run your Playwright FinCEN 105 automations on cloud browsers with enterprise-grade reliability and persistent customs sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# FMCSA Form BMC-40
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/fmcsa-bmc-40
Automate motor carrier surety bond and trust fund filing workflows with Playwright when APIs aren't available.
# How to Automate FMCSA Form BMC-40 with Playwright
Automate FMCSA motor carrier surety bond and trust fund filing workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual bond filing processes and reduce operating authority delays by automating repetitive FMCSA compliance workflows. Use Playwright to interact with FMCSA's registration systems programmatically.
[View FMCSA developer resources](https://mobile.fmcsa.dot.gov/QCDevsite/docs/apiAccess) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [FMCSA Form BMC-40](https://www.fmcsa.dot.gov/sites/fmcsa.dot.gov/files/2025-09/BMC-40%20Form.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to FMCSA registration system
await page.goto('https://www.fmcsa.dot.gov/registration/registration-forms');
// Start new BMC-40 filing
await page.click('[data-testid="insurance-filing"]');
await page.click('[data-testid="form-bmc-40"]');
await page.selectOption('[name="filing_type"]', 'surety_bond');
// Motor carrier information
await page.fill('[name="legal_name"]', 'Midwest Transport Solutions LLC');
await page.fill('[name="dba_name"]', 'Midwest Express Freight');
await page.fill('[name="usdot_number"]', '3456789');
await page.fill('[name="mc_number"]', 'MC-987654');
await page.fill('[name="federal_ein"]', '45-6789012');
// Principal address
await page.fill('[name="address"]', '1200 Industrial Parkway');
await page.fill('[name="city"]', 'Indianapolis');
await page.selectOption('[name="state"]', 'IN');
await page.fill('[name="zip"]', '46204');
await page.fill('[name="phone"]', '317-555-0187');
await page.fill('[name="email"]', 'compliance@midwesttransport.com');
// Operating authority
await page.selectOption('[name="authority_type"]', 'property_carrier');
await page.check('[name="interstate_authority"]');
await page.fill('[name="effective_date"]', '03/01/2025');
// Surety company information
await page.fill('[name="surety_company"]', 'National Surety Corporation');
await page.fill('[name="surety_code"]', '12345');
await page.fill('[name="surety_address"]', '500 Insurance Plaza');
await page.fill('[name="surety_city"]', 'Chicago');
await page.selectOption('[name="surety_state"]', 'IL');
await page.fill('[name="surety_zip"]', '60601');
await page.fill('[name="surety_phone"]', '312-555-0145');
// Bond details
await page.fill('[name="bond_number"]', 'SB-2025-789456');
await page.fill('[name="bond_amount"]', '75000');
await page.fill('[name="bond_effective_date"]', '03/01/2025');
await page.selectOption('[name="bond_type"]', 'continuous');
// Coverage information
await page.check('[name="cargo_liability"]');
await page.check('[name="auto_liability"]');
await page.fill('[name="cargo_limit"]', '100000');
await page.fill('[name="auto_limit"]', '750000');
// Agent for service of process
await page.fill('[name="agent_name"]', 'Corporate Agents Inc');
await page.fill('[name="agent_address"]', '789 State Street');
await page.fill('[name="agent_city"]', 'Indianapolis');
await page.selectOption('[name="agent_state"]', 'IN');
await page.fill('[name="agent_zip"]', '46201');
await page.fill('[name="agent_phone"]', '317-555-0166');
// Power of attorney information
await page.fill('[name="attorney_in_fact']', 'Robert J. Anderson');
await page.fill('[name="attorney_title"]', 'Authorized Representative');
await page.fill('[name="power_of_attorney_number"]', 'POA-456789');
// Cancellation provisions
await page.selectOption('[name="cancellation_notice_days"]', '30');
await page.check('[name="continuous_until_cancelled"]');
// Claims contact information
await page.fill('[name="claims_contact_name"]', 'Jennifer Claims Manager');
await page.fill('[name="claims_phone"]', '312-555-0199');
await page.fill('[name="claims_email"]', 'claims@nationalsurety.com');
await page.fill('[name="claims_fax"]', '312-555-0200');
// Additional insured parties (if applicable)
await page.click('[data-testid="add-additional-insured"]');
await page.fill('[name="additional_insured_name"]', 'ABC Logistics Partners');
await page.fill('[name="additional_insured_address"]', '234 Commerce Drive');
await page.fill('[name="additional_insured_city"]', 'Fort Wayne');
await page.selectOption('[name="additional_insured_state"]', 'IN');
await page.fill('[name="additional_insured_zip"]', '46802');
// Filing reason
await page.selectOption('[name="filing_reason"]', 'new_authority');
await page.fill('[name="previous_bond_number"]', 'N/A');
// Broker authority (if applicable)
await page.check('[name="broker_authority"]');
await page.fill('[name="broker_bond_amount"]', '75000');
await page.fill('[name="broker_bond_number"]', 'BB-2025-789457');
// Supporting documentation
await page.click('[data-testid="upload-bond-document"]');
await page.setInputFiles('[name="bond_document"]', './documents/surety_bond_original.pdf');
await page.click('[data-testid="upload-power-of-attorney"]');
await page.setInputFiles('[name="poa_document"]', './documents/power_of_attorney.pdf');
await page.click('[data-testid="upload-certificate"]');
await page.setInputFiles('[name="certificate_document"]', './documents/insurance_certificate.pdf');
// Carrier certification
await page.check('[name="certify_financial_responsibility"]');
await page.check('[name="certify_continuous_coverage"]');
await page.check('[name="acknowledge_cancellation_terms"]');
await page.check('[name="certify_accuracy"]');
// Carrier signature
await page.fill('[name="carrier_signature_name"]', 'David Transport Owner');
await page.fill('[name="carrier_signature_title"]', 'President');
await page.fill('[name="carrier_signature_date"]', '02/01/2025');
// Surety company certification
await page.fill('[name="surety_signature_name"]', 'Robert J. Anderson');
await page.fill('[name="surety_signature_title"]', 'Authorized Representative');
await page.fill('[name="surety_signature_date"]', '02/01/2025');
await page.click('[data-testid="submit-filing"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles bond validation, surety verification, and FMCSA submission processes automatically. You can automate new authority filings, bond renewals, and coverage modification workflows.
## Scale your FMCSA Form BMC-40 automation with Anchor Browser
Run your Playwright FMCSA automations on cloud browsers with enterprise-grade reliability and persistent motor carrier registration sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# FMCSA Form OP-1
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/fmcsa-op-1
Automate motor carrier operating authority application workflows with Playwright when APIs aren't available.
# How to Automate FMCSA Form OP-1 with Playwright
Automate FMCSA motor carrier operating authority application workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual registration processes and reduce authority approval delays by automating repetitive FMCSA application workflows. Use Playwright to interact with FMCSA's Unified Registration System programmatically.
[View FMCSA developer resources](https://mobile.fmcsa.dot.gov/QCDevsite/docs/apiAccess) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [FMCSA Form OP-1](https://www.fmcsa.dot.gov/sites/fmcsa.dot.gov/files/2025-09/OP-1%20Form.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to FMCSA registration system
await page.goto('https://www.fmcsa.dot.gov/registration/registration-forms');
// Start new OP-1 application
await page.click('[data-testid="new-application"]');
await page.selectOption('[name="application_type"]', 'motor_carrier_authority');
await page.selectOption('[name="operation_classification"]', 'passenger_carrier');
// Legal business name
await page.fill('[name="legal_name"]', 'Premier Charter Bus Services Inc');
await page.fill('[name="dba_name"]', 'Premier Coaches');
await page.selectOption('[name="entity_type"]', 'corporation');
await page.fill('[name="state_of_incorporation"]', 'FL');
await page.fill('[name="date_of_incorporation"]', '03/20/2023');
// Tax identification
await page.fill('[name="federal_ein"]', '65-4321987');
await page.selectOption('[name="tax_status"]', 'corporation');
// Principal place of business
await page.fill('[name="business_address"]', '3400 Transportation Boulevard');
await page.fill('[name="business_suite"]', '');
await page.fill('[name="business_city"]', 'Orlando');
await page.selectOption('[name="business_state"]', 'FL');
await page.fill('[name="business_zip"]', '32801');
await page.fill('[name="business_phone"]', '407-555-0164');
await page.fill('[name="business_fax"]', '407-555-0165');
await page.fill('[name="business_email"]', 'info@premiercoaches.com');
// Mailing address
await page.check('[name="mailing_same_as_business"]');
// Ownership information
await page.click('[data-testid="add-officer"]');
await page.fill('[name="officer_name"]', 'Elizabeth Martinez');
await page.fill('[name="officer_title"]', 'President/CEO');
await page.fill('[name="officer_ownership"]', '55');
await page.fill('[name="officer_ssn"]', '456-78-9012');
await page.fill('[name="officer_address"]', '1200 Executive Circle');
await page.fill('[name="officer_city"]', 'Winter Park');
await page.selectOption('[name="officer_state"]', 'FL');
await page.fill('[name="officer_zip"]', '32789');
// Add additional officer
await page.click('[data-testid="add-officer"]');
await page.fill('[name="officer_name_2"]', 'James Rodriguez');
await page.fill('[name="officer_title_2"]', 'Vice President/CFO');
await page.fill('[name="officer_ownership_2"]', '45');
await page.fill('[name="officer_ssn_2"]', '567-89-0123');
// Operating authority requested
await page.check('[name="interstate_authority"]');
await page.selectOption('[name="carrier_type"]', 'passenger');
await page.check('[name="charter_service"]');
await page.check('[name="tour_service"]');
await page.check('[name="special_operations"]');
// Passenger service details
await page.selectOption('[name="service_type"]', 'charter_tour');
await page.fill('[name="passenger_capacity"]', '450');
await page.check('[name="wheelchair_accessible"]');
await page.fill('[name="accessible_vehicles"]', '8');
// Geographic scope
await page.check('[name="48_states"]');
await page.check('[name="canada"]');
await page.selectOption('[name="primary_service_area"]', 'southeast');
// Type of operation
await page.selectOption('[name="operating_status"]', 'new_entrant');
await page.fill('[name="operations_begin_date"]', '05/01/2025');
await page.fill('[name="estimated_annual_mileage"]', '350000');
// Fleet information
await page.fill('[name="motorcoaches_owned"]', '10');
await page.fill('[name="motorcoaches_leased"]', '2');
await page.fill('[name="minibuses_owned"]', '3');
await page.fill('[name="vans_owned"]', '5');
await page.fill('[name="total_seating_capacity"]', '450');
await page.fill('[name="drivers_employed"]', '15');
// Vehicle specifications
await page.fill('[name="average_vehicle_age"]', '3');
await page.fill('[name="newest_vehicle_year"]', '2024');
await page.fill('[name="oldest_vehicle_year"]', '2019');
// MCS-150 mileage information
await page.fill('[name="total_annual_mileage"]', '350000');
await page.fill('[name="vehicle_miles_us"]', '330000');
await page.fill('[name="vehicle_miles_canada"]', '20000');
await page.fill('[name="vehicle_miles_mexico"]', '0');
// Safety management information
await page.fill('[name="safety_director_name"]', 'Michael Safety Director');
await page.fill('[name="safety_director_phone"]', '407-555-0170');
await page.fill('[name="safety_director_email"]', 'safety@premiercoaches.com');
await page.check('[name="drug_testing_program"]');
await page.check('[name="alcohol_testing_program"]');
// Driver qualification files
await page.check('[name="maintains_driver_files"]');
await page.fill('[name="driver_file_location"]', '3400 Transportation Boulevard, Orlando FL 32801');
// Process agent designation
await page.fill('[name="process_agent_name"]', 'Florida Registered Agents LLC');
await page.fill('[name="process_agent_address"]', '678 Legal Plaza');
await page.fill('[name="process_agent_city"]', 'Tallahassee');
await page.selectOption('[name="process_agent_state"]', 'FL');
await page.fill('[name="process_agent_zip"]', '32301');
await page.fill('[name="process_agent_phone"]', '850-555-0188');
// Unified Carrier Registration
await page.check('[name="ucr_participation"]');
await page.selectOption('[name="ucr_tier"]', 'tier_2');
await page.fill('[name="ucr_year"]', '2025');
// Liability insurance
await page.fill('[name="insurance_carrier"]', 'National Transit Insurance Company');
await page.fill('[name="insurance_policy"]', 'NTIC-2025-PC-789456');
await page.fill('[name="liability_coverage"]', '5000000');
await page.fill('[name="insurance_effective_date"]', '05/01/2025');
await page.fill('[name="insurance_agent_name"]', 'Sarah Insurance Agent');
await page.fill('[name="insurance_agent_phone"]', '407-555-0199');
// Additional insurance coverage
await page.check('[name="physical_damage_coverage"]');
await page.fill('[name="physical_damage_amount"]', '2500000');
await page.check('[name="medical_payments"]');
await page.fill('[name="medical_payments_limit"]', '5000');
// USDOT PIN creation
await page.fill('[name="pin_password"]', process.env.USDOT_PIN);
await page.fill('[name="pin_confirm"]', process.env.USDOT_PIN);
await page.fill('[name="security_question_1"]', 'What city were you born in?');
await page.fill('[name="security_answer_1"]', process.env.SECURITY_ANSWER_1);
await page.fill('[name="security_question_2"]', 'What was your first pet\'s name?');
await page.fill('[name="security_answer_2"]', process.env.SECURITY_ANSWER_2);
// Background information
await page.selectOption('[name="prior_authority"]', 'no');
await page.selectOption('[name="revoked_authority"]', 'no');
await page.selectOption('[name="safety_rating"]', 'none');
await page.selectOption('[name="out_of_service"]', 'no');
await page.selectOption('[name="bankruptcy_proceedings"]', 'no');
// Criminal history disclosure
await page.selectOption('[name="felony_convictions"]', 'no');
await page.selectOption('[name="officer_convictions"]', 'no');
// State operating authority
await page.check('[name="state_authority_florida"]');
await page.fill('[name="fl_permit_number"]', 'FL-PC-456789');
await page.check('[name="additional_state_authority"]');
await page.fill('[name="states_authorized"]', 'GA, AL, SC, NC, TN');
// Contact person for application
await page.fill('[name="contact_name"]', 'Elizabeth Martinez');
await page.fill('[name="contact_title"]', 'President/CEO');
await page.fill('[name="contact_phone"]', '407-555-0164');
await page.fill('[name="contact_email"]', 'emartinez@premiercoaches.com');
// Supporting documentation
await page.click('[data-testid="upload-articles-incorporation"]');
await page.setInputFiles('[name="incorporation_documents"]', './documents/articles_of_incorporation.pdf');
await page.click('[data-testid="upload-ein-letter"]');
await page.setInputFiles('[name="ein_verification"]', './documents/irs_ein_letter.pdf');
await page.click('[data-testid="upload-vehicle-list"]');
await page.setInputFiles('[name="fleet_roster"]', './documents/vehicle_inventory.pdf');
await page.click('[data-testid="upload-lease-agreements"]');
await page.setInputFiles('[name="equipment_leases"]', './documents/coach_leases.pdf');
// Certification and signature
await page.check('[name="certify_accuracy"]');
await page.check('[name="certify_authority_to_sign"]');
await page.check('[name="acknowledge_penalties"]');
await page.check('[name="agree_to_fmcsa_regulations"]');
await page.check('[name="acknowledge_safety_fitness"]');
await page.fill('[name="signature_name"]', 'Elizabeth Martinez');
await page.fill('[name="signature_title"]', 'President/CEO');
await page.fill('[name="signature_date"]', '02/10/2025');
// Payment information
await page.selectOption('[name="payment_method"]', 'credit_card');
await page.fill('[name="card_number"]', process.env.PAYMENT_CARD);
await page.fill('[name="card_expiry"]', '11/28');
await page.fill('[name="card_cvv"]', process.env.CARD_CVV);
await page.fill('[name="cardholder_name"]', 'Elizabeth Martinez');
await page.fill('[name="billing_zip"]', '32801');
await page.fill('[name="registration_fee"]', '300');
await page.click('[data-testid="submit-application"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles fleet validation, insurance verification, and FMCSA submission processes automatically. You can automate new authority applications, passenger carrier registrations, and biennial updates workflows.
## Scale your FMCSA Form OP-1 automation with Anchor Browser
Run your Playwright FMCSA automations on cloud browsers with enterprise-grade reliability and persistent carrier registration sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# FMCSA Form OP-1(P)
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/fmcsa-op-1-p
Automate motor carrier passenger operating authority application workflows with Playwright when APIs aren't available.
# How to Automate FMCSA Form OP-1(P) with Playwright
Automate FMCSA passenger carrier operating authority application workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual registration processes and reduce authority approval delays by automating repetitive FMCSA application workflows. Use Playwright to interact with FMCSA's Unified Registration System programmatically.
[View FMCSA developer resources](https://mobile.fmcsa.dot.gov/QCDevsite/docs/apiAccess) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [FMCSA Form OP-1(P)](https://www.fmcsa.dot.gov/sites/fmcsa.dot.gov/files/2025-09/OP-1%28P%29%20Form.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to FMCSA registration system
await page.goto('https://www.fmcsa.dot.gov/registration/registration-forms');
// Start new OP-1(P) application
await page.click('[data-testid="new-application"]');
await page.selectOption('[name="application_type"]', 'passenger_carrier_authority');
await page.selectOption('[name="operation_classification"]', 'for_hire');
// Legal business name
await page.fill('[name="legal_name"]', 'Gateway Freight Systems LLC');
await page.fill('[name="dba_name"]', 'Gateway Express');
await page.selectOption('[name="entity_type"]', 'limited_liability_company');
await page.fill('[name="state_of_formation"]', 'GA');
await page.fill('[name="date_of_formation"]', '01/15/2024');
// Tax identification
await page.fill('[name="federal_ein"]', '58-9876543');
await page.selectOption('[name="tax_status"]', 'corporation');
// Principal place of business
await page.fill('[name="business_address"]', '2500 Commerce Parkway');
await page.fill('[name="business_suite"]', 'Suite 300');
await page.fill('[name="business_city"]', 'Atlanta');
await page.selectOption('[name="business_state"]', 'GA');
await page.fill('[name="business_zip"]', '30339');
await page.fill('[name="business_phone"]', '404-555-0192');
await page.fill('[name="business_fax"]', '404-555-0193');
await page.fill('[name="business_email"]', 'operations@gatewayfreight.com');
// Mailing address (if different)
await page.check('[name="mailing_same_as_business"]');
// Ownership information
await page.click('[data-testid="add-owner"]');
await page.fill('[name="owner_name"]', 'Thomas Anderson');
await page.fill('[name="owner_title"]', 'Managing Member');
await page.fill('[name="owner_percentage"]', '60');
await page.fill('[name="owner_ssn"]', '234-56-7890');
await page.fill('[name="owner_address"]', '789 Executive Drive');
await page.fill('[name="owner_city"]', 'Alpharetta');
await page.selectOption('[name="owner_state"]', 'GA');
await page.fill('[name="owner_zip"]', '30022');
// Add second owner
await page.click('[data-testid="add-owner"]');
await page.fill('[name="owner_name_2"]', 'Patricia Wilson');
await page.fill('[name="owner_title_2"]', 'Member');
await page.fill('[name="owner_percentage_2"]', '40');
await page.fill('[name="owner_ssn_2"]', '345-67-8901');
// Operating authority requested
await page.check('[name="interstate_authority"]');
await page.selectOption('[name="passenger_type"]', 'bus');
// Geographic scope
await page.check('[name="48_states"]');
await page.check('[name="mexico"]');
await page.check('[name="canada"]');
// Cargo carried
await page.check('[name="general_commodities"]');
await page.check('[name="household_goods_carrier"]');
await page.fill('[name="commodity_description"]', 'General freight including consumer goods, electronics, and refrigerated products');
// Type of operation
await page.selectOption('[name="operating_status"]', 'new_entrant');
await page.fill('[name="operations_begin_date"]', '04/01/2025');
await page.fill('[name="estimated_mileage"]', '500000');
// Fleet information
await page.fill('[name="power_units_owned"]', '12');
await page.fill('[name="power_units_term_leased"]', '3');
await page.fill('[name="power_units_trip_leased"]', '0');
await page.fill('[name="trailers_owned"]', '25');
await page.fill('[name="trailers_leased"]', '5');
await page.fill('[name="drivers_employed"]', '18');
// MCS-150 mileage information
await page.fill('[name="total_annual_mileage"]', '500000');
await page.fill('[name="vehicle_miles_us"]', '450000');
await page.fill('[name="vehicle_miles_canada"]', '30000');
await page.fill('[name="vehicle_miles_mexico"]', '20000');
// Safety management information
await page.fill('[name="safety_director_name"]', 'Karen Transportation Manager');
await page.fill('[name="safety_director_phone"]', '404-555-0198');
await page.fill('[name="safety_director_email"]', 'safety@gatewayfreight.com');
// Process agent designation
await page.fill('[name="process_agent_name"]', 'National Registered Agents Inc');
await page.fill('[name="process_agent_address"]', '456 Legal Services Blvd');
await page.fill('[name="process_agent_city"]', 'Atlanta');
await page.selectOption('[name="process_agent_state"]', 'GA');
await page.fill('[name="process_agent_zip"]', '30303');
await page.fill('[name="process_agent_phone"]', '404-555-0177');
// Unified Carrier Registration
await page.check('[name="ucr_participation"]');
await page.selectOption('[name="ucr_tier"]', 'tier_3');
await page.fill('[name="ucr_year"]', '2025');
// Insurance information
await page.fill('[name="insurance_carrier"]', 'Continental Insurance Group');
await page.fill('[name="insurance_policy"]', 'CIG-2025-789123');
await page.fill('[name="insurance_coverage_amount"]', '1000000');
await page.fill('[name="insurance_effective_date"]', '04/01/2025');
// Cargo insurance
await page.fill('[name="cargo_insurance_carrier"]', 'Transport Insurance Services');
await page.fill('[name="cargo_policy_number"]', 'TIS-2025-456789');
await page.fill('[name="cargo_coverage"]', '100000');
// USDOT PIN creation
await page.fill('[name="pin_password"]', process.env.USDOT_PIN);
await page.fill('[name="pin_confirm"]', process.env.USDOT_PIN);
await page.fill('[name="security_question_1"]', 'What is your mother\'s maiden name?');
await page.fill('[name="security_answer_1"]', process.env.SECURITY_ANSWER_1);
// Background information
await page.selectOption('[name="prior_authority"]', 'no');
await page.selectOption('[name="safety_rating"]', 'none');
await page.selectOption('[name="suspended_authority"]', 'no');
await page.selectOption('[name="bankruptcy_proceedings"]', 'no');
// Felony conviction disclosure
await page.selectOption('[name="felony_convictions"]', 'no');
// Contact person for application
await page.fill('[name="contact_name"]', 'Thomas Anderson');
await page.fill('[name="contact_title"]', 'Managing Member');
await page.fill('[name="contact_phone"]', '404-555-0192');
await page.fill('[name="contact_email"]', 'tanderson@gatewayfreight.com');
// Supporting documentation
await page.click('[data-testid="upload-articles-of-organization"]');
await page.setInputFiles('[name="formation_documents"]', './documents/llc_articles.pdf');
await page.click('[data-testid="upload-ein-letter"]');
await page.setInputFiles('[name="ein_verification"]', './documents/irs_ein_letter.pdf');
await page.click('[data-testid="upload-lease-agreements"]');
await page.setInputFiles('[name="equipment_leases"]', './documents/truck_leases.pdf');
// Certification and signature
await page.check('[name="certify_truth"]');
await page.check('[name="certify_authority"]');
await page.check('[name="acknowledge_penalties"]');
await page.check('[name="agree_to_regulations"]');
await page.fill('[name="signature_name"]', 'Thomas Anderson');
await page.fill('[name="signature_title"]', 'Managing Member');
await page.fill('[name="signature_date"]', '02/05/2025');
// Payment information
await page.selectOption('[name="payment_method"]', 'credit_card');
await page.fill('[name="card_number"]', process.env.PAYMENT_CARD);
await page.fill('[name="card_expiry"]', '12/27');
await page.fill('[name="card_cvv"]', process.env.CARD_CVV);
await page.fill('[name="billing_zip"]', '30339');
await page.fill('[name="registration_fee"]', '300');
await page.click('[data-testid="submit-application"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles fleet validation, insurance verification, and FMCSA submission processes automatically. You can automate new authority applications, operating authority amendments, and biennial updates workflows.
## Scale your FMCSA Form OP-1(P) automation with Anchor Browser
Run your Playwright FMCSA automations on cloud browsers with enterprise-grade reliability and persistent carrier registration sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Form 122A-1
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/form-122a-1
Automate Chapter 7 bankruptcy means test and income statement workflows with Playwright when APIs aren't available.
# How to Automate Form 122A-1 with Playwright
Automate Chapter 7 bankruptcy means test and current monthly income statement workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual income calculation errors and reduce case filing delays by automating repetitive bankruptcy documentation processes. Use Playwright to interact with PACER and bankruptcy court systems programmatically.
[View PACER developer resources](https://pacer.uscourts.gov/file-case/developer-resources) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [Form 122A-1](https://www.uscourts.gov/file/26712/download) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to US Federal Courts system
await page.goto('https://www.uscourts.gov/forms-rules/forms');
// Start new Form 122A-1
await page.click('[data-testid="bankruptcy-filing"]');
await page.click('[data-testid="form-122a-1"]');
await page.selectOption('[name="case_chapter"]', 'chapter_7');
// Debtor information
await page.fill('[name="debtor_first_name"]', 'Christopher');
await page.fill('[name="debtor_middle_name"]', 'Daniel');
await page.fill('[name="debtor_last_name"]', 'Peterson');
await page.fill('[name="ssn_last_4"]', '6789');
await page.fill('[name="case_number"]', '25-10234');
// Court information
await page.selectOption('[name="district"]', 'eastern_michigan');
await page.selectOption('[name="division"]', 'detroit');
// Joint debtor (if applicable)
await page.check('[name="joint_case"]');
await page.fill('[name="joint_first_name"]', 'Amanda');
await page.fill('[name="joint_middle_name"]', 'Lynn');
await page.fill('[name="joint_last_name"]', 'Peterson');
await page.fill('[name="joint_ssn_last_4"]', '4321');
// Marital and household status
await page.selectOption('[name="marital_status"]', 'married');
await page.fill('[name="household_size"]', '4');
await page.fill('[name="dependents"]', '2');
await page.fill('[name="dependent_ages"]', '8, 12');
// Employment status - Debtor
await page.selectOption('[name="debtor_employment"]', 'employed');
await page.fill('[name="debtor_employer"]', 'Metro Manufacturing Inc');
await page.fill('[name="debtor_occupation"]', 'Production Supervisor');
await page.fill('[name="debtor_employment_start"]', '03/2019');
// Employment status - Spouse
await page.selectOption('[name="spouse_employment"]', 'employed');
await page.fill('[name="spouse_employer"]', 'Community Hospital');
await page.fill('[name="spouse_occupation"]', 'Registered Nurse');
await page.fill('[name="spouse_employment_start"]', '06/2018');
// Part 1: Calculate Your Current Monthly Income
// Income from employment (6-month average)
await page.fill('[name="debtor_gross_month_1"]', '4200');
await page.fill('[name="debtor_gross_month_2"]', '4200');
await page.fill('[name="debtor_gross_month_3"]', '4200');
await page.fill('[name="debtor_gross_month_4"]', '4350');
await page.fill('[name="debtor_gross_month_5"]', '4200');
await page.fill('[name="debtor_gross_month_6"]', '4200');
await page.fill('[name="spouse_gross_month_1"]', '5100');
await page.fill('[name="spouse_gross_month_2"]', '5400');
await page.fill('[name="spouse_gross_month_3"]', '5100');
await page.fill('[name="spouse_gross_month_4"]', '5100');
await page.fill('[name="spouse_gross_month_5"]', '5250');
await page.fill('[name="spouse_gross_month_6"]', '5100');
// Business income (if applicable)
await page.selectOption('[name="operates_business"]', 'no');
await page.fill('[name="business_gross_income"]', '0');
await page.fill('[name="business_expenses"]', '0');
// Rental and real property income
await page.check('[name="rental_income_exists"]');
await page.fill('[name="rental_gross_receipts"]', '1200');
await page.fill('[name="rental_ordinary_expenses"]', '850');
await page.fill('[name="rental_net_income"]', '350');
// Interest, dividends, and royalties
await page.fill('[name="interest_income"]', '15');
await page.fill('[name="dividend_income"]', '0');
await page.fill('[name="royalty_income"]', '0');
// Pension and retirement income
await page.fill('[name="pension_income"]', '0');
await page.fill('[name="401k_withdrawals"]', '0');
await page.fill('[name="social_security"]', '0');
// Other monthly income
await page.fill('[name="unemployment_compensation"]', '0');
await page.fill('[name="workers_compensation"]', '0');
await page.fill('[name="child_support_received"]', '0');
await page.fill('[name="alimony_received"]', '0');
await page.fill('[name="other_income"]', '0');
// Income from all sources (calculated automatically)
await page.fill('[name="total_monthly_income"]', '9630');
await page.fill('[name="annual_income']', '115560');
// Part 2: Determine Whether the Presumption of Abuse Applies
// Median family income comparison
await page.selectOption('[name="state_of_residence"]', 'MI');
await page.fill('[name="household_size_means_test"]', '4');
await page.fill('[name="applicable_median_income"]', '106847');
// Marital adjustment deductions
await page.check('[name="non_filing_spouse_income"]');
await page.fill('[name="spouse_income_not_contributed"]', '850');
await page.fill('[name="spouse_separate_debt_payments"]', '0');
// Calculate current monthly income for means test
await page.fill('[name="cmi_total"]', '8780');
await page.fill('[name="annualized_cmi"]', '105360');
// Compare to median income
await page.check('[name="income_below_median"]');
// Presumption determination
await page.selectOption('[name="presumption_result"]', 'does_not_arise');
// Additional information
await page.fill('[name="calculation_period_start"]', '08/01/2024');
await page.fill('[name="calculation_period_end"]', '01/31/2025');
// Income fluctuation explanation
await page.fill('[name="income_changes_explanation"]', 'Spouse received overtime pay in December 2024 for holiday coverage. Rental property tenant moved in during calculation period.');
// Excluded income (if applicable)
await page.selectOption('[name="excluded_income_exists"]', 'yes');
await page.fill('[name="excluded_income_type"]', 'Social Security benefits for minor child');
await page.fill('[name="excluded_income_amount"]', '685');
// Non-filing spouse contribution
await page.fill('[name="spouse_household_contribution"]', '4250');
await page.fill('[name="spouse_separate_household_expenses"]', '850');
// Special circumstances (if any)
await page.selectOption('[name="special_circumstances"]', 'no');
// Attorney information
await page.check('[name="represented_by_attorney"]');
await page.fill('[name="attorney_name"]', 'Patricia Morrison');
await page.fill('[name="attorney_bar_number"]', 'MI-P67890');
await page.fill('[name="attorney_firm"]', 'Morrison Bankruptcy Law PLLC');
await page.fill('[name="attorney_address"]', '1500 Woodward Avenue, Suite 800');
await page.fill('[name="attorney_city"]', 'Detroit');
await page.selectOption('[name="attorney_state"]', 'MI');
await page.fill('[name="attorney_zip"]', '48226');
await page.fill('[name="attorney_phone"]', '313-555-0145');
// Supporting documentation
await page.click('[data-testid="upload-pay-stubs"]');
await page.setInputFiles('[name="income_verification"]', './documents/paystubs_6months.pdf');
await page.click('[data-testid="upload-tax-returns"]');
await page.setInputFiles('[name="tax_documents"]', './documents/2024_tax_return.pdf');
await page.click('[data-testid="upload-rental-statements"]');
await page.setInputFiles('[name="rental_documentation"]', './documents/rental_income_statements.pdf');
// Certification under penalty of perjury
await page.check('[name="certify_accuracy"]');
await page.check('[name="certify_complete"]');
await page.check('[name="understand_penalties"]');
// Debtor signature
await page.fill('[name="debtor_signature"]', 'Christopher Daniel Peterson');
await page.fill('[name="debtor_signature_date"]', '02/15/2025');
// Joint debtor signature
await page.fill('[name="joint_debtor_signature"]', 'Amanda Lynn Peterson');
await page.fill('[name="joint_debtor_signature_date"]', '02/15/2025');
// Attorney certification
await page.fill('[name="attorney_signature"]', 'Patricia Morrison');
await page.fill('[name="attorney_signature_date"]', '02/15/2025');
await page.click('[data-testid="submit-form"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles income calculations, median income comparisons, and bankruptcy court submission processes automatically. You can automate means test filings, income statement updates, and case documentation workflows.
## Scale your Form 122A-1 automation with Anchor Browser
Run your Playwright bankruptcy court automations on cloud browsers with enterprise-grade reliability and persistent PACER sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# FS Form 5444
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/fs-5444
Automate TreasuryDirect account authorization workflows with Playwright when APIs aren't available.
# How to Automate FS Form 5444 with Playwright
Automate TreasuryDirect account authorization workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual authorization processing and reduce account access delays by automating repetitive TreasuryDirect delegation processes. Use Playwright to interact with TreasuryDirect systems programmatically.
[View TreasuryDirect developer resources](https://www.treasurydirect.gov/help-center/) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [FS Form 5444](https://www.treasurydirect.gov/forms/acctauth.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to TreasuryDirect system
await page.goto('https://treasurydirect.gov/forms/');
// Start new account authorization form
await page.click('[data-testid="manage-account"]');
await page.click('[data-testid="account-authorization"]');
await page.selectOption('[name="form_type"]', 'fs_5444');
// Account holder information
await page.fill('[name="account_holder_name"]', 'Margaret Elizabeth Wilson');
await page.fill('[name="ssn"]', '123-45-6789');
await page.fill('[name="account_number"]', 'TD-987654321');
await page.fill('[name="date_of_birth"]', '06/12/1968');
// Contact information
await page.fill('[name="address"]', '456 Financial Plaza, Suite 200');
await page.fill('[name="city"]', 'Charlotte');
await page.selectOption('[name="state"]', 'NC');
await page.fill('[name="zip"]', '28202');
await page.fill('[name="phone"]', '704-555-0156');
await page.fill('[name="email"]', 'mwilson@email.com');
// Type of authorization
await page.selectOption('[name="authorization_type"]', 'account_manager');
await page.check('[name="full_transaction_authority"]');
// Authorized individual information
await page.fill('[name="authorized_name"]', 'Robert James Wilson');
await page.fill('[name="authorized_ssn"]', '987-65-4321');
await page.fill('[name="authorized_relationship"]', 'Spouse');
await page.fill('[name="authorized_date_of_birth"]', '03/18/1965');
// Authorized person contact information
await page.fill('[name="authorized_address"]', '456 Financial Plaza, Suite 200');
await page.fill('[name="authorized_city"]', 'Charlotte');
await page.selectOption('[name="authorized_state"]', 'NC');
await page.fill('[name="authorized_zip"]', '28202');
await page.fill('[name="authorized_phone"]', '704-555-0157');
await page.fill('[name="authorized_email"]', 'rwilson@email.com');
// Authorization scope
await page.check('[name="purchase_securities"]');
await page.check('[name="redeem_securities"]');
await page.check('[name="reinvest_securities"]');
await page.check('[name="change_registration"]');
await page.check('[name="view_account_information"]');
await page.check('[name="update_banking_information"]');
// Securities types covered
await page.check('[name="savings_bonds"]');
await page.check('[name="treasury_bills"]');
await page.check('[name="treasury_notes"]');
await page.check('[name="treasury_bonds"]');
await page.check('[name="tips"]');
// Transaction limits (if applicable)
await page.check('[name="set_transaction_limits"]');
await page.fill('[name="single_transaction_limit"]', '50000');
await page.fill('[name="monthly_limit"]', '200000');
await page.fill('[name="annual_limit"]', '1000000');
// Effective dates
await page.fill('[name="authorization_start_date"]', '03/01/2025');
await page.selectOption('[name="authorization_duration"]', 'indefinite');
// Special conditions or restrictions
await page.fill('[name="special_instructions"]', 'Authorization valid for all routine transactions. Redemptions over $100,000 require phone confirmation with primary account holder.');
// Secondary authorized person (if applicable)
await page.check('[name="add_secondary_authorized"]');
await page.fill('[name="secondary_name"]', 'Jennifer Marie Wilson');
await page.fill('[name="secondary_ssn"]', '234-56-7890');
await page.fill('[name="secondary_relationship"]', 'Daughter');
await page.selectOption('[name="secondary_authority_level"]', 'view_only');
// Notification preferences
await page.check('[name="notify_primary_on_transactions"]');
await page.check('[name="email_confirmations"]');
await page.check('[name="monthly_statements"]');
// Banking information for authorized transactions
await page.fill('[name="linked_bank_name"]', 'Bank of America');
await page.fill('[name="routing_number"]', '053000196');
await page.fill('[name="account_number"]', '123456789012');
await page.selectOption('[name="account_type"]', 'checking');
// Security questions for authorized person
await page.fill('[name="security_question_1"]', 'What is your mother\'s maiden name?');
await page.fill('[name="security_answer_1"]', process.env.SECURITY_ANSWER_1);
await page.fill('[name="security_question_2"]', 'What city were you born in?');
await page.fill('[name="security_answer_2"]', process.env.SECURITY_ANSWER_2);
// Identity verification documents
await page.click('[data-testid="upload-id-primary"]');
await page.setInputFiles('[name="primary_identification"]', './documents/primary_drivers_license.pdf');
await page.click('[data-testid="upload-id-authorized"]');
await page.setInputFiles('[name="authorized_identification"]', './documents/authorized_drivers_license.pdf');
await page.click('[data-testid="upload-proof-relationship"]');
await page.setInputFiles('[name="relationship_proof"]', './documents/marriage_certificate.pdf');
// Medallion signature guarantee (if required)
await page.check('[name="medallion_guarantee_required"]');
await page.fill('[name="medallion_institution"]', 'Wells Fargo Bank');
await page.fill('[name="medallion_stamp_number"]', 'MSG-2025-456789');
await page.fill('[name="medallion_date"]', '02/20/2025');
// Account holder certification
await page.check('[name="certify_accuracy"]');
await page.check('[name="certify_authority"]');
await page.check('[name="authorize_treasury_verification"]');
await page.check('[name="acknowledge_liability"]');
await page.check('[name="understand_revocation_rights"]');
// Account holder signature
await page.fill('[name="account_holder_signature"]', 'Margaret Elizabeth Wilson');
await page.fill('[name="signature_date"]', '02/20/2025');
// Authorized person acceptance
await page.check('[name="authorized_accepts_responsibility"]');
await page.check('[name="authorized_agrees_to_terms"]');
await page.fill('[name="authorized_signature"]', 'Robert James Wilson');
await page.fill('[name="authorized_signature_date"]', '02/20/2025');
// Witness information (if required)
await page.fill('[name="witness_name"]', 'Sarah Financial Advisor');
await page.fill('[name="witness_title"]', 'Certified Financial Planner');
await page.fill('[name="witness_signature"]', 'Sarah Financial Advisor');
await page.fill('[name="witness_date"]', '02/20/2025');
await page.click('[data-testid="submit-authorization"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles identity verification, authorization scope validation, and TreasuryDirect submission processes automatically. You can automate account delegation, authority modifications, and revocation workflows.
## Scale your FS Form 5444 automation with Anchor Browser
Run your Playwright TreasuryDirect automations on cloud browsers with enterprise-grade reliability and persistent securities account sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# FSA Form 578
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/fsa-578
Automate USDA farm commodity storage report workflows with Playwright when APIs aren't available.
# How to Automate FSA Form 578 with Playwright
Automate USDA Farm Service Agency commodity storage report workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual inventory reporting and reduce compliance errors by automating repetitive grain storage documentation processes. Use Playwright to interact with FSA systems programmatically.
[View USDA FSA developer resources](https://www.fsa.usda.gov/help) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [FSA Form 578](https://www.fsa.usda.gov/documents/fsa-578) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to FSA farmers.gov system
await page.goto('https://forms.sc.egov.usda.gov/eForms/welcomeAction.do?Home');
// Start new FSA-578 report
await page.click('[data-testid="commodity-reports"]');
await page.click('[data-testid="form-578"]');
await page.selectOption('[name="report_type"]', 'stored_commodities');
// Producer information
await page.fill('[name="producer_name"]', 'Heartland Grain Farms LLC');
await page.fill('[name="farm_number"]', 'IA-089-1234');
await page.fill('[name="tract_number"]', '5678');
await page.fill('[name="federal_ein"]', '42-1234567');
// Contact information
await page.fill('[name="address"]', '4500 County Road 120');
await page.fill('[name="city"]', 'Cedar Rapids');
await page.selectOption('[name="state"]', 'IA');
await page.fill('[name="zip"]', '52404');
await page.fill('[name="phone"]', '319-555-0174');
await page.fill('[name="email"]', 'operations@heartlandgrain.com');
// County FSA office
await page.selectOption('[name="county"]', 'linn');
await page.fill('[name="fsa_office_code"]', 'IA-057');
// Storage facility information
await page.fill('[name="facility_name"]', 'Heartland Main Storage Complex');
await page.fill('[name="facility_address"]', '4500 County Road 120');
await page.fill('[name="facility_city"]', 'Cedar Rapids');
await page.selectOption('[name="facility_state"]', 'IA');
await page.fill('[name="facility_zip"]', '52404');
// Facility type and capacity
await page.selectOption('[name="facility_type"]', 'on_farm_storage');
await page.fill('[name="total_storage_capacity_bushels"]', '150000');
await page.fill('[name="number_of_bins"]', '6');
await page.check('[name="climate_controlled"]');
await page.check('[name="fumigation_capable"]');
// Report period
await page.fill('[name="report_date"]', '02/28/2025');
await page.selectOption('[name="crop_year"]', '2024');
await page.fill('[name="reporting_period_start"]', '12/01/2024');
await page.fill('[name="reporting_period_end"]', '02/28/2025');
// Commodity 1: Corn
await page.click('[data-testid="add-commodity"]');
await page.selectOption('[name="commodity_type_1"]', 'corn');
await page.fill('[name="commodity_grade_1"]', 'US No. 2 Yellow');
await page.fill('[name="quantity_bushels_1"]', '85000');
await page.fill('[name="bin_location_1"]', 'Bins 1, 2, 3');
await page.fill('[name="storage_date_1"]', '10/15/2024');
await page.selectOption('[name="ownership_1"]', 'producer_owned');
await page.fill('[name="ccc_loan_number_1"]', 'CCC-2024-IA-789456');
// Corn quality information
await page.fill('[name="moisture_content_1"]', '14.5');
await page.fill('[name="test_weight_1"]', '56.2');
await page.fill('[name="damaged_kernels_1"]', '2.1');
await page.fill('[name="foreign_material_1"]', '0.8');
// Commodity 2: Soybeans
await page.click('[data-testid="add-commodity"]');
await page.selectOption('[name="commodity_type_2"]', 'soybeans');
await page.fill('[name="commodity_grade_2"]', 'US No. 1');
await page.fill('[name="quantity_bushels_2"]', '45000');
await page.fill('[name="bin_location_2"]', 'Bins 4, 5');
await page.fill('[name="storage_date_2"]', '11/05/2024');
await page.selectOption('[name="ownership_2"]', 'producer_owned');
await page.fill('[name="ccc_loan_number_2"]', 'CCC-2024-IA-789457');
// Soybeans quality information
await page.fill('[name="moisture_content_2"]', '13.0');
await page.fill('[name="test_weight_2"]', '57.8');
await page.fill('[name="damaged_kernels_2"]', '1.5');
await page.fill('[name="foreign_material_2"]', '0.5');
// Commodity 3: Wheat
await page.click('[data-testid="add-commodity"]');
await page.selectOption('[name="commodity_type_3"]', 'wheat');
await page.selectOption('[name="wheat_class_3"]', 'hard_red_winter');
await page.fill('[name="commodity_grade_3"]', 'US No. 2');
await page.fill('[name="quantity_bushels_3"]', '12000');
await page.fill('[name="bin_location_3"]', 'Bin 6');
await page.fill('[name="storage_date_3"]', '07/20/2024');
await page.selectOption('[name="ownership_3"]', 'producer_owned');
// Wheat quality information
await page.fill('[name="moisture_content_3"]', '12.5');
await page.fill('[name="test_weight_3"]', '60.1');
await page.fill('[name="protein_content_3"]', '11.8');
// Total inventory summary
await page.fill('[name="total_bushels_all_commodities"]', '142000');
await page.fill('[name="storage_utilization_percentage"]', '94.7');
// Storage agreements and liens
await page.check('[name="warehouse_receipt_issued"]');
await page.fill('[name="warehouse_receipt_number"]', 'WHR-2024-456789');
await page.check('[name="commodity_under_lien"]');
await page.fill('[name="lienholder_name"]', 'AgriBank FCB');
await page.fill('[name="lien_amount"]', '850000');
// Marketing and disposition
await page.fill('[name="quantity_sold_period"]', '8000');
await page.fill('[name="quantity_removed_period"]', '0');
await page.fill('[name="quantity_damaged_period"]', '150');
await page.fill('[name="damage_cause"]', 'Minor moisture damage in Bin 4 - repaired and dried');
// Insurance coverage
await page.check('[name="crop_insurance_coverage"]');
await page.fill('[name="insurance_provider"]', 'Rain and Hail Insurance');
await page.fill('[name="policy_number"]', 'RH-2024-567890');
await page.fill('[name="coverage_amount"]', '1200000');
// Facility maintenance and inspection
await page.fill('[name="last_inspection_date"]', '01/15/2025');
await page.fill('[name="inspector_name"]', 'County FSA Inspector Johnson');
await page.check('[name="facility_good_condition"]');
await page.fill('[name="maintenance_notes"]', 'All bins inspected and in excellent condition. No structural issues. Ventilation systems operational.');
// Previous losses or damage
await page.selectOption('[name="losses_in_past_year"]', 'yes');
await page.fill('[name="loss_description"]', 'Minor moisture damage in October 2024 affecting 150 bushels. Grain removed and sold. Bin repaired.');
await page.fill('[name="loss_amount_bushels"]', '150');
// Supporting documentation
await page.click('[data-testid="upload-bin-measurements"]');
await page.setInputFiles('[name="bin_capacity_docs"]', './documents/bin_capacity_certifications.pdf');
await page.click('[data-testid="upload-scale-tickets"]');
await page.setInputFiles('[name="scale_tickets"]', './documents/harvest_scale_tickets.pdf');
await page.click('[data-testid="upload-quality-reports"]');
await page.setInputFiles('[name="grain_quality_tests"]', './documents/grain_test_results.pdf');
// Producer certification
await page.check('[name="certify_accuracy"]');
await page.check('[name="certify_ownership"]');
await page.check('[name="certify_quantity"]');
await page.check('[name="acknowledge_penalties"]');
await page.check('[name="agree_to_inspection"]');
// Signature
await page.fill('[name="producer_signature"]', 'William Heartland Owner');
await page.fill('[name="producer_title"]', 'Managing Member');
await page.fill('[name="signature_date"]', '02/28/2025');
// County office verification (if applicable)
await page.fill('[name="fsa_reviewer_name"]', 'Janet County Director');
await page.fill('[name="fsa_reviewer_title"]', 'County Executive Director');
await page.fill('[name="fsa_review_date"]', '03/01/2025');
await page.click('[data-testid="submit-report"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles quantity calculations, quality verification, and FSA submission processes automatically. You can automate monthly reports, loan compliance documentation, and inventory tracking workflows.
## Scale your FSA Form 578 automation with Anchor Browser
Run your Playwright FSA automations on cloud browsers with enterprise-grade reliability and persistent farm program sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# IRS Form 8300
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/irs-8300
Automate IRS Form 8300 cash payment reporting workflows with Playwright when APIs aren't available.
# How to Automate IRS Form 8300 with Playwright
Automate critical IRS Form 8300 cash payment reporting workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual compliance reporting and reduce tax violation risks by automating repetitive large cash transaction declarations. Use Playwright to interact with IRS e-file systems programmatically.
[View IRS developer resources](https://www.irs.gov/e-file-providers/modernized-e-file-overview) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [IRS Form 8300](https://www.irs.gov/pub/irs-pdf/f8300.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to IRS e-file system
await page.goto('https://bsaefiling.fincen.gov/');
await page.fill('[data-testid="username"]', process.env.IRS_USERNAME);
await page.fill('[data-testid="password"]', process.env.IRS_PASSWORD);
await page.click('[data-testid="login-button"]');
// Start new Form 8300 filing
await page.click('[data-testid="new-form-8300"]');
await page.selectOption('[name="filing_reason"]', 'single_transaction');
// Business information
await page.fill('[name="business_name"]', 'Premier Auto Sales LLC');
await page.fill('[name="business_address"]', '789 Main Street');
await page.fill('[name="business_city"]', 'Phoenix');
await page.selectOption('[name="business_state"]', 'AZ');
await page.fill('[name="business_zip"]', '85001');
await page.fill('[name="business_ein"]', '12-3456789');
// Transaction details
await page.fill('[name="transaction_date"]', '12/10/2024');
await page.fill('[name="cash_amount']', '15000.00');
await page.selectOption('[name="transaction_type"]', 'sale_of_goods');
await page.fill('[name="transaction_description']', '2019 BMW X5 vehicle sale');
// Person making payment
await page.fill('[name="payer_first_name"]', 'Michael');
await page.fill('[name="payer_last_name"]', 'Rodriguez');
await page.fill('[name="payer_address']', '456 Oak Avenue');
await page.fill('[name="payer_city"]', 'Scottsdale');
await page.selectOption('[name="payer_state"]', 'AZ');
await page.fill('[name="payer_zip"]', '85260');
await page.fill('[name="payer_ssn"]', '123-45-6789');
await page.fill('[name="payer_date_of_birth"]', '03/15/1978');
// Payment method details
await page.selectOption('[name="payment_method"]', 'cash');
await page.fill('[name="denominations_100']', '150'); // $100 bills count
await page.fill('[name="foreign_currency_amount']', '0');
// Verification of identity
await page.selectOption('[name="id_type"]', 'drivers_license');
await page.fill('[name="id_number"]', 'D12345678');
await page.selectOption('[name="id_state']', 'AZ');
// Submit report
await page.check('[name="certify_accuracy"]');
await page.fill('[name="preparer_name"]', 'Sarah Financial Controller');
await page.fill('[name="preparer_title"]', 'Controller');
await page.click('[data-testid="submit-form-8300"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles transaction validation, amount calculations, and IRS submission processes automatically. You can automate bulk filings, compliance tracking, and suspicious activity reporting workflows.
## Scale your IRS Form 8300 automation with Anchor Browser
Run your Playwright IRS automations on cloud browsers with enterprise-grade reliability and persistent tax compliance sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# IRS Form W-7
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/irs-w7
Automate ITIN application workflows with Playwright when APIs aren't available.
# How to Automate IRS Form W-7 with Playwright
Automate IRS Individual Taxpayer Identification Number (ITIN) application workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual tax identification processing and reduce approval delays by automating repetitive ITIN application processes. Use Playwright to interact with IRS systems programmatically.
[View IRS developer resources](https://www.irs.gov/e-file-providers/modernized-e-file-program-information) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [IRS Form W-7](https://www.irs.gov/pub/irs-pdf/fw7.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to IRS online system
await page.goto('https://www.irs.gov/forms-instructions);
// Start new W-7 application
await page.click('[data-testid="new-application"]');
await page.selectOption('[name="form_type"]', 'w7');
// Reason for applying
await page.selectOption('[name="reason_for_itin"]', 'tax_return_filing');
await page.check('[name="attach_federal_return"]');
await page.selectOption('[name="tax_treaty_exception"]', 'no');
// Applicant information
await page.fill('[name="legal_name_first"]', 'Carlos');
await page.fill('[name="legal_name_middle"]', 'Alberto');
await page.fill('[name="legal_name_last"]', 'Mendoza');
// Name at birth (if different)
await page.selectOption('[name="name_changed"]', 'no');
// Date of birth and place
await page.fill('[name="date_of_birth"]', '05/22/1985');
await page.fill('[name="country_of_birth"]', 'Mexico');
await page.fill('[name="state_province_birth"]', 'Jalisco');
await page.fill('[name="city_birth"]', 'Guadalajara');
// Gender
await page.selectOption('[name="gender"]', 'male');
// Mailing address - foreign
await page.selectOption('[name="address_type"]', 'foreign');
await page.fill('[name="foreign_address_line_1"]', 'Calle Reforma 456');
await page.fill('[name="foreign_address_line_2"]', 'Colonia Centro');
await page.fill('[name="foreign_city"]', 'Guadalajara');
await page.fill('[name="foreign_state_province"]', 'Jalisco');
await page.fill('[name="foreign_postal_code"]', '44100');
await page.selectOption('[name="foreign_country"]', 'Mexico');
// US address (if applicable)
await page.check('[name="has_us_address"]');
await page.fill('[name="us_address']', '789 Temporary Street, Apt 3C');
await page.fill('[name="us_city"]', 'Los Angeles');
await page.selectOption('[name="us_state"]', 'CA');
await page.fill('[name="us_zip"]', '90012');
// Contact information
await page.fill('[name="phone_foreign"]', '+52-33-1234-5678');
await page.fill('[name="phone_us"]', '213-555-0145');
await page.fill('[name="email"]', 'cmendoza@email.com');
// Country of citizenship
await page.selectOption('[name="country_citizenship"]', 'Mexico');
// Foreign tax ID (if applicable)
await page.check('[name="has_foreign_tax_id"]');
await page.fill('[name="foreign_tax_id"]', 'MEMC850522HJ8');
await page.selectOption('[name="foreign_tax_country"]', 'Mexico');
// Visa information
await page.selectOption('[name="visa_type"]', 'h1b');
await page.fill('[name="visa_number"]', 'H1B-2024-123456');
await page.fill('[name="visa_expiration"]', '12/31/2026');
// Entry date to US
await page.fill('[name="us_entry_date"]', '01/15/2024');
// Passport information
await page.fill('[name="passport_number"]', 'G12345678');
await page.selectOption('[name="passport_country"]', 'Mexico');
await page.fill('[name="passport_issue_date"]', '03/10/2019');
await page.fill('[name="passport_expiration']', '03/10/2029');
// Family information
await page.selectOption('[name="marital_status"]', 'married');
await page.fill('[name="spouse_name"]', 'Maria Elena Mendoza');
await page.fill('[name="spouse_ssn_itin"]', 'Not applicable');
// Dependent information (if applicable)
await page.click('[data-testid="add-dependent"]');
await page.fill('[name="dependent_first_name"]', 'Sofia');
await page.fill('[name="dependent_middle_name"]', 'Isabel');
await page.fill('[name="dependent_last_name"]', 'Mendoza');
await page.fill('[name="dependent_dob"]', '08/12/2015');
await page.selectOption('[name="dependent_country_birth"]', 'Mexico');
await page.selectOption('[name="dependent_relationship"]', 'daughter');
// Previous ITIN applications
await page.selectOption('[name="previously_applied"]', 'no');
// Previous SSN applications
await page.selectOption('[name="previously_applied_ssn"]', 'no');
// Tax return information
await page.fill('[name="tax_year"]', '2024');
await page.selectOption('[name="filing_status"]', 'married_filing_jointly');
await page.check('[name="claiming_dependents"]');
await page.fill('[name="number_of_dependents"]', '1');
// Income information
await page.fill('[name="us_source_income"]', 'yes');
await page.fill('[name="employer_name"]', 'Tech Innovations Inc');
await page.fill('[name="employer_ein"]', '12-3456789');
await page.fill('[name="employer_address"]', '500 Silicon Valley Drive');
await page.fill('[name="employer_city"]', 'San Jose');
await page.selectOption('[name="employer_state"]', 'CA');
await page.fill('[name="employer_zip"]', '95110');
// Tax treaty benefits (if applicable)
await page.selectOption('[name="claim_treaty_benefits"]', 'no');
// Acceptance agent information (if used)
await page.selectOption('[name="using_acceptance_agent"]', 'yes');
await page.fill('[name="agent_name"]', 'Global Tax Services LLC');
await page.fill('[name="agent_ein"]', '98-7654321');
await page.fill('[name="agent_address"]', '1200 Financial Plaza, Suite 300');
await page.fill('[name="agent_city"]', 'Los Angeles');
await page.selectOption('[name="agent_state"]', 'CA');
await page.fill('[name="agent_zip"]', '90071');
await page.fill('[name="agent_phone"]', '213-555-0190');
// Agent certification
await page.fill('[name="agent_representative"]', 'Patricia Tax Professional');
await page.fill('[name="agent_caf_number"]', 'CAF-123456');
// Supporting documentation checklist
await page.check('[name="doc_passport"]');
await page.check('[name="doc_birth_certificate"]');
await page.check('[name="doc_visa']');
await page.check('[name="doc_employment_letter"]');
await page.check('[name="doc_tax_return"]');
// Document authentication
await page.selectOption('[name="documents_certified"]', 'acceptance_agent');
await page.fill('[name="certification_date"]', '03/05/2025');
// Upload supporting documents
await page.click('[data-testid="upload-passport"]');
await page.setInputFiles('[name="passport_copy"]', './documents/passport_certified_copy.pdf');
await page.click('[data-testid="upload-birth-certificate"]');
await page.setInputFiles('[name="birth_certificate"]', './documents/birth_certificate_certified.pdf');
await page.click('[data-testid="upload-visa"]');
await page.setInputFiles('[name="visa_document"]', './documents/h1b_visa_copy.pdf');
await page.click('[data-testid="upload-tax-return"]');
await page.setInputFiles('[name="tax_return_copy"]', './documents/2024_form_1040.pdf');
// Signature under penalty of perjury
await page.check('[name="certify_true_correct"]');
await page.check('[name="understand_penalties"]');
await page.check('[name="authorize_disclosure"]');
// Applicant signature
await page.fill('[name="applicant_signature"]', 'Carlos Alberto Mendoza');
await page.fill('[name="signature_date"]', '03/05/2025');
// Delegate signature (if applicable)
await page.fill('[name="delegate_signature"]', 'Patricia Tax Professional');
await page.fill('[name="delegate_pin"]', 'CAF-123456');
await page.fill('[name="delegate_date"]', '03/05/2025');
// Acceptance agent signature
await page.fill('[name="agent_signature"]', 'Patricia Tax Professional');
await page.fill('[name="agent_title"]', 'Certified Acceptance Agent');
await page.fill('[name="agent_signature_date"]', '03/05/2025');
// Application submission details
await page.selectOption('[name="submission_method"]', 'acceptance_agent');
await page.fill('[name="submission_date"]', '03/05/2025');
// Mailing address for ITIN
await page.selectOption('[name="send_itin_to"]', 'us_address');
// Special handling instructions
await page.fill('[name="special_instructions"]', 'Expedited processing requested due to pending tax return deadline. Original documents authenticated by CAA.');
await page.click('[data-testid="submit-application"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles document verification, identity validation, and IRS submission processes automatically. You can automate ITIN applications, renewal requests, and dependent ITIN workflows.
## Scale your IRS Form W-7 automation with Anchor Browser
Run your Playwright IRS automations on cloud browsers with enterprise-grade reliability and persistent tax system sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# OWCP Form 915
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/owcp-915
Automate federal workers' compensation claim workflows with Playwright when APIs aren't available.
# How to Automate OWCP Form 915 with Playwright
Automate Department of Labor Office of Workers' Compensation Programs claim submission workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual injury claim processing and reduce approval delays by automating repetitive federal workers' compensation documentation processes. Use Playwright to interact with OWCP systems programmatically.
[View DOL OWCP developer resources](https://www.dol.gov/agencies/owcp) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [OWCP Form 915](https://www.dol.gov/sites/dolgov/files/owcp/dfec/regs/compliance/owcp-915.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to OWCP system
await page.goto('https://www.dol.gov/agencies/owcp/FECA/regs/compliance/forms');
// Start new OWCP-915 form
await page.click('[data-testid="new-claim"]');
await page.selectOption('[name="form_type"]', 'owcp_915');
await page.selectOption('[name="claim_type"]', 'medical_benefits');
// Employee information
await page.fill('[name="employee_last_name"]', 'Anderson');
await page.fill('[name="employee_first_name"]', 'Robert');
await page.fill('[name="employee_middle_name"]', 'James');
await page.fill('[name="ssn"]', '123-45-6789');
await page.fill('[name="date_of_birth"]', '04/18/1980');
// Contact information
await page.fill('[name="address"]', '345 Federal Plaza, Apt 7B');
await page.fill('[name="city"]', 'Washington');
await page.selectOption('[name="state"]', 'DC');
await page.fill('[name="zip"]', '20001');
await page.fill('[name="phone_home"]', '202-555-0167');
await page.fill('[name="phone_cell"]', '202-555-0168');
await page.fill('[name="email"]', 'randerson@email.com');
// Employment information
await page.fill('[name="agency_name"]', 'Department of Commerce');
await page.fill('[name="agency_code"]', 'DOC-1300');
await page.fill('[name="employing_office"]', 'Bureau of Economic Analysis');
await page.fill('[name="job_title"]', 'Economic Analyst');
await page.fill('[name="occupation_code"]', 'GS-0110-12');
await page.fill('[name="pay_grade"]', 'GS-12');
await page.fill('[name="step"]', '5');
// Duty station
await page.fill('[name="duty_station_address"]', '4600 Silver Hill Road');
await page.fill('[name="duty_station_city"]', 'Suitland');
await page.selectOption('[name="duty_station_state"]', 'MD');
await page.fill('[name="duty_station_zip"]', '20746');
// Supervisor information
await page.fill('[name="supervisor_name"]', 'Margaret Division Chief');
await page.fill('[name="supervisor_title"]', 'Division Chief');
await page.fill('[name="supervisor_phone"]', '301-555-0145');
await page.fill('[name="supervisor_email"]', 'mdivisionchief@commerce.gov');
// Injury or illness information
await page.fill('[name="injury_date"]', '02/15/2025');
await page.fill('[name="injury_time"]', '10:30 AM');
await page.selectOption('[name="injury_type"]', 'traumatic_injury');
await page.fill('[name="date_disability_began"]', '02/15/2025');
// Location of injury
await page.selectOption('[name="injury_location"]', 'duty_station');
await page.fill('[name="injury_specific_location"]', 'Third floor office, Room 315');
// Nature of injury
await page.selectOption('[name="injury_category"]', 'strain_sprain');
await page.selectOption('[name="body_part"]', 'lower_back');
await page.fill('[name="injury_description"]', 'Lower back strain while lifting heavy box of documents from floor to desk. Immediate sharp pain in lumbar region.');
// How injury occurred
await page.fill('[name="injury_circumstances"]', 'Employee was retrieving archived files from storage boxes. Lifted approximately 40-pound box using improper technique. Felt immediate pain and muscle spasm in lower back. Unable to continue work duties.');
// Witnesses
await page.click('[data-testid="add-witness"]');
await page.fill('[name="witness_name_1"]', 'David Colleague');
await page.fill('[name="witness_phone_1"]', '301-555-0178');
await page.fill('[name="witness_email_1"]', 'dcolleague@commerce.gov');
// Medical treatment information
await page.selectOption('[name="medical_treatment_received"]', 'yes');
await page.fill('[name="first_treatment_date"]', '02/15/2025');
await page.selectOption('[name="treatment_type"]', 'emergency_room');
// Medical facility information
await page.fill('[name="facility_name"]', 'Prince George\'s Hospital Center');
await page.fill('[name="facility_address"]', '3001 Hospital Drive');
await page.fill('[name="facility_city"]', 'Cheverly');
await page.selectOption('[name="facility_state"]', 'MD');
await page.fill('[name="facility_zip"]', '20785');
await page.fill('[name="facility_phone"]', '301-555-0200');
// Attending physician
await page.fill('[name="physician_name"]', 'Dr. Sarah Emergency Physician');
await page.fill('[name="physician_specialty"]', 'Emergency Medicine');
await page.fill('[name="physician_phone"]', '301-555-0201');
// Diagnosis and treatment
await page.fill('[name="diagnosis"]', 'Acute lumbar strain, L4-L5 region');
await page.fill('[name="treatment_provided"]', 'Physical examination, X-rays, pain medication, muscle relaxants, ice therapy, ergonomic counseling');
// Work status
await page.selectOption('[name="return_to_work_status"]', 'limited_duty');
await page.fill('[name="work_restrictions']', 'No lifting over 10 pounds, no bending or twisting, frequent position changes, ergonomic chair required');
await page.fill('[name="estimated_return_date"]', '03/15/2025');
// Time loss information
await page.selectOption('[name="time_lost"]', 'yes');
await page.fill('[name="first_day_missed"]', '02/16/2025');
await page.fill('[name="total_days_lost"]', '5');
await page.fill('[name="work_hours_per_day"]', '8');
// Continuation of pay (COP) election
await page.check('[name="elect_cop"]');
await page.fill('[name="cop_start_date"]', '02/16/2025');
await page.fill('[name="cop_days_requested"]', '45');
// Leave usage
await page.check('[name="used_leave"]');
await page.selectOption('[name="leave_type"]', 'sick_leave');
await page.fill('[name="leave_hours"]', '40');
await page.fill('[name="leave_dates"]', '02/16/2025 - 02/20/2025');
// Claim for compensation
await page.selectOption('[name="claim_type_detail"]', 'medical_expenses');
await page.check('[name="claim_wage_loss"]');
await page.check('[name="claim_schedule_award"]');
// Medical expenses claimed
await page.fill('[name="emergency_room_cost"]', '850');
await page.fill('[name="physician_fees"]', '350');
await page.fill('[name="xray_cost"]', '275');
await page.fill('[name="medication_cost"]', '125');
await page.fill('[name="total_medical_expenses"]', '1600');
// Previous injuries or conditions
await page.selectOption('[name="prior_back_injury"]', 'no');
await page.selectOption('[name="preexisting_condition"]', 'no');
// Third party liability
await page.selectOption('[name="third_party_liability"]', 'no');
// Safety equipment
await page.selectOption('[name="safety_equipment_available"]', 'not_applicable');
// Accident investigation
await page.check('[name="supervisor_notified"]');
await page.fill('[name="notification_date"]', '02/15/2025');
await page.fill('[name="notification_time"]', '10:45 AM');
await page.check('[name="incident_report_filed"]');
await page.fill('[name="incident_report_number"]', 'IR-2025-0234');
// Supporting documentation
await page.click('[data-testid="upload-medical-report"]');
await page.setInputFiles('[name="medical_documentation"]', './documents/er_report.pdf');
await page.click('[data-testid="upload-xray"]');
await page.setInputFiles('[name="diagnostic_imaging"]', './documents/lumbar_xray_report.pdf');
await page.click('[data-testid="upload-receipts"]');
await page.setInputFiles('[name="expense_receipts"]', './documents/medical_receipts.pdf');
await page.click('[data-testid="upload-incident-report"]');
await page.setInputFiles('[name="incident_documentation"]', './documents/supervisor_incident_report.pdf');
// Employee statement
await page.fill('[name="employee_statement"]', 'I was performing routine work duties retrieving archived files when injury occurred. I have consistently followed all safety protocols. The injury was purely accidental and occurred in the normal course of my federal employment.');
// Employee certification
await page.check('[name="certify_accuracy"]');
await page.check('[name="certify_work_related"]');
await page.check('[name="understand_penalties"]');
await page.check('[name="authorize_medical_disclosure"]');
// Employee signature
await page.fill('[name="employee_signature"]', 'Robert James Anderson');
await page.fill('[name="employee_signature_date"]', '02/20/2025');
// Supervisor section
await page.selectOption('[name="supervisor_agrees"]', 'agree');
await page.fill('[name="supervisor_comments"]', 'Employee injury confirmed. Witnessed by coworker. Employee followed reporting procedures. Limited duty assignment available upon medical clearance.');
// Supervisor verification
await page.check('[name="injury_occurred_on_duty"]');
await page.check('[name="employee_good_standing"]');
await page.fill('[name="supervisor_signature"]', 'Margaret Division Chief');
await page.fill('[name="supervisor_signature_date"]', '02/21/2025');
// Agency action
await page.selectOption('[name="cop_approved"]', 'yes');
await page.fill('[name="cop_approval_date"]', '02/21/2025');
await page.fill('[name="agency_case_number"]', 'DOC-WC-2025-0456');
// Personnel office contact
await page.fill('[name="hr_contact_name"]', 'Patricia Personnel Specialist');
await page.fill('[name="hr_contact_phone"]', '301-555-0150');
await page.fill('[name="hr_contact_email"]', 'hr.benefits@commerce.gov');
await page.click('[data-testid="submit-claim"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles injury documentation, medical verification, and OWCP submission processes automatically. You can automate claim filings, status tracking, and medical reimbursement workflows.
## Scale your OWCP Form 915 automation with Anchor Browser
Run your Playwright OWCP automations on cloud browsers with enterprise-grade reliability and persistent workers' compensation system sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# USCIS Form I-9
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/ucis-i9
Automate employment eligibility verification workflows with Playwright when APIs aren't available.
# How to Automate USCIS Form I-9 with Playwright
Automate USCIS employment eligibility verification workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual onboarding documentation and reduce compliance errors by automating repetitive employee verification processes. Use Playwright to interact with E-Verify and USCIS systems programmatically.
[View USCIS developer resources](https://www.uscis.gov/tools) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [USCIS Form I-9](https://www.uscis.gov/sites/default/files/document/forms/i-9.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to E-Verify system
await page.goto('https://www.e-verify.gov/');
await page.fill('[data-testid="username"]', process.env.EVERIFY_USERNAME);
await page.fill('[data-testid="password"]', process.env.EVERIFY_PASSWORD);
await page.click('[data-testid="login-button"]');
// Start new I-9 form
await page.click('[data-testid="new-case"]');
await page.click('[data-testid="form-i9"]');
await page.selectOption('[name="form_version"]', '11_21_2023');
// Employer information
await page.fill('[name="employer_name"]', 'TechVentures Solutions Inc');
await page.fill('[name="employer_ein"]', '12-3456789');
await page.fill('[name="employer_address"]', '2800 Corporate Drive, Suite 500');
await page.fill('[name="employer_city"]', 'San Jose');
await page.selectOption('[name="employer_state"]', 'CA');
await page.fill('[name="employer_zip"]', '95134');
// Section 1: Employee Information and Attestation
// Employee personal information
await page.fill('[name="last_name"]', 'Rodriguez');
await page.fill('[name="first_name"]', 'Maria');
await page.fill('[name="middle_initial"]', 'C');
await page.fill('[name="other_last_names"]', 'Garcia');
// Address
await page.fill('[name="address"]', '456 Apartment Street, Unit 12B');
await page.fill('[name="city"]', 'San Jose');
await page.selectOption('[name="state"]', 'CA');
await page.fill('[name="zip"]', '95110');
// Date of birth and contact
await page.fill('[name="date_of_birth"]', '07/15/1992');
await page.fill('[name="ssn"]', '123-45-6789');
await page.fill('[name="email"]', 'maria.rodriguez@email.com');
await page.fill('[name="phone"]', '408-555-0189');
// Citizenship/immigration status
await page.selectOption('[name="citizenship_status"]', 'us_citizen');
// Employee attestation
await page.check('[name="employee_aware_penalties"]');
await page.fill('[name="employee_signature"]', 'Maria C Rodriguez');
await page.fill('[name="employee_signature_date"]', '03/01/2025');
// Preparer/translator (if applicable)
await page.selectOption('[name="preparer_used"]', 'no');
// Section 2: Employer Review and Verification
// Document verification - List A (identity and employment authorization)
await page.selectOption('[name="document_list"]', 'list_a');
await page.selectOption('[name="list_a_document"]', 'us_passport');
await page.fill('[name="document_title"]', 'U.S. Passport');
await page.fill('[name="issuing_authority"]', 'U.S. Department of State');
await page.fill('[name="document_number"]', '123456789');
await page.fill('[name="expiration_date"]', '06/15/2030');
// Alternative: List B and List C documents
// Uncomment if using List B + List C instead of List A
/*
await page.selectOption('[name="document_list"]', 'list_b_and_c');
// List B - Identity document
await page.selectOption('[name="list_b_document"]', 'drivers_license');
await page.fill('[name="list_b_document_title"]', 'Driver\'s License');
await page.fill('[name="list_b_issuing_authority"]', 'California DMV');
await page.fill('[name="list_b_document_number"]', 'D1234567');
await page.fill('[name="list_b_expiration"]', '07/15/2029');
// List C - Employment authorization document
await page.selectOption('[name="list_c_document"]', 'social_security_card');
await page.fill('[name="list_c_document_title"]', 'Social Security Card');
await page.fill('[name="list_c_issuing_authority"]', 'Social Security Administration');
await page.fill('[name="list_c_document_number"]', '123-45-6789');
*/
// Physical examination of documents
await page.check('[name="documents_appear_genuine"]');
await page.check('[name="documents_relate_to_employee"]');
await page.fill('[name="first_day_of_employment"]', '03/15/2025');
// Additional information
await page.fill('[name="employer_business_name"]', 'TechVentures Solutions Inc');
await page.fill('[name="employer_representative_name"]', 'Jennifer HR Manager');
await page.fill('[name="employer_representative_title"]', 'Human Resources Manager');
// Employer certification
await page.check('[name="certify_examination_completed"]');
await page.fill('[name="employer_signature"]', 'Jennifer HR Manager');
await page.fill('[name="employer_signature_date"]', '03/01/2025');
// Section 3: Reverification and Rehires (if applicable)
await page.selectOption('[name="section_3_required"]', 'no');
// E-Verify case creation (if enrolled)
await page.check('[name="create_everify_case"]');
await page.fill('[name="hire_date"]', '03/15/2025');
await page.selectOption('[name="employee_type"]', 'regular_full_time');
// Supporting documentation upload
await page.click('[data-testid="upload-document-front"]');
await page.setInputFiles('[name="document_image_front"]', './documents/passport_photo_page.pdf');
await page.click('[data-testid="upload-document-back"]');
await page.setInputFiles('[name="document_image_back"]', './documents/passport_signature_page.pdf');
// Record retention information
await page.fill('[name="retention_start_date"]', '03/01/2025');
await page.selectOption('[name="storage_location"]', 'secure_digital_system');
await page.fill('[name="retention_period_years"]', '3');
// Remote verification (if applicable)
await page.selectOption('[name="remote_verification"]', 'no');
// Quality assurance review
await page.check('[name="qa_documents_legible"]');
await page.check('[name="qa_dates_consistent"]');
await page.check('[name="qa_sections_complete"]');
await page.check('[name="qa_signatures_present"]');
// Compliance notes
await page.fill('[name="internal_notes"]', 'Employee provided original U.S. passport. Documents examined in person on 3/1/25. All information verified and accurate. E-Verify case will be created upon hire date.');
// Authorized representative information
await page.fill('[name="hr_contact_name"]', 'Jennifer HR Manager');
await page.fill('[name="hr_contact_email"]', 'hr@techventures.com');
await page.fill('[name="hr_contact_phone"]', '408-555-0100');
// Company location for this employee
await page.fill('[name="work_location_address"]', '2800 Corporate Drive, Suite 500');
await page.fill('[name="work_location_city"]', 'San Jose');
await page.selectOption('[name="work_location_state"]', 'CA');
await page.fill('[name="work_location_zip"]', '95134');
// Supervisor information
await page.fill('[name="supervisor_name"]', 'David Engineering Manager');
await page.fill('[name="supervisor_email"]', 'dmanager@techventures.com');
await page.fill('[name="department"]', 'Software Engineering');
// Job title and details
await page.fill('[name="job_title"]', 'Software Engineer II');
await page.fill('[name="employee_id"]', 'EMP-2025-0789');
await page.selectOption('[name="employment_type"]', 'permanent_full_time');
await page.fill('[name="annual_salary"]', '125000');
// Final certification
await page.check('[name="certify_compliance"]');
await page.check('[name="acknowledge_penalties"]');
await page.check('[name="agree_to_retention_requirements"]');
await page.click('[data-testid="submit-i9"]');
// Download completed form
await page.click('[data-testid="download-i9-pdf"]');
await browser.close();
```
Playwright handles document validation, data verification, and USCIS submission processes automatically. You can automate new hire onboarding, reverification workflows, and compliance audits.
## Scale your USCIS Form I-9 automation with Anchor Browser
Run your Playwright USCIS automations on cloud browsers with enterprise-grade reliability and persistent employment verification sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# VA Form 21-526EZ
Source: https://docs.anchorbrowser.io/integrations/open-source/playwright/government/USA/federal/va-21-526ez
Automate VA disability compensation application workflows with Playwright when APIs aren't available.
# How to Automate VA Form 21-526EZ with Playwright
Automate VA disability compensation and related benefits application workflows with Playwright when APIs aren't available or sufficient. You'll eliminate manual claims processing and reduce approval delays by automating repetitive VA disability documentation processes. Use Playwright to interact with VA.gov systems programmatically.
[View VA developer resources](https://developer.va.gov/) for available APIs when applicable.
## Setup
Install Playwright and configure authentication:
```bash theme={null}
npm install playwright
```
## Automate Workflows
Create scripts for common [VA Form 21-526EZ](https://www.vba.va.gov/pubs/forms/VBA-21-526EZ-ARE.pdf) tasks:
```JavaScript theme={null}
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
// Navigate to VA.gov
await page.goto('https://www.va.gov/find-forms/'');
// Start new disability claim
await page.click('[data-testid="start-new-claim"]');
await page.selectOption('[name="claim_type"]', 'original_claim');
// Veteran information
await page.fill('[name="last_name"]', 'Martinez');
await page.fill('[name="first_name"]', 'James');
await page.fill('[name="middle_name"]', 'Michael');
await page.fill('[name="suffix"]', '');
await page.fill('[name="ssn"]', '123-45-6789');
await page.fill('[name="va_file_number"]', 'C-12345678');
// Contact information
await page.fill('[name="date_of_birth"]', '08/15/1985');
await page.selectOption('[name="gender"]', 'male');
// Mailing address
await page.fill('[name="address_line_1"]', '789 Veterans Boulevard');
await page.fill('[name="address_line_2"]', 'Apt 4D');
await page.fill('[name="city"]', 'Jacksonville');
await page.selectOption('[name="state"]', 'FL');
await page.fill('[name="zip"]', '32202');
await page.selectOption('[name="country"]', 'USA');
// Phone numbers
await page.fill('[name="phone_home"]', '904-555-0123');
await page.fill('[name="phone_mobile"]', '904-555-0124');
await page.fill('[name="email"]', 'jmartinez@email.com');
// Contact preferences
await page.check('[name="contact_by_email"]');
await page.check('[name="contact_by_phone"]');
// Service information
await page.selectOption('[name="branch_of_service"]', 'army');
await page.fill('[name="service_number"]', 'US-123456789');
// Service period 1
await page.fill('[name="service_start_date_1"]', '06/15/2003');
await page.fill('[name="service_end_date_1"]', '08/20/2011');
await page.selectOption('[name="separation_type_1"]', 'honorable');
// Service period 2 (if applicable)
await page.click('[data-testid="add-service-period"]');
await page.fill('[name="service_start_date_2"]', '09/01/2011');
await page.fill('[name="service_end_date_2"]', '05/30/2015');
await page.selectOption('[name="separation_type_2"]', 'honorable');
// Reserve/National Guard service
await page.check('[name="reserve_service"]');
await page.fill('[name="reserve_component"]', 'Army National Guard');
await page.fill('[name="unit_name"]', '53rd Infantry Brigade Combat Team');
await page.fill('[name="unit_phone"]', '904-555-0200');
// Combat service
await page.check('[name="served_in_combat"]');
await page.fill('[name="combat_locations"]', 'Iraq (2007-2008), Afghanistan (2010-2011)');
// Prisoner of war
await page.selectOption('[name="pow_status"]', 'no');
// Medals and awards
await page.fill('[name="awards"]', 'Bronze Star, Purple Heart, Combat Infantryman Badge, Army Commendation Medal');
// Disabilities being claimed
// Condition 1: PTSD
await page.click('[data-testid="add-disability"]');
await page.fill('[name="condition_name_1"]', 'Post-Traumatic Stress Disorder (PTSD)');
await page.selectOption('[name="condition_cause_1"]', 'combat');
await page.fill('[name="condition_start_date_1"]', '09/2008');
await page.fill('[name="condition_description_1"]', 'Recurring nightmares, flashbacks to combat situations, anxiety, hypervigilance, difficulty sleeping. Symptoms began during deployment to Iraq and have persisted.');
// Condition 2: Tinnitus
await page.click('[data-testid="add-disability"]');
await page.fill('[name="condition_name_2"]', 'Tinnitus');
await page.selectOption('[name="condition_cause_2"]', 'noise_exposure');
await page.fill('[name="condition_start_date_2"]', '06/2007');
await page.fill('[name="condition_description_2"]', 'Constant ringing in both ears. Began after prolonged exposure to weapons fire and explosions during combat operations.');
// Condition 3: Lower back injury
await page.click('[data-testid="add-disability"]');
await page.fill('[name="condition_name_3"]', 'Chronic Lower Back Pain');
await page.selectOption('[name="condition_cause_3"]', 'injury');
await page.fill('[name="condition_start_date_3"]', '03/2010');
await page.fill('[name="condition_description_3"]', 'Lumbar spine injury from IED blast. Chronic pain, limited range of motion, difficulty standing for extended periods.');
// Condition 4: Knee injury
await page.click('[data-testid="add-disability"]');
await page.fill('[name="condition_name_4"]', 'Right Knee Injury');
await page.selectOption('[name="condition_cause_4"]', 'injury');
await page.fill('[name="condition_start_date_4"]', '03/2010');
await page.fill('[name="condition_description_4"]', 'Right knee damaged in same IED incident. Torn meniscus, chronic pain, instability, arthritis.');
// Treatment history
await page.check('[name="receiving_va_care"]');
await page.fill('[name="va_facility_1"]', 'Malcom Randall VA Medical Center');
await page.fill('[name="va_facility_city_1"]', 'Gainesville');
await page.selectOption('[name="va_facility_state_1"]', 'FL');
await page.fill('[name="va_treatment_dates_1"]', '2015 - Present');
// Private medical treatment
await page.check('[name="private_treatment"]');
await page.fill('[name="private_provider_1"]', 'Dr. Sarah Orthopedic Surgeon');
await page.fill('[name="private_facility_1"]', 'Jacksonville Orthopedic Center');
await page.fill('[name="private_address_1"]', '456 Medical Plaza');
await page.fill('[name="private_city_1"]', 'Jacksonville');
await page.selectOption('[name="private_state_1"]', 'FL');
await page.fill('[name="private_zip_1"]', '32207');
await page.fill('[name="private_treatment_dates_1"]', '2012-2015');
// Mental health treatment
await page.fill('[name="mental_health_provider"]', 'Dr. Michael Psychiatrist');
await page.fill('[name="mental_health_facility"]', 'Veterans Mental Health Clinic');
await page.fill('[name="mental_health_dates"]', '2015 - Present');
// Hospitalizations
await page.check('[name="hospitalizations"]');
await page.fill('[name="hospital_name_1"]', 'Walter Reed Army Medical Center');
await page.fill('[name="hospital_admission_date_1"]', '04/01/2010');
await page.fill('[name="hospital_discharge_date_1"]', '04/15/2010');
await page.fill('[name="hospital_reason_1"]', 'Treatment for injuries sustained in IED explosion');
// Supporting documents
await page.click('[data-testid="upload-dd214"]');
await page.setInputFiles('[name="discharge_papers"]', './documents/dd214.pdf');
await page.click('[data-testid="upload-service-medical"]');
await page.setInputFiles('[name="service_medical_records"]', './documents/service_treatment_records.pdf');
await page.click('[data-testid="upload-private-medical"]');
await page.setInputFiles('[name="private_medical_records"]', './documents/private_treatment_records.pdf');
await page.click('[data-testid="upload-buddy-statements"]');
await page.setInputFiles('[name="buddy_statements"]', './documents/witness_statements.pdf');
// Special circumstances
await page.check('[name="combat_related"]');
await page.check('[name="caused_by_service"]');
// Homelessness
await page.selectOption('[name="homeless_status"]', 'at_risk');
await page.fill('[name="homeless_contact"]', 'Florida Veterans Affairs Office');
await page.fill('[name="homeless_phone"]', '904-555-0300');
// Terminal illness
await page.selectOption('[name="terminal_illness"]', 'no');
// Fully developed claim
await page.check('[name="fdc_election"]');
await page.check('[name="understand_fdc"]');
// Direct deposit information
await page.check('[name="direct_deposit"]');
await page.selectOption('[name="account_type"]', 'checking');
await page.fill('[name="routing_number"]', '063100277');
await page.fill('[name="account_number"]', '123456789012');
await page.fill('[name="bank_name"]', 'Navy Federal Credit Union');
// Payment address (if different)
await page.selectOption('[name="payment_address_same"]', 'yes');
// Dependents
await page.check('[name="has_dependents"]');
// Spouse information
await page.fill('[name="spouse_first_name"]', 'Jennifer');
await page.fill('[name="spouse_middle_name"]', 'Ann');
await page.fill('[name="spouse_last_name"]', 'Martinez');
await page.fill('[name="spouse_ssn"]', '987-65-4321');
await page.fill('[name="spouse_dob"]', '11/20/1987');
await page.fill('[name="marriage_date"]', '06/15/2012');
await page.selectOption('[name="marriage_type"]', 'ceremonial');
// Children
await page.click('[data-testid="add-child"]');
await page.fill('[name="child_first_name_1"]', 'Emily');
await page.fill('[name="child_middle_name_1"]', 'Rose');
await page.fill('[name="child_last_name_1"]', 'Martinez');
await page.fill('[name="child_ssn_1"]', '234-56-7890');
await page.fill('[name="child_dob_1"]', '08/10/2013');
await page.selectOption('[name="child_relationship_1"]', 'biological');
await page.check('[name="child_unmarried_1"]');
await page.check('[name="child_under_18_1"]');
// Employment information
await page.selectOption('[name="employment_status"]', 'unemployed');
await page.fill('[name="last_employment_date"]', '03/2015');
await page.fill('[name="unable_to_work_date"]', '03/2015');
await page.fill('[name="unemployment_reason"]', 'Service-connected disabilities prevent full-time employment');
// Education and training
await page.check('[name="using_gi_bill"]');
await page.fill('[name="school_name"]', 'Florida State College at Jacksonville');
await page.fill('[name="education_start_date"]', '08/2016');
// Other benefits
await page.check('[name="receiving_ssdi"]');
await page.fill('[name="ssdi_start_date"]', '01/2016');
await page.fill('[name="ssdi_monthly_amount"]', '1500');
// Military retirement
await page.selectOption('[name="receiving_military_retirement"]', 'no');
// VA pension
await page.selectOption('[name="receiving_va_pension"]', 'no');
// Intent to file date
await page.fill('[name="intent_to_file_date"]', '01/15/2025');
// Certification and signatures
await page.check('[name="certify_accuracy"]');
await page.check('[name="certify_authorization"]');
await page.check('[name="understand_penalties"]');
await page.check('[name="authorize_disclosure"]');
await page.check('[name="agree_to_exam"]');
// Privacy act notice acknowledgment
await page.check('[name="privacy_act_acknowledged"]');
// Veteran signature
await page.fill('[name="veteran_signature"]', 'James Michael Martinez');
await page.fill('[name="signature_date"]', '03/10/2025');
// Representative information (if applicable)
await page.selectOption('[name="has_representative"]', 'yes');
await page.fill('[name="representative_name"]', 'Veterans Service Organization - DAV');
await page.fill('[name="representative_phone"]', '904-555-0400');
await page.fill('[name="representative_email"]', 'davjacksonville@dav.org');
await page.click('[data-testid="submit-claim"]');
// Download confirmation
await page.click('[data-testid="download-confirmation"]');
await browser.close();
```
Playwright handles medical documentation, service verification, and VA submission processes automatically. You can automate disability claims, dependency declarations, and benefit application workflows.
## Scale your VA Form 21-526EZ automation with Anchor Browser
Run your Playwright VA automations on cloud browsers with enterprise-grade reliability and persistent veterans benefits sessions. Learn more and get started for free: [https://anchorbrowser.io](https://anchorbrowser.io)
# Pricing
Source: https://docs.anchorbrowser.io/pricing
Simple, transparent pricing for Anchor Browser automation platform
# Plans
Start with free credits and upgrade as your automation needs grow.
| Feature | Free | Starter | Growth | Enterprise |
| - | - | - | - | - |
| **Price** | \$5 free credits/month | \$50/month | \$2000/month | Custom |
| **Overage** | - | +\$1.00/credit | +\$1.00/credit | Custom |
| **Concurrent browsers** | Up to 5 | Up to 25 | Up to 200 | 500+ |
| **Session creation rate** | 5 per minute | 25 per minute | 100 per minute | 200+ |
| **Code Execution** | - | - | ✓ | ✓ |
| [**Credits per task**](#task-pricing) | 0.1 | 0.1 | 0.1 | Custom |
| **Max AI tokens per task** | 10M | 10M | Custom | Custom |
| **Max AI steps per task** | 120 | 120 | Custom | Custom |
| **Max AI tokens monthly** | 1B | 1B | 100B | Custom |
| [Embedded browser agent](/agentic-browser-control/ai-task-completion) | ✓ | ✓ | ✓ | ✓ |
| [Authenticated browsers](/essentials/managed-authentication) | - | ✓ | ✓ | ✓ |
| [Automated captcha bypass](/advanced/captcha-solving) | - | ✓ | ✓ | ✓ |
| [Run on any geolocation](/advanced/proxy) | - | ✓ | ✓ | ✓ |
| [Cloudflare verified browser agents](/advanced/cloudflare-web-bot-auth) | - | - | ✓ | ✓ |
| [Bring your own proxy](/advanced/bring-your-own-proxy) | - | - | ✓ | ✓ |
| Data retention | 7 days | 7 days | Custom | Customizable (ZDR) |
| Compliance | - | - | SOC2 Type 2, ISO27001, GDPR | BAA, HIPAA, DPA, SSO, RBAC |
| [Full stealth solution](/essentials/stealth) | - | - | ✓ | ✓ |
| Dedicated Slack support | - | - | ✓ | ✓ |
| Custom regions | US | US | US, EU, Asia, Australia | Any Region |
| Implementation support | - | - | - | ✓ |
| Unique fingerprinting | - | - | - | ✓ |
| Bring your own cloud / On premise | - | - | - | ✓ |
# Task Pricing
[Automation Task](/tasks/overview) runs are billed per run, not per browser minute. Every run of a task you created from a prompt or a demonstration costs **0.1 credits (\$0.10)**, whatever the run does inside the browser.
> [card] Task Run
>
> **0.1 credits per run**
>
> One flat fee covers the browser session, proxy data and any [AI fallback](/advanced/self-healing#ai-fallback) steps the run needs. Enterprise plans can set a custom per-run price.
> [card] Failed Runs
>
> **No task fee**
>
> A run that ends in failure is not charged the task fee. Its browser time and proxy data are billed at [infrastructure rates](#infrastructure-plan) instead. With [retries](/tasks/run-a-task#retries) enabled, only the attempt that succeeds pays the fee.
## Task price vs. infrastructure cost
For each run, Anchor also calculates the infrastructure cost of the browser session the run used: browser creation, browser hours, proxy data and AI steps. You are billed **whichever is higher**, the task fee or that infrastructure cost. For a typical run the task fee is higher, so you pay \$0.10 and nothing else. A run that keeps a browser open for an hour or pulls hundreds of megabytes through the Anchor proxy is billed at infrastructure rates.
> [card] Task Run Examples
>
> | Run | Infrastructure cost | Billed |
> | - | - | - |
> | 3-minute run, no proxy, 2 Light AI fallback steps | $0.01 + (3 ÷ 60 × $0.05) + 2 × $0.01 = $0.0325 | **\$0.10** (task fee) |
> | 1-hour run, 0.5 GB of Anchor Proxy data, no AI steps | $0.01 + $0.05 + 0.5 × $8 = $4.06 | **\$4.06** (infrastructure cost) |
> [!NOTE]
>
> Task pricing applies to [Automation Tasks](/tasks/which-task-type) only. [Perform Web Task](/agentic-browser-control/ai-task-completion) calls (`agent.task`) are billed per [AI step](#ai-pricing) plus the infrastructure the session uses.
# Infrastructure Plan
## Infrastructure Pricing Structure
Applies to browser sessions you drive yourself over the SDK, CDP or Perform Web Task. Task runs are billed per run instead; see [Task Pricing](#task-pricing). Pay for what you use.
> [card] Browser Creation
>
> **\$0.01 per browser**
>
> Every new browser instance created incurs the minimal fee, ensuring cost-effective scaling of your automation workflows.
> [card] Browser Usage
>
> **\$0.05 per browser hour**
>
> Charges are based on the total active time of the browser session, calculated to the nearest full minute.
> [card] Anchor Proxy
>
> **\$8 per GB**
>
> High-speed, secure connections for seamless automation across the web.
>
> When you bring your own proxy or run proxyless, egress is billed at **\$0.2 per GB**.
> [card] AI Steps
>
> **\$0.01 to \$0.10 per step**
>
> Each AI task can consist of multiple steps, depending on its length and complexity. The per-step price is tiered by the model used — see [AI Pricing](#ai-pricing) below.
## Example Calculation
> [card] Cost Breakdown Example
>
> **Scenario**: 10 browsers running for 5 hours, using 2GB of proxy data
>
> | Service | Calculation | Cost |
> | - | - | - |
> | Browser Creation | 10 browsers × \$0.01 | \$0.10 |
> | Browser Hours | 10 browsers × 5 hours × \$0.05 | \$2.50 |
> | Proxy Data | 2GB × \$8 | \$16.00 |
> | **Total** | | **\$18.60** |
# AI Pricing
> [!NOTE]
>
> This AI pricing takes effect on August 21, 2026.
> [accordion] AI pricing
>
> AI tasks are billed per AI step. The price per step depends on the tier of the model used to run the task.
>
> | Tier | Price per AI step | Models |
> | - | - | - |
> | Light | \$0.01 | GPT-4.1 Mini, GPT-4.1 Nano, GPT-4o Mini, GPT-5 Mini, GPT-5 Nano, GPT-5.4 Nano, OpenAI GPT-OSS-120B, Gemini 3.1 Flash Lite, Gemini 2.5 Flash Lite |
> | Standard | \$0.05 | Claude Haiku 4.5, GPT-5, GPT-5.1, GPT-5.4 Mini, GPT-5.6 Luna, O4-Mini, Gemini 3.5 Flash, Gemini 3 Flash Preview |
> | High Performance | \$0.10 | Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, Claude Opus 4.5, Claude Sonnet 5, Claude Sonnet 4.6, Claude Sonnet 4.5, GPT-5.4, GPT-5.5, GPT-5.6 Sol, GPT-5.6 Terra, GPT-4o, GPT-4.1, O3, Gemini 3.1 Pro |
>
> When you [bring your own key](/advanced/bring-your-own-key), each AI step is charged at a flat \$0.01, regardless of the model tier.
# Trust & Security
Source: https://docs.anchorbrowser.io/security
Anchor was engineered from the ground up to be the definitive secure browser solution, empowering developers to deploy to production with confidence. We provide the essential security backbone and advanced capabilities required to build the next generation of browser-based workloads.
This document outlines the security framework of Anchor Browser, covering:
* The reasons why leading enterprises build their solutions on Anchor Browser.
* An overview of our comprehensive Security Architecture.
For a detailed report on our compliance and security posture, please visit the [Anchor Trust Portal](https://trust.anchorbrowser.io/)
## Why Enterprise solutions are built on Anchor Browser
Anchor Browser is the result of deep security expertise from industry veterans, with our team hailing from leaders in cybersecurity such as SentinelOne, Noname Security (acquired by Akamai), and various specialized intelligence units. This collective experience has allowed us to embed robust security capabilities directly into the browser, giving our customers a distinct advantage in enterprise trust, security, and compliance.
### 1. Advanced Features for a More Secure End Solution
* **Complete Browser Isolation & Disposal**: Anchor creates a dedicated, isolated virtual machine (VM) for each browser instance. This VM is permanently terminated and erased upon session completion, ensuring that browsers are never reused and data remnants are eliminated.
* **Official Headful Browser Environments**: As the sole provider of secured and sandboxed environments using the official "Headful" browser operation mode, Anchor runs browsers as they were designed to be run. This ensures maximum stability and leverages the most rigorously tested and penetration-tested browser architecture.
* **Integrated Domain & Network Guardrails**: Anchor implements default network protections to shield customers from malicious websites. We also offer the ability to define granular whitelists of allowed domains, providing precise control over network access at the browser level.
* **Secure Authentication & Credential Management**: With Anchor, customers are never required to store credentials on our platform. Our browsers enable authenticated workflows using secure, encrypted, session-based authentication, eliminating the risks associated with stored credential-based logins.
* **Strict Tenant Isolation**: Anchor enforces rigorous logical isolation between all tenants. This architectural constraint guarantees the integrity and confidentiality of each customer's data.
* **Secure Peer-to-Peer File Transfers**: Secure Peer-to-Peer File Transfers: Uniquely, Anchor facilitates secure file downloads through a peer-to-peer mechanism. File downloads initiated in the browser are transferred directly to the customer's environment, meaning no file artifacts are ever created or stored on Anchor's infrastructure.
### 2. A Secure-by-Design Architecture
Anchor is built on a secure-by-design methodology. This principle ensures that the default configuration is always the most secure, significantly reducing the risk of misconfiguration errors and providing a foundation of trust from the moment you start.
### 3. Shared Responsibility Model
Our shared responsibility model clearly defines the security obligations of both Anchor and our customers. This well defined ownership perimeter approach ensures that all aspects of security are managed effectively, from the underlying infrastructure we secure to the applications you build on top of it.
### 4. Vetted and Audited Supply Chain
We maintain a rigorous security review and auditing process for our entire supply chain. Every component and third-party vendor is scrutinized to ensure they meet our high security standards, protecting our platform and our customers from upstream vulnerabilities.
## Product Architecture & Security Design
### Critical Security Controls
#### Storage of customer data
A core principle of Anchor Browser is minimizing data persistence. By design, we do not store customer data from within the browser sessions. Each browser instance runs in a dedicated, ephemeral virtual machine that is completely destroyed upon session termination. This means that any data accessed, generated, or downloaded during a session is either transferred directly to the customer's own environment via our secure peer-to-peer capability or is irretrievably deleted with the virtual machine. The only customer data we store is essential account and configuration information required for providing our service, such as user roles and network guardrail settings.
#### Data Residency
Anchor Browser infrastructure is by default fully hosted in the United States. All customer data, including browser sessions, account information, and configuration data, is processed and stored exclusively in the AWS `us-east-2` data center in Ohio.
For organizations requiring EU-based infrastructure with full GDPR compliance, we offer dedicated European data residency in the AWS `eu-central-1` data center in Frankfurt on the Growth plan. Contact us at [support@anchorbrowser.io](mailto:support@anchorbrowser.io) or [schedule a call](https://cal.com/team/anchor-browser/30-min-meeting) to get started.
#### Confidentiality & Protection of Customer Data
We enforce strict measures to ensure the confidentiality and integrity of all customer data and platform interactions.
* Strict Tenant Isolation: Our architecture guarantees that each customer's browser instances are logically and physically isolated from one another. There is no possibility of cross-tenant data access.
* Ephemeral Environments: Browsers are never reused between sessions or customers. Every session starts with a pristine, isolated browser instance that is terminated and wiped clean after use, eliminating the risk of data leakage.
* Principle of Least Privilege: Access to all systems and data is governed by the principle of least privilege. Our employees are only granted the minimum level of access necessary to perform their job functions.
#### Data Encryption
Anchor employs robust encryption protocols to protect data at every stage.
* Encryption in Transit: All data transmitted between your local machine and the Anchor Browser instance, as well as any communication with our platform services, is encrypted using industry-standard TLS 1.2 or higher. We enforce the use of strong cipher suites to protect against eavesdropping and man-in-the-middle attacks.
* Encryption at Rest: While we minimize data storage, any essential configuration data or account information stored on our platform is encrypted at rest using AES-256, one of the strongest block ciphers available.
#### Reliability, Backup, and Business Continuity
Anchor is architected for high availability and resilience to ensure uninterrupted service.
* Redundant Architecture: Our infrastructure is deployed across multiple availability zones within our cloud provider's environment. This design protects against single-point-of-failure scenarios and ensures high uptime.
* Automated Backups: We perform regular, automated backups of critical platform configuration data. These backups are encrypted and stored securely, allowing for swift recovery in the unlikely event of a major disruption.
* Disaster Recovery: We maintain a comprehensive business continuity and disaster recovery plan that is regularly tested. This plan ensures that we can restore critical operations within a defined Recovery Time Objective (RTO).
* Status: Current availability is published at [anchorbrowser.betteruptime.com](https://anchorbrowser.betteruptime.com/).
#### Return of Customer Data
Given our ephemeral architecture, there is no session data to return. Any files downloaded during a session are transferred directly to your premises. As for your account and configuration data, you can request a copy of this information at any time during your service agreement. Upon termination of your contract, all associated account data will be permanently deleted from our systems in accordance with our data retention policy.
#### Certifications
Anchor is committed to meeting and exceeding industry standards for security and compliance. We have achieved key certifications that formally validate our security controls and demonstrate our commitment to protecting customer data:
* **SOC 2 Type II**: Anchor has achieved SOC 2 Type II compliance, demonstrating our commitment to security, availability, processing integrity, confidentiality, and privacy controls.
* **ISO 27001**: We are ISO 27001 certified, meeting the international standard for information security management systems.
* **HIPAA**: Anchor is HIPAA compliant, ensuring the protection of healthcare-related data and meeting the requirements of the Health Insurance Portability and Accountability Act.
* **GDPR**: We maintain GDPR compliance, protecting the privacy and data rights of European Union residents.
For the most up-to-date information on our certification status and detailed compliance reports, please visit the [Anchor Trust Portal](https://trust.anchorbrowser.io/).




#### Audits
Anchor engages independent, third-party auditors to conduct regular penetration tests and security assessments of our platform. These rigorous audits help us identify and remediate potential vulnerabilities, ensuring our defenses remain robust against emerging threats. A summary of our latest audit findings can be made available to customers upon request and under a Non-Disclosure Agreement (NDA).
#### Security Logs
We maintain detailed security logs to monitor for and investigate any suspicious activity.
* Audit Trails: We capture comprehensive audit logs of all administrative actions taken within the Anchor platform, such as changes to user permissions or security settings. Access to these logs is restricted to authorized personnel.
* Immutable Logging: Logs are stored in a secure, tamper-evident manner to ensure their integrity for forensic analysis and compliance purposes.
#### Personnel Practices
Our commitment to security extends to our internal team and practices.
* Security Training: We conduct mandatory security awareness training for all employees upon hiring and on an ongoing basis. This training covers data privacy, threat detection, and secure coding practices.
* Access Control: Access to our production environment is strictly controlled and limited to a small number of authorized engineers. We enforce multi-factor authentication (MFA) for all internal systems to add a critical layer of security.
# Zero Data Retention (ZDR) Mode
Source: https://docs.anchorbrowser.io/security/zdr-mode
Enhanced security mode that disables all video and log recordings to prevent sensitive data retention
Zero Data Retention (ZDR) Mode is an enhanced security feature that completely disables video recordings and log recordings for your Anchor account. This mode is designed for organizations handling highly sensitive data that require absolute assurance that no session artifacts are retained on the Anchor platform.
## What is ZDR Mode?
When ZDR Mode is enabled, Anchor disables all recording capabilities for your account, including:
* **Video recordings**: No screen recordings or visual captures of browser sessions
* **Log recordings**: No session logs or activity records
This ensures that no sensitive data from your browser sessions is retained on the Anchor platform, providing an additional layer of data protection beyond our standard ephemeral architecture.
## When to use ZDR Mode
ZDR Mode is recommended for organizations that:
* Handle highly regulated or classified information
* Require strict data residency and retention policies
* Work with sensitive customer data that must not be recorded
* Need to comply with specific industry regulations prohibiting data retention
* Operate in environments where even temporary recording poses compliance risks
## How ZDR Mode works
Once enabled, ZDR Mode:
1. Disables all video recording functionality for browser sessions
2. Prevents session logs from being captured or stored
3. Maintains all other Anchor security features, including ephemeral VMs and tenant isolation
4. Applies to all browser sessions created under your account
Note that ZDR Mode does not affect the core functionality of Anchor Browser. All browser automation, authentication, and networking capabilities remain fully operational.
## Enabling ZDR Mode
ZDR Mode is enabled manually by the Anchor team. To request ZDR Mode for your account:
1. Contact your Anchor account representative or reach out to [support@anchorbrowser.io](mailto:support@anchorbrowser.io)
2. Provide your account details and business justification for requiring ZDR Mode
3. The Anchor team will review your request and enable ZDR Mode for your account
4. You will receive confirmation once ZDR Mode has been activated
## Important considerations
* **Debugging limitations**: With ZDR Mode enabled, you will not have access to video recordings or logs for troubleshooting session issues. Ensure your application has adequate logging and monitoring in place.
* **Permanent setting**: Once enabled, ZDR Mode typically remains active for the duration of your service agreement. Contact the Anchor team if you need to modify this setting.
* **No self-service**: ZDR Mode cannot be toggled on or off by customers. All changes must be requested through the Anchor team.
## Compliance and security
ZDR Mode complements Anchor's existing security architecture, which includes:
* Ephemeral virtual machines that are destroyed after each session
* Strict tenant isolation
* Encryption in transit and at rest
* SOC 2 Type II, ISO 27001, HIPAA, and GDPR compliance
For more information about Anchor's security framework, see our [Trust & Security](/security) documentation or visit the [Anchor Trust Portal](https://trust.anchorbrowser.io/).
# Get Requested Human Interventions
Source: https://docs.anchorbrowser.io/api-reference/agentic-capabilities/get-requested-human-interventions
/openapi.yaml get /v1/sessions/{session_id}/agent/requested-human-intervention
Retrieves pending human-in-the-loop (HITL) requests for a specific active browser
session. Requires `human_intervention: true` on the task that is running in the
session. The agent pauses until a response is submitted via
`POST /v1/sessions/{session_id}/agent/respond-to-human-intervention`.
# List Agent Resources
Source: https://docs.anchorbrowser.io/api-reference/agentic-capabilities/list-agent-resources
/openapi.yaml get /v1/sessions/{sessionId}/agent/files
List all resources that have been uploaded to the browser session for agent use.
Returns resource metadata including name, size, type, and last modified timestamp.
# List Pending Human Interventions
Source: https://docs.anchorbrowser.io/api-reference/agentic-capabilities/list-pending-human-interventions
/openapi.yaml get /v1/sessions/pending-interventions
Returns all pending human-in-the-loop (HITL) requests across the team's active
browser sessions. Each item includes the intervention request plus the session
ID and tags for routing responses.
# Pause Agent
Source: https://docs.anchorbrowser.io/api-reference/agentic-capabilities/pause-agent
/openapi.yaml post /v1/sessions/{session_id}/agent/pause
Pauses the AI agent for the specified browser session.
# Respond to Human Intervention
Source: https://docs.anchorbrowser.io/api-reference/agentic-capabilities/respond-to-human-intervention
/openapi.yaml post /v1/sessions/{session_id}/agent/respond-to-human-intervention
Sends a response to a pending human-in-the-loop (HITL) request for the specified
session. Resolving a request unblocks the agent and emits an `intervention.resolved`
webhook event when `requestId` is provided.
# Resume Agent
Source: https://docs.anchorbrowser.io/api-reference/agentic-capabilities/resume-agent
/openapi.yaml post /v1/sessions/{session_id}/agent/resume
Resumes the AI agent for the specified browser session.
# Upload Agent Resources
Source: https://docs.anchorbrowser.io/api-reference/agentic-capabilities/upload-agent-resources
/openapi.yaml post /v1/sessions/{sessionId}/agent/files
Upload files as agent resources to a browser session using multipart/form-data.
If you upload a ZIP file, it will be automatically extracted and the files will be made available as agent resources
(pass `extract=false` to keep the archive itself instead).
If you upload a single file, it will be saved directly as an agent resource.
Resources are then accessible to AI agents for task completion and automation.
# Create Batch Sessions
Source: https://docs.anchorbrowser.io/api-reference/batch-sessions/create-batch-sessions
/openapi.yaml post /v1/batch-sessions
Creates multiple browser sessions in a single batch operation. This endpoint allows you to
create up to 5,000 browser sessions simultaneously with the same configuration.
The batch will be processed asynchronously, and you can monitor progress using the batch status endpoint.
# Delete Batch Sessions
Source: https://docs.anchorbrowser.io/api-reference/batch-sessions/delete-batch-sessions
/openapi.yaml delete /v1/batch-sessions/{batch_id}
Deletes all sessions in a batch. Running sessions will be terminated
and all session data will be removed.
# Get Batch Session Status
Source: https://docs.anchorbrowser.io/api-reference/batch-sessions/get-batch-session-status
/openapi.yaml get /v1/batch-sessions/{batch_id}
Retrieves detailed status information for a specific batch, including progress,
individual session details, and any errors that occurred.
# List Batch Sessions
Source: https://docs.anchorbrowser.io/api-reference/batch-sessions/list-batch-sessions
/openapi.yaml get /v1/batch-sessions
Lists all batch session requests for the authenticated team, with optional filtering
by status and pagination support.
# Retry Failed Batch Sessions
Source: https://docs.anchorbrowser.io/api-reference/batch-sessions/retry-failed-batch-sessions
/openapi.yaml post /v1/batch-sessions/{batch_id}/retry
Retries failed sessions in a batch by creating new browser pods for each
failed session. The batch status will be set back to 'processing'.
# Update Batch Session
Source: https://docs.anchorbrowser.io/api-reference/batch-sessions/update-batch-session
/openapi.yaml patch /v1/batch-sessions/{batch_id}
Updates a batch session. Supports cancelling a running or pending batch,
which terminates all running sessions in the batch.
# Get Billing Info
Source: https://docs.anchorbrowser.io/api-reference/billing/get-billing-info
/openapi.yaml get /v1/billing
Retrieves credit balance, current-period credit usage, tier, and billing limits for the authenticated project. Pass `from_date`, `to_date`, or `granularity` to additionally receive a `usage` time series of credits used per period, matching `GET /v1/sessions/history?metrics=credits_used`.
# Delete Certificate
Source: https://docs.anchorbrowser.io/api-reference/certificates/delete-certificate
/openapi.yaml delete /v1/certificates/{name}
Delete a CA certificate by name. The certificate will be removed from storage and can no longer be used in new sessions.
# List Certificates
Source: https://docs.anchorbrowser.io/api-reference/certificates/list-certificates
/openapi.yaml get /v1/certificates
Get all CA certificates uploaded for the team
# Upload Certificate
Source: https://docs.anchorbrowser.io/api-reference/certificates/upload-certificate
/openapi.yaml post /v1/certificates
Upload a CA certificate to trust in browser sessions. Certificates are managed at the team level.
Once uploaded, reference the certificate by name when creating sessions to trust services using that CA.
See [CA Certificates documentation](/advanced/ca-certificates) for more details.
# Signal Event
Source: https://docs.anchorbrowser.io/api-reference/event-coordination/signal-event
/openapi.yaml post /v1/events/{event_name}
Signals an event with associated data, unblocking any clients waiting for this event.
This enables coordination between different browser sessions, workflows, or external processes.
# Wait for Event
Source: https://docs.anchorbrowser.io/api-reference/event-coordination/wait-for-event
/openapi.yaml post /v1/events/{event_name}/wait
Waits for a specific event to be signaled by another process, workflow, or session.
This endpoint blocks until the event is signaled or the timeout is reached.
Useful for coordinating between multiple browser sessions or workflows.
# Delete Extension
Source: https://docs.anchorbrowser.io/api-reference/extensions/delete-extension
/openapi.yaml delete /v1/extensions/{id}
Delete an extension and remove it from storage
# Get Extension Details
Source: https://docs.anchorbrowser.io/api-reference/extensions/get-extension-details
/openapi.yaml get /v1/extensions/{id}
Get details of a specific extension by its ID
# List Extensions
Source: https://docs.anchorbrowser.io/api-reference/extensions/list-extensions
/openapi.yaml get /v1/extensions
Get all extensions for the authenticated user
# Upload Extension
Source: https://docs.anchorbrowser.io/api-reference/extensions/upload-extension
/openapi.yaml post /v1/extensions
Upload a new browser extension as a ZIP file. The extension will be validated and stored for use in browser sessions.
# Create Integration
Source: https://docs.anchorbrowser.io/api-reference/integrations/create-integration
/openapi.yaml post /v1/integrations
Creates a new integration with a third-party service like 1Password.
The integration can then be used in browser sessions to automatically load secrets and credentials.
# Delete Integration
Source: https://docs.anchorbrowser.io/api-reference/integrations/delete-integration
/openapi.yaml delete /v1/integrations/{integrationId}
Deletes an existing integration and removes its stored credentials.
# List Integrations
Source: https://docs.anchorbrowser.io/api-reference/integrations/list-integrations
/openapi.yaml get /v1/integrations
Retrieves all integrations for the authenticated team.
# Copy Selected Text
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/copy-selected-text
/openapi.yaml post /v1/sessions/{sessionId}/copy
Copies the currently selected text to the clipboard
# Drag and Drop
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/drag-and-drop
/openapi.yaml post /v1/sessions/{sessionId}/drag-and-drop
Performs a drag and drop operation from start coordinates to end coordinates
# Get Clipboard Content
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/get-clipboard-content
/openapi.yaml get /v1/sessions/{sessionId}/clipboard
Retrieves the current content of the clipboard
# Keyboard Shortcut
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/keyboard-shortcut
/openapi.yaml post /v1/sessions/{sessionId}/keyboard/shortcut
Performs a keyboard shortcut using the specified keys
# Navigate to URL
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/navigate-to-url
/openapi.yaml post /v1/sessions/{sessionId}/goto
Navigates the browser session to the specified URL
# Paste Text
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/paste-text
/openapi.yaml post /v1/sessions/{sessionId}/paste
Pastes text at the current cursor position
# Scroll
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/scroll
/openapi.yaml post /v1/sessions/{sessionId}/scroll
Performs a scroll action at the specified coordinates
# Set Clipboard Content
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/set-clipboard-content
/openapi.yaml post /v1/sessions/{sessionId}/clipboard
Sets the content of the clipboard
# Type Text
Source: https://docs.anchorbrowser.io/api-reference/os-level-control/type-text
/openapi.yaml post /v1/sessions/{sessionId}/keyboard/type
Types the specified text with optional delay between keystrokes
# Delete Session Recording
Source: https://docs.anchorbrowser.io/api-reference/session-recordings/delete-session-recording
/openapi.yaml delete /v1/sessions/{session_id}/recordings/{recording_id}
Deletes a specific recording from a browser session. Use "primary" as the recording_id to delete the primary recording.
# Get Session Recording
Source: https://docs.anchorbrowser.io/api-reference/session-recordings/get-session-recording
/openapi.yaml get /v1/sessions/{session_id}/recordings/primary/fetch
Downloads the primary recording file for the specified browser session. Returns the recording as an MP4 file.
# List Session Recordings
Source: https://docs.anchorbrowser.io/api-reference/session-recordings/list-session-recordings
/openapi.yaml get /v1/sessions/{session_id}/recordings
Retrieves the URLs of the browser session's video recordings. Requires a valid API key for authentication.
# Pause Session Recording
Source: https://docs.anchorbrowser.io/api-reference/session-recordings/pause-session-recording
/openapi.yaml post /v1/sessions/{session_id}/recordings/pause
Pauses the video recording for the specified browser session.
# Resume Session Recording
Source: https://docs.anchorbrowser.io/api-reference/session-recordings/resume-session-recording
/openapi.yaml post /v1/sessions/{session_id}/recordings/resume
Resumes the video recording for the specified browser session.
# Create or Update Task Draft (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/create-or-update-task-draft-legacy
/openapi.yaml post /v1/task/{taskId}/draft
Creates or updates the draft version of a task. Draft versions are used for development
and testing before publishing.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Create Task (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/create-task-legacy
/openapi.yaml post /v1/task
Creates a new task or updates an existing task with the same name. Tasks are reusable code snippets
that can be executed in browser sessions. Tasks support versioning with draft and published versions.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Delete Task (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/delete-task-legacy
/openapi.yaml delete /v1/task/{taskId}
Soft deletes a task and all its versions. The task will no longer be accessible
but the data is preserved for potential recovery.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Delete Task Version (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/delete-task-version-legacy
/openapi.yaml delete /v1/task/{taskId}/{taskVersion}
Soft deletes a specific version of a task. The version will no longer be accessible
but the data is preserved for potential recovery.
If you are using the new Task Builder, see the Tasks V2 endpoints in this API reference.
# Deploy Task (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/deploy-task-legacy
/openapi.yaml post /v1/task/{taskId}/deploy
Deploys a task by creating a new version with auto-incremented version number.
This is the recommended way to publish task changes.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Get Latest Task Version (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/get-latest-task-version-legacy
/openapi.yaml get /v1/task/{taskId}/latest
Retrieves the latest version of a task, including the full code content.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Get Task Draft (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/get-task-draft-legacy
/openapi.yaml get /v1/task/{taskId}/draft
Retrieves the draft version of a task, including the full code content.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Get Task Execution Result (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/get-task-execution-result-legacy
/openapi.yaml get /v1/task/{taskId}/executions/{executionId}
Retrieves a single execution result by its ID. This endpoint is useful for polling
execution status in async mode or retrieving detailed execution information.
If you are using the new Task Builder, see the Tasks V2 endpoints in this API reference.
# Get Task Metadata (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/get-task-metadata-legacy
/openapi.yaml get /v1/task/{taskId}
Retrieves task metadata without the code content. Useful for getting task information
without downloading the full task code.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Get Task Version (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/get-task-version-legacy
/openapi.yaml get /v1/task/{taskId}/{taskVersion}
Retrieves a specific version of a task, including the full code content.
If you are using the new Task Builder, see the Tasks V2 endpoints in this API reference.
# List Task Executions (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/list-task-executions-legacy
/openapi.yaml get /v1/task/{taskId}/executions
Retrieves execution history for a task, including success/failure status,
execution times, and outputs. Results can be filtered by version and status.
If you are using the new Task Builder, see the Tasks V2 endpoints in this API reference.
# List Task Versions (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/list-task-versions-legacy
/openapi.yaml get /v1/task/{taskId}/versions
Retrieves all versions of a specific task, including draft and published versions.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# List Tasks (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/list-tasks-legacy
/openapi.yaml get /v1/task
Retrieves a paginated list of all tasks for the authenticated team. Tasks are returned
with their latest version information and metadata.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Publish Task Version (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/publish-task-version-legacy
/openapi.yaml post /v1/task/{taskId}/{taskVersion}
Publishes a specific version of a task. This creates a new version if it doesn't exist,
or updates an existing version's metadata.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Run Task by Name (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/run-task-by-name-legacy
/openapi.yaml post /v1/task/run/{taskName}
Executes a task by its name, always using the latest version. This is a convenience endpoint
for running tasks without needing to know the task ID.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Run Task (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/run-task-legacy
/openapi.yaml post /v1/task/run
Executes a task in a browser session. The task can be run with a specific version or the latest version.
Optionally, you can provide an existing session ID or let the system create a new one.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Update Task Metadata (Legacy)
Source: https://docs.anchorbrowser.io/api-reference/tasks-legacy/update-task-metadata-legacy
/openapi.yaml put /v1/task/{taskId}
Updates task metadata (name and description). This does not affect the task code or versions.
If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.
# Create Directory
Source: https://docs.anchorbrowser.io/api-reference/volume-files/create-directory
/openapi.yaml post /v1/volumes/{volume_id}/directories
Create an empty folder in the volume. Folders are also created implicitly when a file is uploaded to a path inside them.
# Create Upload URL
Source: https://docs.anchorbrowser.io/api-reference/volume-files/create-upload-url
/openapi.yaml post /v1/volumes/{volume_id}/files/upload-url
Get a pre-signed URL to upload a file of any size (up to 5 GB) directly to storage. `PUT` the file body to `signed_url` and send the returned `headers` unchanged.
# Delete Files
Source: https://docs.anchorbrowser.io/api-reference/volume-files/delete-files
/openapi.yaml delete /v1/volumes/{volume_id}/files
Delete one file (`path`) or everything under a folder (`prefix` with `recursive=true`).
# Download File
Source: https://docs.anchorbrowser.io/api-reference/volume-files/download-file
/openapi.yaml get /v1/volumes/{volume_id}/files/download
Get a pre-signed URL for a file. Pass `redirect=true` to be redirected to the file instead of receiving the URL.
# Get File Info
Source: https://docs.anchorbrowser.io/api-reference/volume-files/get-file-info
/openapi.yaml get /v1/volumes/{volume_id}/files/stat
Size, type and modification time of one file.
# List All Paths
Source: https://docs.anchorbrowser.io/api-reference/volume-files/list-all-paths
/openapi.yaml get /v1/volumes/{volume_id}/paths
Flat list of every path in the volume, optionally under a prefix. Folders appear with a trailing slash (for example `downloads/`).
# List Files
Source: https://docs.anchorbrowser.io/api-reference/volume-files/list-files
/openapi.yaml get /v1/volumes/{volume_id}/files
List the contents of a folder in the volume (one level, like `ls`), or the whole tree with `recursive=true`. Files written by a running session appear here about a minute after the session stops writing to them.
# Upload File
Source: https://docs.anchorbrowser.io/api-reference/volume-files/upload-file
/openapi.yaml post /v1/volumes/{volume_id}/files
Upload a file into the volume in one multipart request. For files larger than 10 MB use `POST /v1/volumes/{volume_id}/files/upload-url` instead.
# Create Volume
Source: https://docs.anchorbrowser.io/api-reference/volumes/create-volume
/openapi.yaml post /v1/volumes
Create a persistent volume for your team. The volume is usually `ready` immediately; if the response says `creating`, poll `GET /v1/volumes/{volume_id}` until it is. Each team can have up to 10 volumes.
# Delete Volume
Source: https://docs.anchorbrowser.io/api-reference/volumes/delete-volume
/openapi.yaml delete /v1/volumes/{volume_id}
Delete a volume and every file in it. Refused while a running session has the volume mounted; end those sessions first.
# Get Volume
Source: https://docs.anchorbrowser.io/api-reference/volumes/get-volume
/openapi.yaml get /v1/volumes/{volume_id}
Get a volume by its ID. Deleted volumes return `404`; use `GET /v1/volumes?include_deleted=true` to see them.
# Get Volume By Name
Source: https://docs.anchorbrowser.io/api-reference/volumes/get-volume-by-name
/openapi.yaml get /v1/volumes/by-name/{name}
Get a volume by its name.
# List Volumes
Source: https://docs.anchorbrowser.io/api-reference/volumes/list-volumes
/openapi.yaml get /v1/volumes
List the volumes of your team.
# Create Webhook
Source: https://docs.anchorbrowser.io/api-reference/webhooks/create-webhook
/openapi.yaml post /v1/webhooks
Register a new HTTPS endpoint to receive events. The response includes
a one-time `secret` (HMAC-SHA256 signing key) — store it; Anchor never
returns it again. Up to 5 webhooks per project.
# Delete Webhook
Source: https://docs.anchorbrowser.io/api-reference/webhooks/delete-webhook
/openapi.yaml delete /v1/webhooks/{id}
Soft-delete a webhook. New events stop fanning out immediately. The events
history (`/v1/webhooks/{id}/events`) is still queryable for the retention
window even after delete.
# Get Webhook
Source: https://docs.anchorbrowser.io/api-reference/webhooks/get-webhook
/openapi.yaml get /v1/webhooks/{id}
Fetch a single webhook config. The signing secret is never returned.
# List Webhook Deliveries
Source: https://docs.anchorbrowser.io/api-reference/webhooks/list-webhook-deliveries
/openapi.yaml get /v1/webhooks/{id}/events
Paginated history of every delivery attempt for this webhook (succeeded,
failed, or dead-lettered). Filter by status, event type, or time range.
Retention: 7 days.
# List Webhooks
Source: https://docs.anchorbrowser.io/api-reference/webhooks/list-webhooks
/openapi.yaml get /v1/webhooks
List every active webhook for the authenticated project. The signing secret is never included.
# Rotate Webhook Signing Secret
Source: https://docs.anchorbrowser.io/api-reference/webhooks/rotate-webhook-signing-secret
/openapi.yaml post /v1/webhooks/{id}/rotate-secret
Mint a new HMAC-SHA256 signing secret. The previous secret remains valid
for 24 hours so you can update your verification code at your own pace,
then drop the old secret.
The new secret is returned exactly once, in the `secret` field.
# Send Test Event
Source: https://docs.anchorbrowser.io/api-reference/webhooks/send-test-event
/openapi.yaml post /v1/webhooks/{id}/test
Fire a synthetic event of the given type through the real signing + retry
path. Useful during development for confirming your endpoint can verify
the signature and is reachable from Anchor's egress IPs.
The synthetic delivery counts toward your delivery log so you can see it
in `GET /v1/webhooks/{id}/events`.
# Update Webhook
Source: https://docs.anchorbrowser.io/api-reference/webhooks/update-webhook
/openapi.yaml patch /v1/webhooks/{id}
Partial update — pass only the fields you want to change. Setting `enabled: false`
immediately stops events from fanning out to this webhook (existing in-flight
deliveries finish their attempts).
# Agent
Source: https://docs.anchorbrowser.io/sdk-reference/agent
SDK reference for the Agent resource (TypeScript & Python)
## Upload Agent Resources
`POST /v1/sessions/{sessionId}/agent/files` — uploadAgentFiles
```typescript TypeScript theme={null}
import { client, Agent } 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 Agent.uploadAgentFiles({
path: {
sessionId: 'your-sessionId'
},
body: {
file: new File(['file content'], 'file.txt')
}
});
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.agent.upload_agent_files(
"your-session-id",
file=("file.txt", b"file content"),
)
print(result)
```
## List Agent Resources
`GET /v1/sessions/{sessionId}/agent/files` — listAgentFiles
```typescript TypeScript theme={null}
import { client, Agent } 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 Agent.listAgentFiles({
path: {
sessionId: 'your-sessionId'
}
});
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.agent.list_agent_files(
"your-session-id",
)
print(result)
```
## Pause Agent
`POST /v1/sessions/{session_id}/agent/pause` — pauseAgent
```typescript TypeScript theme={null}
import { client, Agent } 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 Agent.pauseAgent({
path: {
session_id: 'your-session-id'
}
});
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.agent.pause_agent(
"your-session-id",
)
print(result)
```
## Resume Agent
`POST /v1/sessions/{session_id}/agent/resume` — resumeAgent
```typescript TypeScript theme={null}
import { client, Agent } 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 Agent.resumeAgent({
path: {
session_id: 'your-session-id'
}
});
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.agent.resume_agent(
"your-session-id",
)
print(result)
```
## List Pending Human Interventions
`GET /v1/sessions/pending-interventions` — listPendingInterventions
```typescript TypeScript theme={null}
import { client, Agent } 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 Agent.listPendingInterventions();
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.agent.list_pending_interventions()
print(result)
```
## Get Requested Human Interventions
`GET /v1/sessions/{session_id}/agent/requested-human-intervention` — getRequestedHumanIntervention
```typescript TypeScript theme={null}
import { client, Agent } 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 Agent.getRequestedHumanIntervention({
path: {
session_id: 'your-session-id'
}
});
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.agent.get_requested_human_intervention(
"your-session-id",
)
print(result)
```
## Respond to Human Intervention
`POST /v1/sessions/{session_id}/agent/respond-to-human-intervention` — respondToHumanIntervention
```typescript TypeScript theme={null}
import { client, Agent } 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 Agent.respondToHumanIntervention({
path: {
session_id: 'your-session-id'
},
body: {
response: '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.agent.respond_to_human_intervention(
"your-session-id",
response="string",
)
print(result)
```
# Applications
Source: https://docs.anchorbrowser.io/sdk-reference/applications
SDK reference for the Applications resource (TypeScript & Python)
## Create Application
`POST /v1/applications` — createApplication
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.createApplication({
body: {
source: '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.applications.create_application(
source="https://example.com",
)
print(result)
```
## List Applications
`GET /v1/applications` — listApplications
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.listApplications();
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.applications.list_applications()
print(result)
```
## Get Application
`GET /v1/applications/{applicationId}` — getApplication
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.getApplication({
path: {
applicationId: 'your-applicationId'
}
});
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.applications.get_application(
"your-application-id",
)
print(result)
```
## Delete Application
`DELETE /v1/applications/{applicationId}` — deleteApplication
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.deleteApplication({
path: {
applicationId: 'your-applicationId'
}
});
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.applications.delete_application(
"your-application-id",
)
print(result)
```
## List Application Identities
`GET /v1/applications/{applicationId}/identities` — listApplicationIdentities
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.listApplicationIdentities({
path: {
applicationId: 'your-applicationId'
}
});
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.applications.list_application_identities(
"your-application-id",
)
print(result)
```
## List Application Authentication Flows
`GET /v1/applications/{applicationId}/auth-flows` — listAuthFlows
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.listAuthFlows({
path: {
applicationId: 'your-applicationId'
}
});
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.applications.list_auth_flows(
"your-application-id",
)
print(result)
```
## Create Authentication Flow
`POST /v1/applications/{applicationId}/auth-flows` — createAuthFlow
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.createAuthFlow({
path: {
applicationId: 'your-applicationId'
},
body: {
name: 'string',
methods: ['username_password']
}
});
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.applications.create_auth_flow(
"your-application-id",
name="string",
methods=["username_password"],
)
print(result)
```
## Update Authentication Flow
`PATCH /v1/applications/{applicationId}/auth-flows/{authFlowId}` — updateAuthFlow
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.updateAuthFlow({
path: {
applicationId: 'your-applicationId',
authFlowId: 'your-authFlowId'
},
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.applications.update_auth_flow(
"your-application-id",
"your-auth-flow-id",
)
print(result)
```
## Delete Authentication Flow
`DELETE /v1/applications/{applicationId}/auth-flows/{authFlowId}` — deleteAuthFlow
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.deleteAuthFlow({
path: {
applicationId: 'your-applicationId',
authFlowId: 'your-authFlowId'
}
});
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.applications.delete_auth_flow(
"your-application-id",
"your-auth-flow-id",
)
print(result)
```
## Create Identity Token
`POST /v1/applications/{applicationId}/tokens` — createIdentityToken
```typescript TypeScript theme={null}
import { client, Applications } 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 Applications.createIdentityToken({
path: {
applicationId: 'your-applicationId'
},
body: {
callbackUrl: 'https://example.com/callback'
}
});
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.applications.create_identity_token(
"your-application-id",
callback_url="https://example.com/callback",
)
print(result)
```
# BatchSessions
Source: https://docs.anchorbrowser.io/sdk-reference/batchsessions
SDK reference for the BatchSessions resource (TypeScript & Python)
## List Batch Sessions
`GET /v1/batch-sessions` — listBatchSessions
```typescript TypeScript theme={null}
import { client, BatchSessions } 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 BatchSessions.listBatchSessions();
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.batch_sessions.list_batch_sessions()
print(result)
```
## Create Batch Sessions
`POST /v1/batch-sessions` — createBatchSession
```typescript TypeScript theme={null}
import { client, BatchSessions } 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 BatchSessions.createBatchSession({
body: {
count: 1
}
});
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.batch_sessions.create_batch_session(
count=1,
)
print(result)
```
## Get Batch Session Status
`GET /v1/batch-sessions/{batch_id}` — getBatchSession
```typescript TypeScript theme={null}
import { client, BatchSessions } 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 BatchSessions.getBatchSession({
path: {
batch_id: 'your-batch-id'
}
});
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.batch_sessions.get_batch_session(
"your-batch-id",
)
print(result)
```
## Update Batch Session
`PATCH /v1/batch-sessions/{batch_id}` — updateBatchSession
```typescript TypeScript theme={null}
import { client, BatchSessions } 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 BatchSessions.updateBatchSession({
path: {
batch_id: 'your-batch-id'
},
body: {
status: 'cancelled'
}
});
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.batch_sessions.update_batch_session(
"your-batch-id",
status="cancelled",
)
print(result)
```
## Delete Batch Sessions
`DELETE /v1/batch-sessions/{batch_id}` — deleteBatchSession
```typescript TypeScript theme={null}
import { client, BatchSessions } 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 BatchSessions.deleteBatchSession({
path: {
batch_id: 'your-batch-id'
}
});
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.batch_sessions.delete_batch_session(
"your-batch-id",
)
print(result)
```
## Retry Failed Batch Sessions
`POST /v1/batch-sessions/{batch_id}/retry` — retryBatchSession
```typescript TypeScript theme={null}
import { client, BatchSessions } 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 BatchSessions.retryBatchSession({
path: {
batch_id: 'your-batch-id'
},
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.batch_sessions.retry_batch_session(
"your-batch-id",
)
print(result)
```
# Billing
Source: https://docs.anchorbrowser.io/sdk-reference/billing
SDK reference for the Billing resource (TypeScript & Python)
## Get Billing Info
`GET /v1/billing` — getBilling
```typescript TypeScript theme={null}
import { client, Billing } 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 Billing.getBilling();
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.billing.get_billing()
print(result)
```
# Certificates
Source: https://docs.anchorbrowser.io/sdk-reference/certificates
SDK reference for the Certificates resource (TypeScript & Python)
## Upload Certificate
`POST /v1/certificates` — createCertificate
```typescript TypeScript theme={null}
import { client, Certificates } 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 Certificates.createCertificate({
body: {
name: 'string',
file: new File(['file content'], 'file.txt')
}
});
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.certificates.create_certificate(
name="string",
file=("file.txt", b"file content"),
)
print(result)
```
## List Certificates
`GET /v1/certificates` — listCertificates
```typescript TypeScript theme={null}
import { client, Certificates } 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 Certificates.listCertificates();
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.certificates.list_certificates()
print(result)
```
## Delete Certificate
`DELETE /v1/certificates/{name}` — deleteCertificate
```typescript TypeScript theme={null}
import { client, Certificates } 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 Certificates.deleteCertificate({
path: {
name: 'your-name'
}
});
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.certificates.delete_certificate(
"your-name",
)
print(result)
```
# Events
Source: https://docs.anchorbrowser.io/sdk-reference/events
SDK reference for the Events resource (TypeScript & Python)
## Wait for Event
`POST /v1/events/{event_name}/wait` — waitForEvent
```typescript TypeScript theme={null}
import { client, Events } 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 Events.waitForEvent({
path: {
event_name: 'your-event-name'
}
});
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.events.wait_for_event(
"your-event-name",
)
print(result)
```
## Signal Event
`POST /v1/events/{event_name}` — signalEvent
```typescript TypeScript theme={null}
import { client, Events } 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 Events.signalEvent({
path: {
event_name: 'your-event-name'
},
body: {
data: {
message: 'Task completed',
result: 'success',
timestamp: '2024-01-01T12:00:00Z'
}
}
});
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.events.signal_event(
"your-event-name",
data={
"message": "Task completed",
"result": "success",
"timestamp": "2024-01-01T12:00:00Z"
},
)
print(result)
```
# Extensions
Source: https://docs.anchorbrowser.io/sdk-reference/extensions
SDK reference for the Extensions resource (TypeScript & Python)
## Upload Extension
`POST /v1/extensions` — uploadExtension
```typescript TypeScript theme={null}
import { client, Extensions } 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 Extensions.uploadExtension({
body: {
name: 'string',
file: new File(['file content'], 'file.txt')
}
});
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.extensions.upload_extension(
name="string",
file=("file.txt", b"file content"),
)
print(result)
```
## List Extensions
`GET /v1/extensions` — listExtensions
```typescript TypeScript theme={null}
import { client, Extensions } 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 Extensions.listExtensions();
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.extensions.list_extensions()
print(result)
```
## Get Extension Details
`GET /v1/extensions/{id}` — getExtension
```typescript TypeScript theme={null}
import { client, Extensions } 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 Extensions.getExtension({
path: {
id: 'your-id'
}
});
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.extensions.get_extension(
"your-id",
)
print(result)
```
## Delete Extension
`DELETE /v1/extensions/{id}` — deleteExtension
```typescript TypeScript theme={null}
import { client, Extensions } 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 Extensions.deleteExtension({
path: {
id: 'your-id'
}
});
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.extensions.delete_extension(
"your-id",
)
print(result)
```
# Identities
Source: https://docs.anchorbrowser.io/sdk-reference/identities
SDK reference for the Identities resource (TypeScript & Python)
## Create Identity
`POST /v1/identities` — createIdentity
```typescript TypeScript theme={null}
import { client, Identities } 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 Identities.createIdentity({
body: {
source: '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.identities.create_identity(
source="https://example.com",
)
print(result)
```
## Get Identity
`GET /v1/identities/{identityId}` — getIdentity
```typescript TypeScript theme={null}
import { client, Identities } 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 Identities.getIdentity({
path: {
identityId: 'your-identityId'
}
});
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.identities.get_identity(
"your-identity-id",
)
print(result)
```
## Update Identity
`PUT /v1/identities/{identityId}` — updateIdentity
```typescript TypeScript theme={null}
import { client, Identities } 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 Identities.updateIdentity({
path: {
identityId: 'your-identityId'
},
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.identities.update_identity(
"your-identity-id",
)
print(result)
```
## Delete Identity
`DELETE /v1/identities/{identityId}` — deleteIdentity
```typescript TypeScript theme={null}
import { client, Identities } 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 Identities.deleteIdentity({
path: {
identityId: 'your-identityId'
}
});
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.identities.delete_identity(
"your-identity-id",
)
print(result)
```
## Reauthenticate Identity
`POST /v1/identities/{identityId}/reauthenticate` — reauthenticateIdentity
```typescript TypeScript theme={null}
import { client, Identities } 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 Identities.reauthenticateIdentity({
path: {
identityId: 'your-identityId'
}
});
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.identities.reauthenticate_identity(
"your-identity-id",
)
print(result)
```
## Start Dynamic Auth Flow
`POST /v1/identities/dynamic/start/{session_id}` — startDynamicAuthFlow
```typescript TypeScript theme={null}
import { client, Identities } 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 Identities.startDynamicAuthFlow({
path: {
session_id: 'your-session-id'
},
body: {
url: 'https://example.com/login',
host: '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.identities.start_dynamic_auth_flow(
"your-session-id",
url="https://example.com/login",
host="example.com",
)
print(result)
```
## Get Dynamic Auth Flow State
`GET /v1/identities/dynamic/state/{session_id}` — getDynamicAuthFlowState
```typescript TypeScript theme={null}
import { client, Identities } 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 Identities.getDynamicAuthFlowState({
path: {
session_id: 'your-session-id'
}
});
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.identities.get_dynamic_auth_flow_state(
"your-session-id",
)
print(result)
```
## Resolve Dynamic Auth Flow Step
`POST /v1/identities/dynamic/resolve/{session_id}` — resolveDynamicAuthFlow
```typescript TypeScript theme={null}
import { client, Identities } 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 Identities.resolveDynamicAuthFlow({
path: {
session_id: 'your-session-id'
},
body: {
option_index: 0,
values: {
username: 'user@example.com',
password: 'secret'
}
}
});
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.identities.resolve_dynamic_auth_flow(
"your-session-id",
)
print(result)
```
## Finalize Dynamic Auth Flow
`POST /v1/identities/dynamic/finalize/{session_id}` — finalizeDynamicAuthFlow
```typescript TypeScript theme={null}
import { client, Identities } 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 Identities.finalizeDynamicAuthFlow({
path: {
session_id: 'your-session-id'
}
});
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.identities.finalize_dynamic_auth_flow(
"your-session-id",
)
print(result)
```
# Integrations
Source: https://docs.anchorbrowser.io/sdk-reference/integrations
SDK reference for the Integrations resource (TypeScript & Python)
## Create Integration
`POST /v1/integrations` — createIntegration
```typescript TypeScript theme={null}
import { client, Integrations } 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 Integrations.createIntegration({
body: {
name: 'My 1Password Integration',
type: '1PASSWORD',
credentials: {
type: 'serviceAccount',
data: {
serviceAccount: 'ops_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
}
}
});
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.integrations.create_integration(
name="My 1Password Integration",
type="1PASSWORD",
credentials={
"type": "serviceAccount",
"data": {
"serviceAccount": "ops_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
},
)
print(result)
```
## List Integrations
`GET /v1/integrations` — listIntegrations
```typescript TypeScript theme={null}
import { client, Integrations } 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 Integrations.listIntegrations();
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.integrations.list_integrations()
print(result)
```
## Delete Integration
`DELETE /v1/integrations/{integrationId}` — deleteIntegration
```typescript TypeScript theme={null}
import { client, Integrations } 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 Integrations.deleteIntegration({
path: {
integrationId: 'your-integrationId'
}
});
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.integrations.delete_integration(
"your-integration-id",
)
print(result)
```
# Migrating from 0.x.x
Source: https://docs.anchorbrowser.io/sdk-reference/migration
Upgrade from any pre-1.0.0 SDK release (0.x.x and 1.0.0-dev)
Version 1.0.0 of both SDKs is generated directly from the public OpenAPI specification,
and every method is named after its API operation. If you are upgrading from any release
prior to 1.0.0 (all `0.x.x` versions, and the `1.0.0-dev` pre-releases on PyPI), method
names have changed — for example:
```diff TypeScript theme={null}
- const session = await client.sessions.create({ session: { recording: { active: false } } });
+ const session = await Sessions.createSession({ body: { session: { recording: { active: false } } } });
```
```diff Python theme={null}
- session = client.sessions.create(session={"recording": {"active": False}})
+ session = client.sessions.create_session(session={"recording": {"active": False}})
```
In TypeScript the client itself also changed (a shared configurable instance instead of a
constructed class); in Python the client construction, error types, retries and timeouts are
unchanged — only method names and a few subsurfaces moved.
## Requirements
* **TypeScript**: no runtime requirement changes.
* **Python**: Python 3.10+ (was 3.9+) and pydantic v2 (`>= 2, < 3`) — pydantic v1 is no
longer supported, and `pip` will refuse to resolve `anchorbrowser >= 1.0.0` alongside
`pydantic < 2`. Every other dependency keeps the same version range.
## Full migration guides
Each repository ships a complete guide covering every breaking change and its 1.0
equivalent, including the full method rename table:
* **TypeScript**: [MIGRATION.md](https://github.com/anchorbrowser/AnchorBrowser-SDK-Typescript/blob/main/MIGRATION.md)
* **Python**: [MIGRATION.md](https://github.com/anchorbrowser/AnchorBrowser-SDK-Python/blob/main/MIGRATION.md)
# SDK Reference
Source: https://docs.anchorbrowser.io/sdk-reference/overview
Install and configure the anchorbrowser TypeScript and Python SDKs
The [`anchorbrowser`](https://www.npmjs.com/package/anchorbrowser) npm package and the
[`anchorbrowser`](https://pypi.org/project/anchorbrowser/) PyPI package are generated
directly from this API's OpenAPI specification — every documented endpoint is available
as a typed method in both SDKs, and every method page here shows both languages.
```bash npm theme={null}
npm install anchorbrowser
```
```bash pip theme={null}
pip install anchorbrowser
```
## Configuration
```typescript TypeScript theme={null}
import { client, Sessions } from 'anchorbrowser';
// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });
const session = await Sessions.createSession({ body: {} });
console.log(session.data?.id);
```
```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()
session = client.sessions.create_session()
print(session.data.id)
```
In TypeScript, methods are static — one options object with `path`, `query` and `body`
keys matching the operation. In Python, resources hang off a client instance — path
params are positional and query/body params are keyword arguments, with the same names
in snake\_case (`Sessions.createSession` ↔ `client.sessions.create_session`). Both
return the parsed response body and raise/throw on failures (non-2xx or network).
Python also ships `AsyncAnchorbrowser` with the identical surface for `await`.
## Resources
* [Agent](/sdk-reference/agent) — 7 methods
* [Applications](/sdk-reference/applications) — 10 methods
* [BatchSessions](/sdk-reference/batchsessions) — 6 methods
* [Billing](/sdk-reference/billing) — 1 methods
* [Certificates](/sdk-reference/certificates) — 3 methods
* [Events](/sdk-reference/events) — 2 methods
* [Extensions](/sdk-reference/extensions) — 4 methods
* [Identities](/sdk-reference/identities) — 9 methods
* [Integrations](/sdk-reference/integrations) — 3 methods
* [Profiles](/sdk-reference/profiles) — 4 methods
* [Recordings](/sdk-reference/recordings) — 5 methods
* [Sessions](/sdk-reference/sessions) — 30 methods
* [Tasks](/sdk-reference/tasks) — 21 methods
* [Tools](/sdk-reference/tools) — 6 methods
* [Volumes](/sdk-reference/volumes) — 13 methods
* [Webhooks](/sdk-reference/webhooks) — 8 methods
## Playwright & agent helpers
Both SDKs also ship hand-written helpers for driving the browser and running agent tasks:
```typescript TypeScript theme={null}
import { agentTask, createBrowser } from 'anchorbrowser';
const result = await agentTask('go to example.com and return the page title');
const { browser, session } = await createBrowser(); // Playwright over CDP
```
```python Python theme={null}
from anchorbrowser import Anchorbrowser
client = Anchorbrowser()
result = client.agent.task("go to example.com and return the page title")
with client.browser.create() as browser: # Playwright over CDP
page = browser.contexts[0].pages[0]
```
See the [TypeScript README](https://github.com/anchorbrowser/AnchorBrowser-SDK-Typescript#readme)
and the [Python README](https://github.com/anchorbrowser/AnchorBrowser-SDK-Python#readme).
# Profiles
Source: https://docs.anchorbrowser.io/sdk-reference/profiles
SDK reference for the Profiles resource (TypeScript & Python)
## Create Profile
`POST /v1/profiles` — createProfile
```typescript TypeScript theme={null}
import { client, Profiles } 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 Profiles.createProfile({
body: {
name: '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.profiles.create_profile(
name="string",
)
print(result)
```
## List Profiles
`GET /v1/profiles` — listProfiles
```typescript TypeScript theme={null}
import { client, Profiles } 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 Profiles.listProfiles();
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.profiles.list_profiles()
print(result)
```
## Get Profile
`GET /v1/profiles/{name}` — getProfile
```typescript TypeScript theme={null}
import { client, Profiles } 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 Profiles.getProfile({
path: {
name: 'your-name'
}
});
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.profiles.get_profile(
"your-name",
)
print(result)
```
## Delete Profile
`DELETE /v1/profiles/{name}` — deleteProfile
```typescript TypeScript theme={null}
import { client, Profiles } 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 Profiles.deleteProfile({
path: {
name: 'your-name'
}
});
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.profiles.delete_profile(
"your-name",
)
print(result)
```
# Recordings
Source: https://docs.anchorbrowser.io/sdk-reference/recordings
SDK reference for the Recordings resource (TypeScript & Python)
## Pause Session Recording
`POST /v1/sessions/{session_id}/recordings/pause` — pauseRecording
```typescript TypeScript theme={null}
import { client, Recordings } 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 Recordings.pauseRecording({
path: {
session_id: 'your-session-id'
}
});
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.recordings.pause_recording(
"your-session-id",
)
print(result)
```
## Resume Session Recording
`POST /v1/sessions/{session_id}/recordings/resume` — resumeRecording
```typescript TypeScript theme={null}
import { client, Recordings } 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 Recordings.resumeRecording({
path: {
session_id: 'your-session-id'
}
});
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.recordings.resume_recording(
"your-session-id",
)
print(result)
```
## List Session Recordings
`GET /v1/sessions/{session_id}/recordings` — listRecordings
```typescript TypeScript theme={null}
import { client, Recordings } 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 Recordings.listRecordings({
path: {
session_id: 'your-session-id'
}
});
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.recordings.list_recordings(
"your-session-id",
)
print(result)
```
## Get Session Recording
`GET /v1/sessions/{session_id}/recordings/primary/fetch` — fetchPrimaryRecording
```typescript TypeScript theme={null}
import { client, Recordings } 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 Recordings.fetchPrimaryRecording({
path: {
session_id: 'your-session-id'
}
});
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.recordings.fetch_primary_recording(
"your-session-id",
)
print(result)
```
## Delete Session Recording
`DELETE /v1/sessions/{session_id}/recordings/{recording_id}` — deleteRecording
```typescript TypeScript theme={null}
import { client, Recordings } 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 Recordings.deleteRecording({
path: {
session_id: 'your-session-id',
recording_id: 'your-recording-id'
}
});
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.recordings.delete_recording(
"your-session-id",
"your-recording-id",
)
print(result)
```
# Sessions
Source: https://docs.anchorbrowser.io/sdk-reference/sessions
SDK reference for the Sessions resource (TypeScript & Python)
## List Sessions History Page
`GET /v1/sessions` — listSessions
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.listSessions();
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.sessions.list_sessions()
print(result)
```
## Start Browser Session
`POST /v1/sessions` — createSession
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.createSession();
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.sessions.create_session()
print(result)
```
## Start Browser Session (async)
`POST /v1/sessions/async` — createSessionAsync
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.createSessionAsync();
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.sessions.create_session_async()
print(result)
```
## Async Session Status
`GET /v1/sessions/async/{request_id}/status` — getAsyncSessionStatus
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.getAsyncSessionStatus({
path: {
request_id: 'your-request-id'
}
});
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.sessions.get_async_session_status(
"your-request-id",
)
print(result)
```
## End All Sessions
`DELETE /v1/sessions/all` — deleteAllSessions
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.deleteAllSessions();
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.sessions.delete_all_sessions()
print(result)
```
## List All Sessions Status
`GET /v1/sessions/all/status` — getAllSessionsStatus
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.getAllSessionsStatus();
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.sessions.get_all_sessions_status()
print(result)
```
## Get Sessions History
`GET /v1/sessions/history` — getSessionsHistory
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.getSessionsHistory();
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.sessions.get_sessions_history()
print(result)
```
## Get Browser Session
`GET /v1/sessions/{session_id}` — getSession
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.getSession({
path: {
session_id: 'your-session-id'
}
});
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.sessions.get_session(
"your-session-id",
)
print(result)
```
## End Browser Session
`DELETE /v1/sessions/{session_id}` — deleteSession
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.deleteSession({
path: {
session_id: 'your-session-id'
}
});
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.sessions.delete_session(
"your-session-id",
)
print(result)
```
## Get Session Tags
`GET /v1/sessions/{session_id}/tags` — getSessionTags
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.getSessionTags({
path: {
session_id: 'your-session-id'
}
});
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.sessions.get_session_tags(
"your-session-id",
)
print(result)
```
## Put Session Tags
`PUT /v1/sessions/{session_id}/tags` — putSessionTags
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.putSessionTags({
path: {
session_id: 'your-session-id'
},
body: {
tags: ['production', 'scraping', 'customer-123']
}
});
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.sessions.put_session_tags(
"your-session-id",
tags=["production", "scraping", "customer-123"],
)
print(result)
```
## Delete Session Tags
`DELETE /v1/sessions/{session_id}/tags` — deleteSessionTags
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.deleteSessionTags({
path: {
session_id: 'your-session-id'
}
});
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.sessions.delete_session_tags(
"your-session-id",
)
print(result)
```
## Get Browser Session Pages
`GET /v1/sessions/{session_id}/pages` — getSessionPages
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.getSessionPages({
path: {
session_id: 'your-session-id'
}
});
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.sessions.get_session_pages(
"your-session-id",
)
print(result)
```
## Upload Files
`POST /v1/sessions/{sessionId}/uploads` — uploadFile
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.uploadFile({
path: {
sessionId: 'your-sessionId'
},
body: {
file: new File(['file content'], 'file.txt')
}
});
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.sessions.upload_file(
"your-session-id",
file=("file.txt", b"file content"),
)
print(result)
```
## List Session Downloads
`GET /v1/sessions/{session_id}/downloads` — getSessionDownloads
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.getSessionDownloads({
path: {
session_id: 'your-session-id'
}
});
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.sessions.get_session_downloads(
"your-session-id",
)
print(result)
```
## Take Screenshot
`GET /v1/sessions/{sessionId}/screenshot` — getSessionScreenshot
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.getSessionScreenshot({
path: {
sessionId: 'your-sessionId'
}
});
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.sessions.get_session_screenshot(
"your-session-id",
)
print(result)
```
## Mouse Click
`POST /v1/sessions/{sessionId}/mouse/click` — mouseClick
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.mouseClick({
path: {
sessionId: 'your-sessionId'
},
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.sessions.mouse_click(
"your-session-id",
)
print(result)
```
## Mouse Double Click
`POST /v1/sessions/{sessionId}/mouse/doubleClick` — mouseDoubleClick
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.mouseDoubleClick({
path: {
sessionId: 'your-sessionId'
},
body: {
x: 1,
y: 1
}
});
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.sessions.mouse_double_click(
"your-session-id",
x=1,
y=1,
)
print(result)
```
## Mouse Down
`POST /v1/sessions/{sessionId}/mouse/down` — mouseDown
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.mouseDown({
path: {
sessionId: 'your-sessionId'
},
body: {
x: 1,
y: 1
}
});
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.sessions.mouse_down(
"your-session-id",
x=1,
y=1,
)
print(result)
```
## Mouse Up
`POST /v1/sessions/{sessionId}/mouse/up` — mouseUp
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.mouseUp({
path: {
sessionId: 'your-sessionId'
},
body: {
x: 1,
y: 1
}
});
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.sessions.mouse_up(
"your-session-id",
x=1,
y=1,
)
print(result)
```
## Mouse Move
`POST /v1/sessions/{sessionId}/mouse/move` — mouseMove
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.mouseMove({
path: {
sessionId: 'your-sessionId'
},
body: {
x: 1,
y: 1
}
});
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.sessions.mouse_move(
"your-session-id",
x=1,
y=1,
)
print(result)
```
## Drag and Drop
`POST /v1/sessions/{sessionId}/drag-and-drop` — dragAndDrop
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.dragAndDrop({
path: {
sessionId: 'your-sessionId'
},
body: {
startX: 1,
startY: 1,
endX: 1,
endY: 1
}
});
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.sessions.drag_and_drop(
"your-session-id",
start_x=1,
start_y=1,
end_x=1,
end_y=1,
)
print(result)
```
## Scroll
`POST /v1/sessions/{sessionId}/scroll` — scroll
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.scroll({
path: {
sessionId: 'your-sessionId'
},
body: {
x: 1,
y: 1,
deltaY: 1
}
});
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.sessions.scroll(
"your-session-id",
x=1,
y=1,
delta_y=1,
)
print(result)
```
## Type Text
`POST /v1/sessions/{sessionId}/keyboard/type` — keyboardType
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.keyboardType({
path: {
sessionId: 'your-sessionId'
},
body: {
text: '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.sessions.keyboard_type(
"your-session-id",
text="string",
)
print(result)
```
## Keyboard Shortcut
`POST /v1/sessions/{sessionId}/keyboard/shortcut` — keyboardShortcut
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.keyboardShortcut({
path: {
sessionId: 'your-sessionId'
},
body: {
keys: ['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.sessions.keyboard_shortcut(
"your-session-id",
keys=["string"],
)
print(result)
```
## Get Clipboard Content
`GET /v1/sessions/{sessionId}/clipboard` — getClipboard
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.getClipboard({
path: {
sessionId: 'your-sessionId'
}
});
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.sessions.get_clipboard(
"your-session-id",
)
print(result)
```
## Set Clipboard Content
`POST /v1/sessions/{sessionId}/clipboard` — setClipboard
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.setClipboard({
path: {
sessionId: 'your-sessionId'
},
body: {
text: '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.sessions.set_clipboard(
"your-session-id",
text="string",
)
print(result)
```
## Copy Selected Text
`POST /v1/sessions/{sessionId}/copy` — copy
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.copy({
path: {
sessionId: 'your-sessionId'
}
});
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.sessions.copy(
"your-session-id",
)
print(result)
```
## Paste Text
`POST /v1/sessions/{sessionId}/paste` — paste
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.paste({
path: {
sessionId: 'your-sessionId'
},
body: {
text: '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.sessions.paste(
"your-session-id",
text="string",
)
print(result)
```
## Navigate to URL
`POST /v1/sessions/{sessionId}/goto` — goto
```typescript TypeScript theme={null}
import { client, Sessions } 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 Sessions.goto({
path: {
sessionId: 'your-sessionId'
},
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.sessions.goto(
"your-session-id",
url="string",
)
print(result)
```
# Tasks
Source: https://docs.anchorbrowser.io/sdk-reference/tasks
SDK reference for the Tasks resource (TypeScript & Python)
## Run a Task
`POST /v2/tasks/{taskId}/run` — runTask
```typescript TypeScript theme={null}
import { client, Tasks } 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 Tasks.runTask({
path: {
taskId: 'your-taskId'
},
body: {
input_params: {}
}
});
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.tasks.run_task(
"your-task-id",
input_params={},
)
print(result)
```
## Get Task Run Status
`GET /v2/tasks/runs/{runId}/status` — getTaskRunStatus
```typescript TypeScript theme={null}
import { client, Tasks } 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 Tasks.getTaskRunStatus({
path: {
runId: 'your-runId'
}
});
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.tasks.get_task_run_status(
"your-run-id",
)
print(result)
```
## Generate a Task
`POST /v2/tasks/generate` — generateTask
```typescript TypeScript theme={null}
import { client, Tasks } 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 Tasks.generateTask({
body: {
taskName: 'string',
taskPrompt: '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.tasks.generate_task(
task_name="string",
task_prompt="string",
)
print(result)
```
## Get Task Generation Status
`GET /v2/tasks/{taskId}/generation-status` — getTaskGenerationStatus
```typescript TypeScript theme={null}
import { client, Tasks } 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 Tasks.getTaskGenerationStatus({
path: {
taskId: 'your-taskId'
}
});
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.tasks.get_task_generation_status(
"your-task-id",
)
print(result)
```
***
# Legacy task methods
The methods below call the legacy v1 task API and are exposed through the `TasksLegacy` class. Prefer the `Tasks` methods above for new integrations.
## Create Task (Legacy)
`POST /v1/task` — createTask
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.createTask({
body: {
name: 'string',
language: 'typescript'
}
});
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.tasks_legacy.create_task(
name="string",
language="typescript",
)
print(result)
```
## List Tasks (Legacy)
`GET /v1/task` — listTasks
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.listTasks();
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.tasks_legacy.list_tasks()
print(result)
```
## Run Task (Legacy)
`POST /v1/task/run` — runAdhocTask
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.runAdhocTask({
body: {
taskId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'
}
});
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.tasks_legacy.run_adhoc_task(
task_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(result)
```
## Run Task by Name (Legacy)
`POST /v1/task/run/{taskName}` — runTaskByName
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.runTaskByName({
path: {
taskName: 'your-taskName'
},
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.tasks_legacy.run_task_by_name(
"your-task-name",
)
print(result)
```
## Get Task Metadata (Legacy)
`GET /v1/task/{taskId}` — getTask
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.getTask({
path: {
taskId: 'your-taskId'
}
});
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.tasks_legacy.get_task(
"your-task-id",
)
print(result)
```
## Update Task Metadata (Legacy)
`PUT /v1/task/{taskId}` — updateTask
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.updateTask({
path: {
taskId: 'your-taskId'
},
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.tasks_legacy.update_task(
"your-task-id",
)
print(result)
```
## Delete Task (Legacy)
`DELETE /v1/task/{taskId}` — deleteTask
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.deleteTask({
path: {
taskId: 'your-taskId'
}
});
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.tasks_legacy.delete_task(
"your-task-id",
)
print(result)
```
## List Task Versions (Legacy)
`GET /v1/task/{taskId}/versions` — listTaskVersions
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.listTaskVersions({
path: {
taskId: 'your-taskId'
}
});
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.tasks_legacy.list_task_versions(
"your-task-id",
)
print(result)
```
## Get Latest Task Version (Legacy)
`GET /v1/task/{taskId}/latest` — getLatestTaskVersion
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.getLatestTaskVersion({
path: {
taskId: 'your-taskId'
}
});
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.tasks_legacy.get_latest_task_version(
"your-task-id",
)
print(result)
```
## Get Task Draft (Legacy)
`GET /v1/task/{taskId}/draft` — getTaskDraft
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.getTaskDraft({
path: {
taskId: 'your-taskId'
}
});
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.tasks_legacy.get_task_draft(
"your-task-id",
)
print(result)
```
## Create or Update Task Draft (Legacy)
`POST /v1/task/{taskId}/draft` — saveTaskDraft
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.saveTaskDraft({
path: {
taskId: 'your-taskId'
},
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.tasks_legacy.save_task_draft(
"your-task-id",
code="string",
)
print(result)
```
## Deploy Task (Legacy)
`POST /v1/task/{taskId}/deploy` — deployTask
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.deployTask({
path: {
taskId: 'your-taskId'
},
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.tasks_legacy.deploy_task(
"your-task-id",
)
print(result)
```
## List Task Executions (Legacy)
`GET /v1/task/{taskId}/executions` — listTaskExecutions
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.listTaskExecutions({
path: {
taskId: 'your-taskId'
}
});
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.tasks_legacy.list_task_executions(
"your-task-id",
)
print(result)
```
## Get Task Execution Result (Legacy)
`GET /v1/task/{taskId}/executions/{executionId}` — getTaskExecution
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.getTaskExecution({
path: {
taskId: 'your-taskId',
executionId: 'your-executionId'
}
});
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.tasks_legacy.get_task_execution(
"your-task-id",
"your-execution-id",
)
print(result)
```
## Get Task Version (Legacy)
`GET /v1/task/{taskId}/{taskVersion}` — getTaskVersion
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.getTaskVersion({
path: {
taskId: 'your-taskId',
taskVersion: 'your-taskVersion'
}
});
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.tasks_legacy.get_task_version(
"your-task-id",
"your-task-version",
)
print(result)
```
## Publish Task Version (Legacy)
`POST /v1/task/{taskId}/{taskVersion}` — publishTaskVersion
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.publishTaskVersion({
path: {
taskId: 'your-taskId',
taskVersion: 'your-taskVersion'
},
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.tasks_legacy.publish_task_version(
"your-task-id",
"your-task-version",
)
print(result)
```
## Delete Task Version (Legacy)
`DELETE /v1/task/{taskId}/{taskVersion}` — deleteTaskVersion
```typescript TypeScript theme={null}
import { client, TasksLegacy } 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 TasksLegacy.deleteTaskVersion({
path: {
taskId: 'your-taskId',
taskVersion: 'your-taskVersion'
}
});
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.tasks_legacy.delete_task_version(
"your-task-id",
"your-task-version",
)
print(result)
```
# Tools
Source: https://docs.anchorbrowser.io/sdk-reference/tools
SDK reference for the Tools resource (TypeScript & Python)
## Perform Web Task
`POST /v1/tools/perform-web-task` — performWebTask
```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)
```
## Get Perform Web Task Status
`GET /v1/tools/perform-web-task/{workflowId}/status` — getPerformWebTaskStatus
```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)
```
## Execute Code Snippet
`POST /v1/tools/execute-code` — executeCode
```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)
```
## Web Unlocker
`POST /v1/tools/fetch/webpage` — fetchWebpage
```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)
```
## Screenshot Webpage
`POST /v1/tools/screenshot` — screenshotWebpage
```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)
```
## Get Page PDF
`POST /v1/tools/page-pdf` — createPagePdf
```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)
```
# Volumes
Source: https://docs.anchorbrowser.io/sdk-reference/volumes
SDK reference for the Volumes resource (TypeScript & Python)
## Create Volume
`POST /v1/volumes` — createVolume
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.createVolume({
body: {
name: 'customer-reports'
}
});
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.volumes.create_volume(
name="customer-reports",
)
print(result)
```
## List Volumes
`GET /v1/volumes` — listVolumes
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.listVolumes();
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.volumes.list_volumes()
print(result)
```
## Get Volume By Name
`GET /v1/volumes/by-name/{name}` — getVolumeByName
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.getVolumeByName({
path: {
name: 'your-name'
}
});
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.volumes.get_volume_by_name(
"your-name",
)
print(result)
```
## Get Volume
`GET /v1/volumes/{volume_id}` — getVolume
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.getVolume({
path: {
volume_id: 'your-volume-id'
}
});
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.volumes.get_volume(
"your-volume-id",
)
print(result)
```
## Delete Volume
`DELETE /v1/volumes/{volume_id}` — deleteVolume
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.deleteVolume({
path: {
volume_id: 'your-volume-id'
}
});
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.volumes.delete_volume(
"your-volume-id",
)
print(result)
```
## List Files
`GET /v1/volumes/{volume_id}/files` — listFiles
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.listFiles({
path: {
volume_id: 'your-volume-id'
}
});
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.volumes.list_files(
"your-volume-id",
)
print(result)
```
## Upload File
`POST /v1/volumes/{volume_id}/files` — uploadFile
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.uploadFile({
path: {
volume_id: 'your-volume-id'
},
body: {
file: new File(['file content'], 'file.txt')
}
});
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.volumes.upload_file(
"your-volume-id",
file=("file.txt", b"file content"),
)
print(result)
```
## Delete Files
`DELETE /v1/volumes/{volume_id}/files` — deleteFiles
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.deleteFiles({
path: {
volume_id: 'your-volume-id'
}
});
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.volumes.delete_files(
"your-volume-id",
)
print(result)
```
## Create Upload URL
`POST /v1/volumes/{volume_id}/files/upload-url` — createUploadUrl
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.createUploadUrl({
path: {
volume_id: 'your-volume-id'
},
body: {
path: 'inputs/dataset.csv'
}
});
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.volumes.create_upload_url(
"your-volume-id",
path="inputs/dataset.csv",
)
print(result)
```
## Get File Info
`GET /v1/volumes/{volume_id}/files/stat` — getFileInfo
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.getFileInfo({
path: {
volume_id: 'your-volume-id'
},
query: {
path: 'downloads/report.pdf'
}
});
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.volumes.get_file_info(
"your-volume-id",
path="downloads/report.pdf",
)
print(result)
```
## Download File
`GET /v1/volumes/{volume_id}/files/download` — getDownloadUrl
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.getDownloadUrl({
path: {
volume_id: 'your-volume-id'
},
query: {
path: 'downloads/report.pdf'
}
});
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.volumes.get_download_url(
"your-volume-id",
path="downloads/report.pdf",
)
print(result)
```
## List All Paths
`GET /v1/volumes/{volume_id}/paths` — listPaths
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.listPaths({
path: {
volume_id: 'your-volume-id'
}
});
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.volumes.list_paths(
"your-volume-id",
)
print(result)
```
## Create Directory
`POST /v1/volumes/{volume_id}/directories` — createDirectory
```typescript TypeScript theme={null}
import { client, Volumes } 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 Volumes.createDirectory({
path: {
volume_id: 'your-volume-id'
},
body: {
path: 'reports/2026'
}
});
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.volumes.create_directory(
"your-volume-id",
path="reports/2026",
)
print(result)
```
# Webhooks
Source: https://docs.anchorbrowser.io/sdk-reference/webhooks
SDK reference for the Webhooks resource (TypeScript & Python)
## Create Webhook
`POST /v1/webhooks` — createWebhook
```typescript TypeScript theme={null}
import { client, Webhooks } 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 Webhooks.createWebhook({
body: {
url: 'https://your-app.example.com/anchor/webhooks',
subscribed_events: ['task.completed']
}
});
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.webhooks.create_webhook(
url="https://your-app.example.com/anchor/webhooks",
subscribed_events=["task.completed"],
)
print(result)
```
## List Webhooks
`GET /v1/webhooks` — listWebhooks
```typescript TypeScript theme={null}
import { client, Webhooks } 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 Webhooks.listWebhooks();
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.webhooks.list_webhooks()
print(result)
```
## Get Webhook
`GET /v1/webhooks/{id}` — getWebhook
```typescript TypeScript theme={null}
import { client, Webhooks } 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 Webhooks.getWebhook({
path: {
id: 'your-id'
}
});
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.webhooks.get_webhook(
"your-id",
)
print(result)
```
## Update Webhook
`PATCH /v1/webhooks/{id}` — updateWebhook
```typescript TypeScript theme={null}
import { client, Webhooks } 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 Webhooks.updateWebhook({
path: {
id: 'your-id'
},
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.webhooks.update_webhook(
"your-id",
)
print(result)
```
## Delete Webhook
`DELETE /v1/webhooks/{id}` — deleteWebhook
```typescript TypeScript theme={null}
import { client, Webhooks } 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 Webhooks.deleteWebhook({
path: {
id: 'your-id'
}
});
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.webhooks.delete_webhook(
"your-id",
)
print(result)
```
## Rotate Webhook Signing Secret
`POST /v1/webhooks/{id}/rotate-secret` — rotateWebhookSecret
```typescript TypeScript theme={null}
import { client, Webhooks } 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 Webhooks.rotateWebhookSecret({
path: {
id: 'your-id'
}
});
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.webhooks.rotate_webhook_secret(
"your-id",
)
print(result)
```
## Send Test Event
`POST /v1/webhooks/{id}/test` — sendWebhookTestEvent
```typescript TypeScript theme={null}
import { client, Webhooks } 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 Webhooks.sendWebhookTestEvent({
path: {
id: 'your-id'
},
body: {
event_type: 'task.completed'
}
});
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.webhooks.send_webhook_test_event(
"your-id",
event_type="task.completed",
)
print(result)
```
## List Webhook Deliveries
`GET /v1/webhooks/{id}/events` — listWebhookEvents
```typescript TypeScript theme={null}
import { client, Webhooks } 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 Webhooks.listWebhookEvents({
path: {
id: 'your-id'
}
});
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.webhooks.list_webhook_events(
"your-id",
)
print(result)
```