Skip to main content

Markdown with about 37 times fewer tokens than the raw HTML.

On November 6, 2026, one crawl call returned 60 documentation pages as markdown, 202,123 tokens against 7,428,798 for the same pages as raw HTML. It took 6.5 seconds and cost $0.048 on pay as you go. Cost varies by site. That was one run over plain HTTP, on one section of one documentation site. The Unlimited plan bills by requests at once instead of by the page, starting at $40 a month for 2 requests at once.

Published run 60 docs pages, 2026-11-06
  • 6.5 s to crawl 60 documentation pages
  • $0.048 cost of that crawl on pay as you go
  • 202,123 markdown tokens, against 7,428,798 as raw HTML

The same 60 pages, 7,428,798 tokens as HTML and 202,123 as markdown.

Both counts use the o200k_base encoding. The panels show a shortened example page in both formats. In a run of ten mixed pages, the median page had 15 times fewer tokens as markdown than as raw HTML.

Raw HTML Shortened example
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <link rel="stylesheet" href="...">
  <script src="analytics.js"></script>
  <script src="tracking.js"></script>
</head>
<body>
  <nav class="site-nav">
    <ul><li>Home</li><li>Docs</li>
    <li>API</li><li>Blog</li></ul>
  </nav>
  <div class="sidebar">...</div>
  <main>
    <h1>Fine-Tuning Guide</h1>
    <p>Prepare your dataset...</p>
  </main>
  <footer>...280 tokens...</footer>
  <script>/* bundle.min.js */</script>
</body></html>
Nav, scripts, styles, markup
Spider markdown Shortened example
# Fine-Tuning Guide

Prepare your dataset by collecting
high-quality examples that represent
your target domain. Each example
should include an input prompt and
the expected completion.

## Data Format

Use JSONL with one example per line:

```json
{"prompt": "...", "completion": "..."}
```

## Quality Checks

Remove duplicates, filter short
examples, and validate JSON before
starting your training run.
Headings, text and code
About 37x fewer tokens than raw HTML 60 documentation pages

From raw web to training-ready in three steps.

Point at a domain

Submit a URL with a page limit. Spider maps the entire site, follows sitemaps, and handles pagination. One request covers the full domain. No sitemap parsing, no link extraction logic on your side.

Get clean markdown

Navigation, ads, footers, cookie banners, and script tags are stripped automatically. You get the article body with headings and structure preserved. Each page includes its source URL, title, and crawl timestamp for provenance tracking.

Chunk and train

Pipe the output directly into your tokenizer. Split on headings for natural chunk boundaries. The metadata lets you trace every training example back to its source page, which matters when you need to audit or update your dataset later.

One API, multiple output formats.

Markdown, plain text, raw HTML, CommonMark, XML, and more. Switch formats per request with the return_format parameter.

markdown text raw commonmark xml
training_pipeline.py Python
from spider import Spider

client = Spider()

# Build your training dataset with provenance
dataset = []

def collect(page):
    chunks = split_on_headings(page["content"])
    for chunk in chunks:
        dataset.append({
            "text": chunk,
            "source": page["url"],
            "crawled_at": page["timestamp"],
        })

# Crawl a documentation site for training data.
# A large crawl streams pages as they finish, and the credit cap bounds the run.
client.crawl_url(
    "https://docs.example.com",
    params={
        "return_format": "markdown",
        "limit": 5000,
        "max_credits_allowed": 50000,
    },
    stream=True,
    callback=collect,
)

# Split markdown output into training examples
# Spider also supports server-side chunking via chunking_alg
save_jsonl(dataset, "training_data.jsonl")

Keep reading.

Better data, fewer scrapers.

Start collecting clean, structured training data in minutes. No scrapers to build, no HTML to parse, no boilerplate to filter.

spider crawl --format markdown --limit 10000