# AI Browser Agent — Web Automation & JSON Extraction (`newpo/ai-browser-agent`) Actor

About 4× faster AI browser agent: give a URL and a plain-English task. It clicks, fills and submits forms, logs in with 2FA, uploads files and returns the answer plus structured JSON in your schema. Median task 13 s. No LLM API key needed. $0.01 per step.

- **URL**: https://apify.com/newpo/ai-browser-agent.md
- **Developed by:** [newpo](https://apify.com/newpo) (community)
- **Categories:** AI, Agents, Automation
- **Features:** Limited permissions
- **Stats:** 10 total users, 6 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Browser Agent: web automation and JSON extraction in plain English

**AI Browser Agent** automates any website from a plain-English instruction. Give it a start URL and a task such as
*"log in and download last month's invoice total"*, *"fill this job application"* or *"get the first 20 products
with price and rating as JSON"*. It runs a real Chrome browser that clicks, types, picks from dropdowns, fills
and submits forms, logs in with two-factor authentication and uploads files. It returns the answer, plus
**structured JSON in your own schema** when you ask for it.

It's like *browser use* or *computer use*, but you don't need your own OpenAI, Anthropic or Gemini API key: the AI
is included in the price. You pay **$0.01 per browser step**.

**About 4× faster and 3× cheaper than a leading Apify browser agent.** In our head-to-head test (below), the median
task took **13 s instead of 50 s** and cost **$0.08 instead of $0.23**. It passed 12/12 tasks; the other agent
passed 11/12.

### Why this browser agent

- ⚡ **Fast.** A small decision model picks each action in about half a second, and a language model steps in only
  when that model is unsure. The browser starts in seconds. A typical task takes 7–30 seconds end to end.
- 💸 **Cheap and predictable.** You pay per step. Simple lookups cost about **$0.03–0.06** and full forms and logins
  about **$0.08–0.20**. The agent never goes over your maximum cost per run.
- 🧾 **Structured output.** Pass an output schema and you get validated JSON back in `data`. Without one, `data` is
  `null`.
- 🔐 **Safe logins.** Passwords and TOTP seeds are encrypted inputs. The AI sees only their names, and the browser
  types them only on the sites you allow.
- ✅ **Checks before submitting.** The agent compares form values with your task before it clicks submit. It
  catches wrong pre-filled values that the site would quietly accept.
- 📎 **File uploads.** Give it a few files and it picks the right one for each upload field (your CV, not your tax
  return).

### Speed benchmark: AI Browser Agent vs a leading Apify browser agent

Both agents ran the same six public tasks at the same moment, twice each, on 2026-10-10, with default settings.
Time is end to end: from starting the run through the Apify API to getting the result. Cost is what a
Starter-plan user is charged per run.

| Task | AI Browser Agent | Leading browser agent | Faster by |
|---|---|---|---|
| Hacker News top story | **6.8 s** · $0.03 | 22.5 s · $0.04 | 3.3× |
| Book page two clicks deep (UPC) | **9.9 s** · $0.05 | 63.7 s · $0.10 | 6.4× |
| Wikipedia search and read | **13.1 s** · $0.05 | 79.5 s · $0.11 | 6.1× |
| Book price lookup | **19.4 s** · $0.03 | 38.2 s · $0.04 | 2.0× |
| Log in, then read the page | **24.1 s** · $0.07 | 52.7 s · $0.11 | 2.2× |
| 3-step insurance quote form (17 fields) | **27.3 s** · $0.23 | 199.6 s · $0.99 | 7.3× |
| **All 12 runs** | **median 13.0 s · avg $0.08 · 12/12 passed** | median 49.5 s · avg $0.23 · 11/12 passed | **3.8×** |

Why it's faster:

- The browser is ready in a few seconds.
- A small decision model picks each action in about half a second; a language model is called only when that model
  is unsure.
- Simple answers come straight from the page, without extra planning rounds.

If a site has strong bot protection, add a residential proxy.

### Use cases

- **Form automation**: contact forms, quote requests, job applications, sign-ups, multi-step wizards
- **Logged-in portals**: read order status, balances or reports from accounts behind a login with 2FA
- **AI web scraping**: pull listings, prices, tables or details into JSON without writing CSS selectors
- **QA and monitoring**: check that a checkout, sign-up or search flow still works; the final screenshot is saved
- **AI agents and LLM apps**: give your agent a browser tool through the Apify API, MCP or integrations

### How to use it

1. Enter a **Task** in plain English. Say what you want back.
2. Enter the **Start URL**.
3. Optional: add an **output data schema**, **credentials**, **files** to upload, or a **proxy**.
4. Click **Start**. The result appears in the dataset (and as `OUTPUT` in the key-value store).

#### Input example

```json
{
  "task": "Open the Mystery category and get the first 5 books",
  "startUrl": "https://books.toscrape.com/",
  "outputSchema": { "books": [{ "title": "string", "price_gbp": "number", "in_stock": "boolean" }] },
  "maxSteps": 50
}
```

| Field | Description |
|---|---|
| `task` | What to do. Say what answer you want back. |
| `startUrl` | The first page to open. |
| `mode` | `fast` (default): quickest and cheapest. `accurate`: when unsure the agent also looks at a screenshot of the page, and it can run read-only code to read data — higher success on hard sites, date pickers and long tables, +$0.01 per step. |
| `maxSteps` | Maximum number of browser actions (1–50, default 50). You pay only for steps actually taken. |
| `outputSchema` | Optional. A JSON Schema, or the shorthand `{"field": "string\|number\|boolean", "list": [{...}]}`. |
| `credentials` | *Encrypted.* `[{ "name", "kind": "username\|password\|text\|totp", "value", "origins": ["https://site.com"] }]` |
| `files` | `[{ "url", "name", "description" }]`, up to 5 files of 10 MB each |
| `proxyConfiguration` | Optional Apify Proxy (datacenter included; residential has a surcharge) or your own proxies |
| `screenshot` | Save a PNG of the final page (default on) |

#### Output example

```json
{
  "status": "done",
  "succeeded": true,
  "answer": "The first 5 books in Mystery are Sharp Objects, In a Dark, Dark Wood, ...",
  "data": {
    "books": [
      { "title": "Sharp Objects", "price_gbp": 47.82, "in_stock": true },
      { "title": "The Past Never Ends", "price_gbp": 56.5, "in_stock": true }
    ]
  },
  "finalUrl": "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html",
  "stepCount": 2,
  "durationSec": 9.4,
  "steps": [{ "step": 1, "action": "click:e57", "description": "click link \"Mystery\"", "confidence": 0.99 }],
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/.../records/final-screenshot"
}
```

What the fields mean:

- **`data`** is JSON matching your `outputSchema`. If you didn't give a schema but the task describes a JSON format
  (for example *"return JSON with keys title, price, upc"*), `data` follows that format. Otherwise it is `null`.
  Values come only from the pages the agent visited, and anything it couldn't find is `null`. If extraction fails,
  `dataError` explains why.
- **`succeeded`** says whether the task was actually accomplished. The agent can finish and report that something
  couldn't be done.
- **`status`** is one of:
  - `done`: the task finished
  - `max_steps`: the step limit was reached
  - `budget_limit`: your maximum cost per run was reached
  - `failed`: a CAPTCHA or another human-only step blocked the agent
  - `error`: something else went wrong

### Pricing

Pay per event, with no subscription and no LLM key needed:

| Event | Price |
|---|---|
| Task started (browser launch) | $0.02 |
| Agent step (one browser action: click, type, select, upload, navigate, answer) | $0.01 |
| Residential proxy surcharge (per step, only with the `RESIDENTIAL` group) | $0.02 |
| Accurate mode surcharge (per step, only with `mode: "accurate"`) | $0.01 |

| Example task | Steps | Cost |
|---|---|---|
| Answer a question from a page | 1–3 | $0.03–0.05 |
| Search a site and read a result | 5–9 | $0.07–0.11 |
| Log in with 2FA and read account data | 6–10 | $0.08–0.12 |
| Fill and submit a long job application with a CV upload | 15–20 | $0.17–0.22 |

Structured JSON output is included at no extra charge. A step starts only if your **maximum cost per run** can
still pay for it. Steps that fail because of our AI model provider are not charged.

### FAQ

**Do I need an OpenAI, Anthropic or Gemini API key?** No. The AI models are included in the per-step price.

**Can it log in to websites?** Yes. Add the username and password as encrypted `credentials` and list the sites
where they may be used. For two-factor authentication, add the TOTP seed (`kind: "totp"`) and the agent types the
current 6-digit code. Codes sent by SMS or e-mail can't be read.

**Can it solve CAPTCHAs?** No. For sites with heavy bot protection, try the residential proxy.

**How do I get JSON instead of text?** Set `outputSchema`, or describe the JSON you want in the task.

**How do I run many tasks?** Start one run per task through the Apify API or a schedule. Runs execute in parallel.

**Can I use it from my own AI agent?** Yes, through the Apify API, the Apify MCP server, or the integrations for
Make, Zapier, n8n, LangChain and others.

### Limits

- One task per run, up to 50 steps
- No CAPTCHA solving and no SMS or e-mail codes
- Files for upload must be reachable by URL (up to 5 files, 10 MB each)

# Actor input Schema

## `task` (type: `string`):

What the agent should do, in plain English. Be specific about the answer you want back, e.g. "Find the price and stock status of 'A Light in the Attic'" or "Fill the contact form with name Jane Doe, email jane@example.com, message 'Hi'". Logins can be written in the task ("log in with user demo / password demo123"); for real accounts prefer the encrypted Credentials field.

## `startUrl` (type: `string`):

The page the agent opens first.

## `mode` (type: `string`):

Fast (default) suits lookups, searches and forms. Accurate also looks at a screenshot of the page when unsure and can run read-only code to read data: higher success on hard sites, date pickers and long tables (53% vs 48% of tasks on our 78-task real-site benchmark), for an extra $0.01 per step.

## `maxSteps` (type: `integer`):

Upper bound on browser actions. You pay only for steps actually taken; this caps the cost of a run. Most tasks need 2–20.

## `outputSchema` (type: `object`):

Get structured JSON back in the `data` field. Use a JSON Schema, or the shorthand {"title": "string", "price": "number", "tags": \["string"]}. Values are taken only from the pages the agent visited (missing ones are null) and validated against the schema. Leave empty for no structured output (data: null) — or simply describe the JSON you want in the task.

## `credentials` (type: `array`):

Optional logins. Values are never shown to the AI — it only sees the names — and are typed only on the listed origins. kind: username | password | text | totp (base32 seed; the current 6-digit code is typed). Example: \[{"name":"github_user","kind":"username","value":"me","origins":\["https://github.com"]},{"name":"github_pw","kind":"password","value":"…","origins":\["https://github.com"]}]

## `files` (type: `array`):

Optional files the agent may upload into file inputs (e.g. a CV). The agent picks the right one by name and description. Items: {"url": "https://…", "name": "resume.pdf", "description": "my CV"}. Max 5 files, 10 MB each.

## `proxyConfiguration` (type: `object`):

Optional. Datacenter proxy is included in the step price; RESIDENTIAL adds a per-step surcharge.

## `screenshot` (type: `boolean`):

Store a PNG of the last page in the key-value store and link it in the result.

## Actor input object example

```json
{
  "task": "Find the price of the book 'A Light in the Attic' and whether it is in stock.",
  "startUrl": "https://books.toscrape.com/",
  "mode": "fast",
  "maxSteps": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "screenshot": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `output` (type: `string`):

No description

## `screenshot` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "task": "Find the price of the book 'A Light in the Attic' and whether it is in stock.",
    "startUrl": "https://books.toscrape.com/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("newpo/ai-browser-agent").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "task": "Find the price of the book 'A Light in the Attic' and whether it is in stock.",
    "startUrl": "https://books.toscrape.com/",
}

# Run the Actor and wait for it to finish
run = client.actor("newpo/ai-browser-agent").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "task": "Find the price of the book '\''A Light in the Attic'\'' and whether it is in stock.",
  "startUrl": "https://books.toscrape.com/"
}' |
apify call newpo/ai-browser-agent --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,newpo/ai-browser-agent"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/p7msH5weklHDZFhH3/builds/dmAiLOh52CaDz8f9r/openapi.json
