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.
- 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*
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.
| Arrived | Pages | Markdown |
|---|---|---|
| 5,048 ms | 1 | 1.4 KB |
| 8,300 ms | 4 | 14.3 KB |
| 11,675 ms | 6 | 32.6 KB |
| 14,925 ms | 3 | 44.2 KB |
| 18,175 ms | 6 | 101.1 KB |
| 21,295 ms | 10 | 125.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.
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.