# Harvest a site

> Collect a whole site or one section into a dataset; Writ picks how to read each page and prices it per page.

Source: https://usewrit.app/docs/crawl/

Give Harvest a site and say what you want from it. Writ walks the site, reads every page in scope,
and stores each page as a row in a dataset you can search, export or call as an API. You don't pick
how pages are read: Writ decides for each page and remembers which sites need a browser.

## Start a harvest

-

1. **Open Harvest**

Go to **Create** and pick **Collect with Harvest**, then **Configure Harvest**. You can also open **Harvest** in the sidebar and click **New harvest**. The page is titled **Collect data from a site**.

-

2. **Give the site and your goal**

Paste the address of the site, or of the section you want. Under **What do you want to get?**, describe the result in plain words, for example: *“Collect all products with their price, image and availability. Ignore the blog and support.”* Then click **Generate the plan**.

-

3. **Review the proposed plan**

Writ reads the site and turns your goal into a **Proposed plan** of four cards. Click **Edit** on a card to change it:

- **Explore the site**: how much of the site to cover. Pick a **Coverage** preset or type a number in **Max pages**.
- **Detect the pages**: nothing to set. It shows **How Writ reads each page** and what each kind of page costs.
- **Extract the data**: pick a persona in **Sign-in identity** when the pages sit behind a login.
- **Export**: pick the **Output format**: **Markdown**, **HTML** or **Structured**.

-

4. **Check the scope and the estimate**

The **Scope preview** lists **What Writ will explore** and **What will be ignored**. Click **See a sample output** to read one real page in the chosen format. The bar at the bottom shows the **Estimated scope**, the **Estimated time** and an **Estimate** in credits, given as a range such as “500 to 2,500 credits”.

-

5. **Launch**

Click **Launch the crawl**. The harvest page opens and fills in live: pages discovered, pages collected, speed, failed pages and the running cost.

| Coverage | Pages | Good for |
| --- | --- | --- |
| Quick sample | 50 | Checking that the plan collects the right pages. |
| Standard | 500 | One section, such as a category or the docs. |
| Deep | 2,000 | A medium-size site. |
| Exhaustive | 10,000 | Every reachable page of a large site. |

> **tip:** Start with Quick sample. If the dataset looks right, relaunch with more pages.

## How Writ reads each page

Every page starts with a plain fetch, the cheapest way to read it. Writ opens a browser only for pages
that need JavaScript to show their content. Once most pages of a site need a browser, the rest of the
harvest starts there, and Writ remembers it for the next harvest of that site.

When a site refuses connections from Writ's servers, Writ reads it through a residential connection,
if your plan can pay for one. When a site shows a CAPTCHA wall, one solve is shared across the whole
harvest instead of one per page. The plan says so on the **Detect the pages** card when
Writ already knows the site. Details are on [Blocks, CAPTCHAs and hand-offs](https://usewrit.app/docs/bot-walls).

A harvest skips the pages a site's robots.txt asks automated visitors not to open. Owners and admins
can also turn on **Respect robots.txt** in **Settings → Overview**, which
makes every run and monitor in the organization skip those pages too.

> **limit:** There is no setting for browser use, speed, delay, country or page selectors. Writ chooses these per page. To shape what is collected, change your goal, the coverage or the output format.

## What it costs

Each collected page is charged for what it needed. A harvest of a plain site costs the low end of the
estimate; a site where every page needs a browser costs the high end.

| Page | Credits |
| --- | --- |
| Plain page, or a document (PDF, office file) | 1 |
| Page read with OCR | 2 |
| Page that needs a browser | 5 |
| Page read by Writ's AI | 5 |
| CAPTCHA a paid solver passes on a page | +10 |
| Residential bandwidth, when a site refuses Writ's servers | 7 per MB |

After launch, the **Cost** panel on the harvest page lists how many pages were plain,
documents, OCR, browser and AI-read pages, how many CAPTCHAs were solved, and what each line cost. It
also says what Writ chose by itself, such as starting pages in a browser or reading through a
residential address.

Each harvest has a credit budget: 5,000 credits unless you set another one from the API. When the
budget is reached, or your balance runs out, Writ stops fetching pages. Pages it did not fetch are not
charged, and the panel shows them as **not charged: the credit budget was reached or the balance ran out**.

> **cost:** CAPTCHA solving by a paid solver is part of Pro and up. A wall that Writ passes by itself costs nothing. A harvest on Writ Desktop that runs on your computer is free.

## Use the results

The harvest page has everything you do next:

- **Open dataset** shows the collected pages in [Outputs](https://usewrit.app/docs/storage), where you can search, filter and download them as CSV, JSON, Markdown or HTML.
- **Relaunch harvest** runs it again with the same settings. Rows that changed since the last run are marked.
- **Edit configuration** reopens the plan so you can change the goal, the coverage or the format.
- **Make callable** turns the harvest into an API, described below.
- **Remove harvest** deletes it and the dataset it collected.

Original documents the harvest found, such as PDFs and office files, are kept as files. You can
download each one from its row.

### Make a harvest callable

**Make callable** saves the harvest's settings as a saved crawl with a permanent endpoint.
A saved crawl keeps its own history, so a later call can reuse what it already collected instead of
collecting again. In the **Crawl API** dialog:

- **How fresh does the data need to be?** sets the freshness window: **Always re-crawl**, **1 hour**, **24 hours** or **7 days**. A call within the window gets the collected pages at once, with nothing fetched and nothing charged. An older harvest is collected again with the same settings.
- **Force a fresh crawl** ignores the window for one call. It is the same as sending `max_age: 0`.
- **Just read what it already collected** never collects, at any age. It is the cheapest read.
- **Create an API key** makes a key limited to crawls and their data. It is shown once.

## From your AI assistant or your code

### From your AI assistant

Once Writ is [connected to your assistant](https://usewrit.app/docs/mcp), ask for a site or a
section as a dataset, for example *“collect every page of the docs at example.com”*. These
tools do the work:

| Tool | What it does |
| --- | --- |
| writ_crawl_site | Starts a harvest. With save_as it also saves it as a callable crawl. |
| writ_crawl_status | Progress of a harvest, and its rows once it finishes. |
| writ_saved_crawls | Lists your saved crawls. |
| writ_run_saved_crawl | Runs a saved crawl, or reuses its data within max_age seconds. |
| writ_saved_crawl_data | Reads what a saved crawl last collected, without collecting. |
| writ_crawl_files | The original documents a harvest captured, with download links. |

To read one page or a few pages right now, your assistant uses `writ_scrape` instead: it
answers in the same call and makes no dataset.

### Over REST

Start a harvest with an API key from **Developers → API Keys**. Send the site and your
goal in `intent`; Writ derives the scope from it, as in the app.

POST `https://api.usewrit.app/api/crawl` wt_ key

```bash
curl -X POST https://api.usewrit.app/api/crawl \
  -H "Authorization: Bearer $WRIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://books.toscrape.com",
    "intent": "Every book with its title, price and availability",
    "page_budget": 500
  }'
```

```python
import os, requests

res = requests.post(
    "https://api.usewrit.app/api/crawl",
    headers={"Authorization": f"Bearer {os.environ['WRIT_API_KEY']}"},
    json={
        "url": "https://books.toscrape.com",
        "intent": "Every book with its title, price and availability",
        "page_budget": 500,
    },
)
res.raise_for_status()
crawl = res.json()
print(crawl["id"], crawl["status"])
```

```typescript
const res = await fetch("https://api.usewrit.app/api/crawl", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WRIT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://books.toscrape.com",
    intent: "Every book with its title, price and availability",
    page_budget: 500,
  }),
});
const crawl = await res.json();
console.log(crawl.id, crawl.status);
```

```json
{
  "id": 1842,
  "seed_url": "https://books.toscrape.com",
  "status": "queued",
  "intent": "Every book with its title, price and availability",
  "extract_mode": "markdown",
  "page_budget": 500,
  "pages_discovered": 0,
  "pages_done": 0,
  "pages_failed": 0,
  "data_workflow_id": 9310,
  "created_at": "2026-10-31T14:02:11+00:00"
}
```

Useful body fields

- `url` (string, required): The page the harvest starts from.
- `intent` (string): Your goal in plain words. Writ derives which paths to follow and ranks pages by relevance.
- `page_budget` (integer): The most pages to collect (up to 50,000).
- `extract_mode` (string): markdown, html or schema.
- `persona_id` (integer): A persona to sign in as, for pages behind a login.
- `credit_budget` (integer): The most credits this harvest may spend.

Poll `GET /api/crawl/{id}` for progress. Its `status` goes from `queued` and `running` to `completed`, `failed` or `cancelled`. Read the rows from the dataset whose id is `data_workflow_id`,
with the [data endpoints](https://usewrit.app/docs/storage).

### Get a free estimate

The estimate reads only what Writ already knows about the site: nothing is fetched and nothing is
charged. Amounts ending in `_micros` are thousandths of a credit, so `1000` is 1 credit.

GET `https://api.usewrit.app/api/crawl/meta/estimate?url=&pages=` free wt_ key

```bash
curl -G https://api.usewrit.app/api/crawl/meta/estimate \
  -H "Authorization: Bearer $WRIT_API_KEY" \
  --data-urlencode "url=https://books.toscrape.com" \
  -d pages=500
```

```python
import os, requests

res = requests.get(
    "https://api.usewrit.app/api/crawl/meta/estimate",
    headers={"Authorization": f"Bearer {os.environ['WRIT_API_KEY']}"},
    params={"url": "https://books.toscrape.com", "pages": 500},
)
est = res.json()
print(est["low_micros"] / 1000, "to", est["high_micros"] / 1000, "credits")
```

```typescript
const qs = new URLSearchParams({ url: "https://books.toscrape.com", pages: "500" });
const res = await fetch(`https://api.usewrit.app/api/crawl/meta/estimate?${qs}`, {
  headers: { Authorization: `Bearer ${process.env.WRIT_API_KEY}` },
});
const est = await res.json();
console.log(est.low_micros / 1000, "to", est.high_micros / 1000, "credits");
```

```json
{
  "pages": 500,
  "low_micros": 500000,
  "high_micros": 2500000,
  "likely_rung": "http",
  "likely_micros": 500000,
  "per_page": {
    "http_micros": 1000,
    "doc_micros": 1000,
    "ocr_micros": 2000,
    "browser_micros": 5000,
    "ai_micros": 5000,
    "captcha_micros": 10000
  },
  "captchas": null,
  "learned": { "render": null, "residential": false, "captcha": false },
  "residential_gb_price_micros": 7000000,
  "default_credit_budget_micros": 5000000
}
```

### Run a saved crawl

A saved crawl answers at `/api/crawl/definitions/{ref}/run`, where the ref is its
slug, name or id. Send `max_age` in seconds to reuse recent data, and `wait: true` to hold the call for up to `timeout` seconds (300 at most). Without `wait`, a
fresh crawl answers `202` with a `status_url` to poll.

POST `https://api.usewrit.app/api/crawl/definitions/{ref}/run` wt_ key

```bash
curl -X POST https://api.usewrit.app/api/crawl/definitions/books/run \
  -H "Authorization: Bearer $WRIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"max_age": 86400, "wait": true, "limit": 50}'
```

```python
import os, requests

res = requests.post(
    "https://api.usewrit.app/api/crawl/definitions/books/run",
    headers={"Authorization": f"Bearer {os.environ['WRIT_API_KEY']}"},
    json={"max_age": 86400, "wait": True, "limit": 50},
    timeout=130,
)
body = res.json()
print("reused" if body["cached"] else "fresh", len(body["data"]["rows"]))
```

```typescript
const res = await fetch("https://api.usewrit.app/api/crawl/definitions/books/run", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WRIT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ max_age: 86400, wait: true, limit: 50 }),
});
const body = await res.json();
console.log(body.cached ? "reused" : "fresh", body.data.rows.length);
```

```json
{
  "cached": true,
  "_cache": { "hit": true, "age_seconds": 5120, "source_crawl_id": 1842 },
  "crawl": { "id": 1842, "status": "completed", "pages_done": 498 },
  "status_url": "/api/crawl/1842",
  "data": {
    "columns": ["title", "url", "content"],
    "rows": [
      {
        "run_id": 77120,
        "record_index": 0,
        "fields": {
          "title": "A Light in the Attic",
          "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
          "content": "# A Light in the Attic\n\n£51.77\n\nIn stock (22 available) ..."
        }
      }
    ],
    "total": 498
  }
}
```

`GET /api/crawl/definitions/{ref}/data` reads the last completed run without ever
collecting. `_cache.hit` in every answer tells you whether you got reused data or a fresh crawl.

### Without an account

To try Harvest with no account and no key, the keyless crawl collects up to 5 pages of one site, one
level deep from the page you give. Add `search` to pick the pages that match a topic. `/v1/keyless/map` lists a site's addresses instead, and `/v1/keyless/scrape` reads
one page.

```bash
curl -X POST https://api.usewrit.app/v1/keyless/crawl \
  -H "Content-Type: application/json" \
  -H "X-Writ-Client-Id: 6f1d2c4e-0b7a-4c1e-9f3a-2d5e8b9c0a11" \
  -d '{"url": "https://books.toscrape.com", "search": "poetry"}'
```

```python
import requests

res = requests.post(
    "https://api.usewrit.app/v1/keyless/crawl",
    headers={"X-Writ-Client-Id": "6f1d2c4e-0b7a-4c1e-9f3a-2d5e8b9c0a11"},
    json={"url": "https://books.toscrape.com", "search": "poetry"},
)
for page in res.json()["pages"]:
    print(page["url"], page["title"])
```

```typescript
const res = await fetch("https://api.usewrit.app/v1/keyless/crawl", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Writ-Client-Id": "6f1d2c4e-0b7a-4c1e-9f3a-2d5e8b9c0a11",
  },
  body: JSON.stringify({ url: "https://books.toscrape.com", search: "poetry" }),
});
for (const page of (await res.json()).pages) console.log(page.url, page.title);
```

```json
{
  "verb": "crawl",
  "url": "https://books.toscrape.com",
  "pages": [
    { "url": "https://books.toscrape.com", "title": "All products", "markdown": "..." },
    { "url": "https://books.toscrape.com/catalogue/category/books/poetry_23/index.html", "title": "Poetry", "markdown": "..." }
  ],
  "counts": { "pages": 5, "requested": 5 },
  "tier": "keyless",
  "limits": { "page_cap": 5, "max_depth": 1, "same_domain": true },
  "quota": {
    "tier": "keyless",
    "credits_remaining": 5,
    "credits_per_day": 10,
    "reset_at": "2026-11-01T00:00:00Z"
  }
}
```

> **limit:** Without an account you get 10 free credits a day per device, at 1 credit a crawled page and 2 a read or a map. Calls from one network share a second allowance of the same size. Whole sites, logins and saved datasets need an account or Writ Desktop.

## On Writ Desktop

In Writ Cloud, every harvest runs on Writ's servers and is charged per page. To harvest for free from
your own computer, use [Writ Desktop](https://usewrit.app/docs/desktop).

Harvest on Writ Desktop runs on your computer, over your own connection, and costs nothing. Every page
starts with a plain fetch and opens in a browser only when it needs JavaScript.

When Desktop is linked to a Writ Cloud account, the plan shows **Where it runs** with two
choices: **This machine** or **Cloud fleet**. The cloud fleet spreads the
harvest across Writ's servers and is charged per page, like a harvest started in the web app. A
harvest signed in as a persona always runs on your computer, so the sign-in never leaves it.

## Next

-
- [Outputs and exports](https://usewrit.app/docs/storage): Search, filter and download a dataset, or read it over the API.
-
- [Monitor a page](https://usewrit.app/docs/monitors): Watch one page for changes instead of collecting a whole site.
-
- [Blocks, CAPTCHAs and hand-offs](https://usewrit.app/docs/bot-walls): What happens when a site pushes back, and what it costs.
-
- [Credits and plans](https://usewrit.app/docs/billing-wallet): Monthly credits, budgets and what happens at zero.
