Crawl an entire website into Markdown for RAG and support chatbots.
To turn a website into a RAG knowledge base or a support chatbot, crawl it as one job: the Crawl API reads every page under your include patterns and returns its main content as Markdown, with its URL, title and a sha256. A free quote gives the most a crawl can cost before it starts, and max_credits is a hard cap. At 10 credits a Markdown page, our own 20-page docs crawl cost 200 credits and gave 363 chunks.
{
"urls": ["https://ujeebu.com/docs"],
"scope": {"include": ["/docs/**"], "max_pages": 20},
"use_sitemap": true,
"format": "markdown",
"markdown": {"filter": "fit"},
"max_credits": 200,
"webhook": {"url": "https://kb.example.com/hooks/crawl"}
}
→ 202 Accepted
{"job_id": "c_8c70cd66…", "status": "pending"}{
"pages": [
{
"seq": 8,
"url": "https://ujeebu.com/docs/apis/scrape/raw",
"state": "done",
"http_status": 200,
"title": "Scrape Raw",
"depth": 0,
"credits": 10,
"links_total": 102,
"sha256": "7f98d26867fb425e…",
"markdown": "# Scrape Raw\n\nGet the raw HTML source code as received from the server without JavaScript execution. …"
},
…
],
"next_after": 8,
"has_more": true
}Know what the crawl costs before it starts.
A free quote gives the most a crawl can cost before it starts, and max_credits is a hard cap. Failed, blocked and robots-skipped pages are not billed, and every page has an honest state.
A free quote first
POST /crawl/quote takes the job body and starts nothing. For the 45 posts of our blog it answered 10 credits a page and a ceiling of 450 credits.
{
"estimate": true,
"credits_per_page": 10,
"max_pages": 45,
"credits_ceiling": 450,
"sitemap": {"in_scope_urls": 45}
}A cap that holds
max_credits counts each page once, so a cap equal to the quote's ceiling reads every page. Our 50-credit sample of the same blog stopped at its cap; the pages it never started cost nothing.
{
"stop_reason": "max_credits",
"credits_used": 50,
"max_credits": 50,
"errors": {"stopped": 40}
}An honest state for every page
done, blocked, not_found, timeout, robots, duplicate or stopped, with the reason. A site that refuses everything reads as blocked, never as an empty site.
{
"url": "https://books.toscrape.com/catalogue/the-page-that-moved_999/index.html",
"state": "failed",
"http_status": 404,
"error_class": "not_found",
"error": "Invalid status code from URL: 404"
}Output of our runs on ujeebu.com and books.toscrape.com (November 17, 2026), trimmed; credit figures follow the price list.
Why a whole site is harder to feed than one page.
One URL to Markdown is a solved problem. A whole site, kept fresh and clean, is where the work is.
Docs grow every week. A hand-kept URL list goes stale, and a naive link follower wanders into tag pages, print views and other hosts.
Menus, cookie banners and footers repeat on every page. Embedded as they are, they crowd out the answer and cost tokens on every query.
A crawl takes minutes, not one request. Polling from a cron job is fragile: you want to be told, and to know the call really came from Ujeebu.
Most pages do not change between two runs. Re-embedding all of them every week costs embedding calls and churns your index for nothing.
Three sources, one crawl request each.
Docs and API references for a support chatbot.
Start from the docs home, include /docs/** and exclude what the chatbot should not answer from, like release archives. The fit filter keeps the main content of each page, so the chunks hold answers, not menus.
- include and exclude patterns: * for one path segment, ** for any depth
- max_depth, and max_pages up to 2,000 a job
- use_sitemap to start from the sitemap as well
A help center that renders in the browser.
Many help centers build the article in JavaScript. Turn on page.js for the whole job and wait for the article body with page.wait_for. A Markdown page costs the same with or without JavaScript.
- page.js and page.wait_for, once per job
- robots.txt and Crawl-delay honoured
- refused pages labelled blocked, never empty
A content library for a research assistant.
List the posts for free with a sitemap listing first, so you know the size before you read a page. Then crawl with the bm25 filter and a query to keep only the passages about your topic.
- mode "sitemap": in-scope URLs, 0 credits
- markdown.filter "bm25" with markdown.query
- our own blog: 45 URLs listed for 0 credits
Crawl, verify, load: three calls.
Put them in a scheduled job. The examples crawl our own docs; swap in your site and get a free quote for it first.
- 1
Start the crawl with a webhook
POST /crawl answers at once with a job_id and the crawl runs in the background, breadth first, with robots.txt honoured. An Idempotency-Key makes a retried call return the same job. When the job ends, Ujeebu sends one signed POST to your webhook.
Startcurl -X POST https://api.ujeebu.com/crawl \ -H "ApiKey: $UJEEBU_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: docs-week-47" \ -d @docs-crawl.json # the request shown above → 202 {"job_id": "c_8c70cd66…", "status": "pending"}Webhook body{ "event": "crawl.job.completed", "job_id": "c_8c70cd66…", "status": "completed", "stop_reason": "max_pages", "counts": {"discovered": 20, "done": 20, "failed": 0}, "errors": {}, "credits_used": 200, "archive": { "url": "https://…", "checksum_sha256": "…", "file_count": 21, "expires_at": "…" } } - 2
Verify the signature
X-Ujeebu-Signature is an HMAC-SHA256 of "<timestamp>.<raw body>", keyed with your own API key. Recompute it over the raw bytes before parsing the JSON, compare in constant time, and refuse an old timestamp.
Pythonimport hashlib, hmac, time def verify(raw_body: bytes, headers, api_key: str) -> bool: ts = headers["X-Ujeebu-Timestamp"] if abs(time.time() - int(ts)) > 300: # refuse old calls return False mac = hmac.new(api_key.encode(), ts.encode() + b"." + raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest("sha256=" + mac, headers["X-Ujeebu-Signature"]) - 3
Load only what changed
Read the pages 50 at a time with the cursor. Each record carries the sha256 of its Markdown: when it matches the one you stored last time, keep the old vectors. Pages that now come back as not_found leave the index. "store" stands for your vector store.
Pythonimport os, requests BASE = "https://api.ujeebu.com/crawl" H = {"ApiKey": os.environ["UJEEBU_KEY"]} def read_pages(job_id): after = 0 while True: r = requests.get(f"{BASE}/{job_id}/pages", headers=H, params={ "after": after, "limit": 50, "content": "true"}).json() yield from r["pages"] if not r["has_more"]: return after = r["next_after"] for p in read_pages(job_id): if p.get("error_class") == "not_found": store.delete(p["url"]) # gone from the site elif p["state"] == "done" and store.sha256(p["url"]) != p["sha256"]: chunks = split_by_heading(p["markdown"]) # new or changed store.replace(p["url"], embed(chunks), p["sha256"])
What to keep out of the index, and how.
Retrieval quality is decided before the first embedding. Most of the noise can stay out of the crawl itself.
| Keep out | Why it hurts answers | How |
|---|---|---|
| Menus, footers, cookie banners | They repeat on every page and crowd out the answer. | markdown.filter "fit", the default, keeps the main content of each page. |
| Changelogs and release notes | Old versions answer today's questions with outdated facts. | scope.exclude: ["/changelog/**", "/releases/**"] |
| Translations | The same answer in five languages fills the top results. | scope.exclude: ["/fr/**", "/de/**", "/ja/**"], or include only /en/**. |
| Duplicate pages | Two copies of a passage push other answers out of the results. | Index each sha256 once: pages with the same content have the same checksum. |
| Print views, tag and search pages | Thin or repeated text with no answer of its own. | scope.exclude: ["/**/print", "/tags/**", "/search"] |
| Oversized pages | One huge page turns into hundreds of weak chunks. | Split by heading. A page over 2 MB comes as a content_url; one over 10 MB fails with error_class error, and its read is billed. |
A 300-page docs site, refreshed every week.
Prices come from the price list: 10 credits per Markdown page, with or without JavaScript rendering. Our own 20-page docs crawl cost 200 credits and gave 363 chunks.
- Failed, blocked and robots-skipped pages are not billed. A page is read and billed once per run, like a direct call; max_credits counts each page once, so a cap equal to the quote's ceiling reads every page.
- Version 1 reads every page on each refresh. The sha256 comparison saves your embedding calls and index churn, not crawl credits.
- Premium and residential proxies cost more than the default proxy.
Full code, real output.
Everything a knowledge-base pipeline needs from a crawl.
Main content as Markdown
The fit filter keeps the main content of each page (the default), raw keeps the whole page, and bm25 with a query keeps the passages that match it. The title is the page's first heading.
Scope you control
Up to 20 start URLs, the hosts to stay on, include and exclude path patterns, a maximum depth and up to 2,000 pages a job.
A hard credit cap
POST /crawl/quote prices the job before it starts, and max_credits stops it before a page that would go past your cap.
Signed webhook
One POST when the job ends, signed with HMAC-SHA256 and your own API key, with a timestamp and a delivery id.
A sha256 per page
Each record carries the checksum of its content. Compare it with the last run to find the new and changed pages.
Honest page states
Every page says what happened: done, blocked, not_found, timeout, robots or duplicate. Failed, blocked and robots-skipped pages are not billed.
Questions people ask about crawling a site for RAG.
What is the best way to crawl an entire website into Markdown for RAG?
How do I crawl a documentation site to build a support chatbot?
How do I keep a RAG knowledge base in sync when the website changes?
How much does it cost to crawl a website for RAG?
Can it crawl documentation that renders with JavaScript?
How big a site can one crawl job read?
Give your assistant the whole site.
Size the site for free, cap the credits, and get a signed webhook when the Markdown is ready. Start with 5,000 free credits, no card.