---
title: "Browser Agent: Headless Browser for AI Agents"
description: "A browser agent for pages that block a plain fetch: read free first, then open a headless browser session, priced per step. Six jobs, one real run for $0.0814."
canonical: "https://dev.monid.ai/tutorial/how-to-monid-browser-automation"
---

# How do I read a page that blocks a plain fetch?

> A browser agent for pages that block a plain fetch: read free first, then open a headless browser session, priced per step. Six jobs, one real run for $0.0814.

- Web page: https://dev.monid.ai/tutorial/how-to-monid-browser-automation
- Tools for this job: [Browser Automation](https://dev.monid.ai/tools/browser-automation.md)

## Set up

Paste this to your agent once. It installs the Monid skill and asks for an API key from app.monid.ai.

```text
set up https://monid.ai/SKILL.md
```

## Jobs

Each job is a sentence to paste into your agent. Replace the parts in angle brackets.

### 1. Read a page that JavaScript builds

Ask your agent:

```text
read <url> with tinyfish on monid and give me the items on it. it is a page where nothing is in the html until javascript runs, so tell me how many items came back with real values in them. do not judge it by the byte count or by the status: judge it by whether the fields are populated
```

Listed price: $0.00 ten items, rendered.

Endpoints for this job:

- [`tinyfish /fetch`](https://dev.monid.ai/tools/tinyfish.md), $0.00 (the one this guide ran)
- `context.dev /web/extract`, $0.02533 (the one this guide ran)
- `context.dev /web/scrape/markdown`, $0.002533 (the one this guide ran)
- `x402.browserbase.com /fetch`, $0.011 (the one this guide ran)

What a real run returned:

- **the comparison**: on one page the $0.011 route and plain curl returned the same 5,806 bytes and a string equality check said true; on another the bytes differed by 367 and nothing had rendered either way
- **what that means**: the script that builds the page was still sitting there unexecuted, so an agent that strips tags and reads text gets nothing back
- **the free one**: returned all ten items as 1,080 bytes of clean markdown, which is the whole job, for $0.0000
- **do not diff the bytes**: that 367-byte gap was a CDN performance beacon injected because the request looked like a browser, so on any fronted site the byte check reports a difference that means nothing
- **the rule**: count the populated fields. Both routes answered HTTP 200 on both pages, and on two different targets the paid one rendered 0 of 12 and 0 of 10

### 2. When the free read comes back empty

Ask your agent:

```text
read <url> with tinyfish on monid first, then check whether the fields i asked for actually came back with values. escalate to mrscraper with browserRendering and super set to true whenever they did not, whether that is a 403, a challenge page, or a 200 whose values are still placeholders. do not send every url through the stealth route: escalate on an empty answer, not on the batch
```

Listed price: $0.012 only on the ones that block.

Endpoints for this job:

- [`tinyfish /fetch`](https://dev.monid.ai/tools/tinyfish.md), $0.00 (the one this guide ran)
- [`mrscraper /scrape/html`](https://dev.monid.ai/tools/mrscraper.md), $0.001 / result (the one this guide ran)
- `context.dev /web/scrape/markdown`, $0.002533 (the one this guide ran)
- `x402.browserbase.com /fetch`, $0.011 (the one this guide ran)

What a real run returned:

- **the honest failure**: on one walled site the free route returned a 403 inside an errors array with no results and billed $0.0000, which is exactly the signal an escalation needs
- **the failure with no signal**: on another it walked through the wall and answered 200 with an empty errors array, a real page title and a real result count, and one listing where there were sixty-two prices, the rest still reading Loading
- **so check the yield**: a status code cannot tell those two apart; only counting the values you asked for can, which is why the sentence escalates on an empty answer rather than on a 403
- **what got through**: the stealth route returned the real page both times, 1.2 MB on one and 62 prices against 9 listings on the other
- **what it really costs**: its listed $0.001 per result is a token unit, not an estimate: two runs billed $0.012 and $0.034, so budget an order of magnitude above the sticker

### 3. Take a picture of the page

Ask your agent:

```text
screenshot <url> with context.dev on monid at full page. it returns a hosted image url rather than the bytes, so fetch that url separately if you need the file itself
```

Listed price: $0.0045 one full-page capture.

Endpoints for this job:

- `context.dev /web/screenshot`, $0.012665 (the one this guide ran)
- [`mrscraper /scrape/screenshot`](https://dev.monid.ai/tools/mrscraper.md), $0.001 / result
- [`tinyfish /fetch`](https://dev.monid.ai/tools/tinyfish.md), $0.00 (the one this guide ran)

What a real run returned:

- **what came back**: a 1920 by 1698 full-page PNG with the JavaScript-built cards fully drawn, which is independent proof that a real browser ran
- **what you get in the response**: 329 bytes of JSON holding a url on a third-party CDN, not the image; the file itself was 163,588 bytes on a second, unbilled fetch
- **the retention**: no stated lifetime on that hosted url, so download it in the same run if you need to keep it
- **the aisle it is not in**: the browser aisle has no screenshot endpoint at all; this one lives next door

### 4. Typed values, or a regex over free text

Ask your agent:

```text
extract <fields> from <url> with context.dev on monid, passing a json schema and factCheck true. use this when you want typed values and a stable shape rather than text you have to pattern-match; if a four-line regex over the free markdown already gets you the fields, take the free one
```

Listed price: $0.009 per call, any schema size.

Endpoints for this job:

- `context.dev /web/extract`, $0.02533 (the one this guide ran)
- [`tinyfish /fetch`](https://dev.monid.ai/tools/tinyfish.md), $0.00 (the one this guide ran)
- `context.dev /web/scrape/markdown`, $0.002533 (the one this guide ran)

What a real run returned:

- **what it gives you**: every item in exactly the requested shape with the numbers as numbers, so a price is 52 rather than the string $52.00, and the shape does not move when the page's layout does
- **when the free route is enough**: on one page markdown flattening dropped every tag array; on another it kept all twelve items and both fields, and four lines of adjacency matching recovered them exactly. Check before you pay
- **the honest price**: $0.009 a call whatever the schema. The thing you are buying is not completeness, it is not having to write and keep a pattern per site
- **the grounding flag**: factCheck true forces every value back to text that is actually on the page, which is the difference between extraction and invention

### 5. Search the live web and read the results

Ask your agent:

```text
search the web for <query> with tinyfish on monid and give me the results with their snippets, then fetch the ones worth reading in one call rather than one call each
```

Listed price: $0.00 ten results with snippets.

Endpoints for this job:

- [`tinyfish /search`](https://dev.monid.ai/tools/tinyfish.md), $0.00 (the one this guide ran)
- `x402.browserbase.com /search`, $0.011 (the one this guide ran)
- [`tinyfish /fetch`](https://dev.monid.ai/tools/tinyfish.md), $0.00 (the one this guide ran)

What a real run returned:

- **the difference**: one returned a position, a site name, a snippet, a title and a url on every row; the other returned an id, a url and a title, with two titles empty
- **why the snippet decides it**: without one you have to fetch all ten urls to know which is worth reading, and the second half of the job is reading them
- **what that costs**: the paid search plus ten paid fetches is $0.121 a query; the free search plus a free multi-url fetch is $0.0000
- **the batching**: the free fetch takes up to ten urls in a single call, so a hundred pages is ten calls, still free

### 6. Click, type and log in

Ask your agent:

```text
create a browserbase session with monid and connect to the connectUrl ONCE, with playwright's connectOverCDP, and do all your work in that one attach. do not test the socket first and do not close and reopen: the session dies on the first detach and the paid time left on it is forfeit
```

Listed price: $0.011 five paid minutes.

Endpoints for this job:

- `x402.browserbase.com /browser/session/create`, $0.011 (the one this guide ran)
- [`tinyfish /fetch`](https://dev.monid.ai/tools/tinyfish.md), $0.00 (the one this guide ran)
- [`mrscraper /scrape/html`](https://dev.monid.ai/tools/mrscraper.md), $0.001 / result (the one this guide ran)

What a real run returned:

- **it is a real browser**: a WebSocket handshake answers HTTP 101 and Playwright's connectOverCDP drives it, twelve items off a JavaScript page on the first attach
- **what Monid sells you**: the browser, not the driving: the session comes with a live view url and an auth token, and the steps are yours to write
- **one attach, not five minutes**: after a clean close, reconnecting 4 minutes 41 seconds before the stated expiry answered 410 Gone, session not running. Even a bare handshake to check the socket burns it. Connect once and stay
- **it is not a way past a wall**: a browser you drive yourself got the same 403 on a protected site that everything else did; a real browser and a stealth route are different products

## More

- [Every how-to guide](https://dev.monid.ai/tutorial.md)
- [Connect an agent to Monid](https://dev.monid.ai/index.md)
