Skip to main content

Clean markdown for your retrieval layer.

For teams that keep a vector store in step with docs and knowledge bases. Spider crawls the source and streams each page back as markdown, not HTML, so your callback embeds page one while the crawl is still running.

Pay as you go from $0.16 per 1,000 pages. Documentation pages averaged $0.27 per 1,000 in the 2026-11-06 cost run. Cost varies by site.

Recorded crawl, 2026-09-09
POST /crawl, limit 30, markdown
https://doc.rust-lang.org/book/
page one
/book/, 200
its markdown
1,482 bytes
all 30 pages
21.5 s
all markdown
319 KB
# The Rust Programming Language
*by Steve Klabnik, Carol Nichols, and Chris Krycho, with contributions from the
Rust Community*
Page one's opening lines, verbatim. It landed 5.0 s after a request that asked for smart mode with country_code set to de. The other 29 pages followed within 16.4 s, each one ready to embed as it arrived.

The first page lands while the crawl runs.

The same crawl, page by page. The first page arrived at 5,048 ms and pages came in bursts after it. With stream=True your callback takes each burst as it lands.

Arrival, ms after the request
The same crawl as a log, one row per burst of pages.
ArrivedPagesMarkdown
5,048 ms11.4 KB
8,300 ms414.3 KB
11,675 ms632.6 KB
14,925 ms344.2 KB
18,175 ms6101.1 KB
21,295 ms10125.4 KB

Embed the text, not the page chrome.

In a 60-page crawl of the kubernetes.io docs on 2026-11-06, the raw HTML came to 7,428,798 o200k_base tokens. The same pages as markdown came to 202,123, about 37 times fewer, as the fine-tuning dataset write-up shows. The median page went from 486,606 bytes of HTML to 11,673 bytes of markdown. Navigation, scripts and footers are what fell away, and none of it belongs in a chunk.

Raw HTML
7,428,798 tokens
Markdown
202,123 tokens

Embed each page as it lands.

Pass a callback with stream=True and the crawl hands your code one page at a time. Chunk it, embed it and upsert it with its URL.

stream=True
Each page reaches your callback when it finishes. With the LangChain loader, lazy_load() yields documents the same way.
SpiderLoader
On LangChain, the loader returns documents with the markdown in page_content and the source URL in metadata, ready for add_documents.
Webhooks
Set a webhook URL and Spider POSTs results as pages complete, so the crawl and your ingestion run apart. Events include on_find and on_website_status.
Cost
max_credits_allowed caps the credits one run may use, so a refresh job has a ceiling you set.
crawl_and_embed.py
from spider import Spider

client = Spider()
def index(page):
    chunks = split(page["content"])
    vectors = embed(chunks)
    db.upsert(vectors, source=page["url"])

# Pages stream in as they finish, so indexing starts right away
client.crawl_url(
    "https://doc.rust-lang.org/book/",
    params={
        "return_format": "markdown",
        "limit": 500,
        "max_credits_allowed": 5000,
    },
    stream=True,
    callback=index,
)

Crawl your own docs before you commit.

2,500 free credits, worth $0.25, if your signup passes our checks. No card required. Point the script above at your docs, keep the limit low, and count what comes back.

spider crawl --return-format markdown