---
title: "URL to Markdown: Web Scraping API for AI Agents"
description: "URL to markdown for your AI agent: a web scraping API that tries the cheap extractor first and escalates on a thin answer. Four real pages for $0.1236."
canonical: "https://dev.monid.ai/tutorial/how-to-monid-web-extraction"
---

# How do I read any web page as clean text?

> URL to markdown for your AI agent: a web scraping API that tries the cheap extractor first and escalates on a thin answer. Four real pages for $0.1236.

- Web page: https://dev.monid.ai/tutorial/how-to-monid-web-extraction
- Tools for this job: [Web Extraction](https://dev.monid.ai/tools/web-extraction.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. One URL as clean markdown

Ask your agent:

```text
read <url> as markdown with context.dev on monid and keep the code blocks, then count the fenced blocks against the page and tell me the number. do not judge it by the character count: link syntax and page chrome are included by default and can make the output larger than the visible text
```

Listed price: $0.0009 per page.

Endpoints for this job:

- `context.dev /web/scrape/markdown`, $0.002533 (the one this guide ran)
- [`octen /extract`](https://dev.monid.ai/tools/octen.md), $0.001 / result (the one this guide ran)
- [`mrscraper /scrape/markdown`](https://dev.monid.ai/tools/mrscraper.md), $0.001 / result
- [`firecrawl /scrape`](https://dev.monid.ai/tools/firecrawl.md), $0.001 to $0.004
- `api.strale.io /x402/url-to-markdown`, $0.0594 (the one this guide ran)

What a real run returned:

- **the cheap one**: 15,312 characters with all three code samples intact, plus the page metadata
- **the 66x one**: 9,948 characters and every code fence stripped to prose
- **what that means**: on a documentation page, the expensive extractor lost exactly the part you came for
- **count blocks, not characters**: on a second page all 32 code blocks came back and twenty sampled ones were verbatim, while the character count was 74% larger than the visible text because link markup and chrome are on by default and made up two fifths of the output
- **and the length field is bytes**: the endpoint's own content length is counted in utf-8 bytes rather than characters, so it will not match a character count either
- **the tie**: on a news article the cheap one and a near-free one returned the same text, neither blocked

### 2. Search, then read the top sources

Ask your agent:

```text
search for <question> with context.dev on monid and read the top ten results in the same call, turning the markdown option on explicitly. without it the response carries ten results and not one character of page text, and it bills the same. tell me which came back empty so i know what i paid for
```

Listed price: $0.0009 ten results, searched and read.

Endpoints for this job:

- `context.dev /web/search`, $0.000253 / result (the one this guide ran)
- [`tinyfish /search`](https://dev.monid.ai/tools/tinyfish.md), $0.00
- [`litescrape /google/search`](https://dev.monid.ai/tools/litescrape.md), $0.00015
- [`exa /search`](https://dev.monid.ai/tools/exa.md), $0.001 to $0.007

What a real run returned:

- **the flow**: ten results found and their pages read in one call, from 11 characters to 50,718
- **the noise**: two of the ten were empty in practice: an eleven-character stub and a login wall
- **billed anyway**: both empty results were charged as normal hits, so about a fifth of the spend bought nothing
- **off by default, and it bills anyway**: without the markdown option the ten results came back with a null body and a not-requested code, zero characters of text, at the same $0.0009
- **the surprise**: reading the pages was not metered separately from the search, despite the catalog note

### 3. Crawl a section of a site

Ask your agent:

```text
crawl <url> with context.dev on monid, five pages maximum, AND pass a url pattern restricting it to that path. without one it leaves the section on the first hop and still reports every page as a success. then read back the urls it actually fetched
```

Listed price: $0.0045 five pages.

Endpoints for this job:

- `context.dev /web/crawl`, $0.002533 / result (the one this guide ran)
- `context.dev /web/scrape/sitemap`, $0.002533
- [`firecrawl /crawl`](https://dev.monid.ai/tools/firecrawl.md), $0.001 to $0.004
- [`ahrefs /site-explorer/crawled-pages`](https://dev.monid.ai/tools/ahrefs.md), $0.00387 / result

What a real run returned:

- **the result**: five of five pages fetched, none failed, between 4,530 and 15,823 characters each
- **it leaves on the first hop**: on a second site a naive five-page crawl fetched the seed and then four pages outside the path, none of them in the section asked for, and reported five succeeded and none failed
- **the parameter that fixes it**: a url pattern keeps all five inside the prefix; it is not in any of these sentences by default and it is fiddly to quote on a shell, so pass it from a file
- **the drift**: the docs domain had migrated, so one hop out the crawl left the section entirely
- **what to do**: cap the pages, then read back the urls before trusting the set
- **the cheaper step**: if you only need the list of urls, the sitemap call is one flat $0.0009

### 4. Turn a page into structured fields

Ask your agent:

```text
extract <schema> from <url> with context.dev on monid with maxPages set to 1, and do NOT turn fact checking on: with it off an absent field came back empty, and with it on the same field came back as a string and a missing price came back as zero. check the cache age before you trust anything, and treat any zero as unverified
```

Listed price: $0.009 flat, per page.

Endpoints for this job:

- `context.dev /web/extract`, $0.02533 (the one this guide ran)
- [`mrscraper /scrape/extract`](https://dev.monid.ai/tools/mrscraper.md), $0.001 / result (the one this guide ran)
- `api.strale.io /x402/web-extract`, $0.1782

What a real run returned:

- **fact checking does not do what it says**: asked for two fields a page genuinely does not contain, it returned a five-character string where a phone number should be and a zero where a free-trial count should be, both of which read as real values downstream
- **and a zero price is the dangerous one**: it reported a monthly price of 0 for an enterprise plan whose own page says the price is custom; re-running with the cache disabled produced the identical invention, so it is not a stale answer
- **off is safer than on**: with the flag omitted the same absent field came back as an empty string, which is the honest answer; turning it on is what produced the fabrications
- **the schema way**: 17 rows, one of them left blank on purpose because the page did not support a value
- **the prompt way**: 55 rows with invented identifiers and duplicates no field could tell apart
- **the hidden price**: that one billed $0.038 against a $0.001 catalog rate, because browser rendering was on
- **it crawls, it does not read one page**: this endpoint defaults to five pages and follows links, so a second run's analysed urls included two product pages nobody asked for and the field list filled with rows from them; set the page count to one if you mean one page
- **the cache**: the clean answer came from a cache almost six days old, with no warning a normal caller would see

### 5. A brand's identity from its domain

Ask your agent:

```text
get the brand profile for <domain> with context.dev on monid: name, description, colours, logos and socials. tell me which fields came back empty
```

Listed price: $0.009 per domain.

Endpoints for this job:

- `context.dev /brand/retrieve`, $0.02533 (the one this guide ran)
- [`hunterio /companies/find`](https://dev.monid.ai/tools/hunterio.md), $0.0049
- [`contactout /v1/domain/enrich`](https://dev.monid.ai/tools/contactout.md), $0.02 / result
- [`ploid /socials`](https://dev.monid.ai/tools/ploid.md), $0.10 / result

What a real run returned:

- **what came back**: the title, description, slogan, four brand colours and two logo variants with their own palettes
- **and more**: a head office country, three social profiles and a headcount both as a range and an exact figure
- **it can invent a contact**: on a second domain the email field came back as a plausible address at that company's domain, assembled from a demo persona the company publishes with a different domain; treat any contact from here as unverified
- **and it cannot be read fresh**: this endpoint's cache defaults to three months and clamps to a one-day floor, so there is no way to ask it for today
- **the gaps**: the email came back as an empty string and three link fields were null, though all three pages exist
- **the use**: this is the cheapest way to skin a page or a deck in someone else's brand without asking them for a kit

## More

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