Crawl4AI: The #1 open-source crawler on GitHub to power your agents and RAG pipelines
🔎 A repo that swept everything on GitHub
Crawl4AI has become the number one trending project on GitHub in the web scraping category. A ranking that is no accident: this open-source framework under the Apache 2.0 license was designed from the ground up for LLMs and RAG pipelines, whereas classic scrapers remain trapped in a raw collection logic.
The problem is well known. AI agents and RAG systems need clean, structured, ready-to-tokenize web data. But traditional crawlers spit out nested HTML, script tags, useless navigation bars, and footers. Crawl4AI solves this by producing clean Markdown and structured JSON, directly injectable into your pipelines.
The timing is perfect. Autonomous AI agents are multiplying, RAG architectures are maturing, and the quality of source data is becoming the real bottleneck. Crawl4AI arrives at exactly the right time, with the right abstraction.
The essentials
- #1 trending GitHub project in the web scraping category, open-source under Apache 2.0 license
- Designed for LLMs: produces clean Markdown and structured JSON, optimized to reduce token consumption
- Intelligent crawling with BFS and BestFirst strategies, CSS/XPath and LLM-based extraction, full JavaScript rendering
- Total control via
BrowserConfigandCrawlerRunConfig, with no cloud dependency or usage-based billing - Direct integration with vector stores (Milvus) and orchestrators (n8n)
Recommended tools
| Tool | Main usage | Price (June 2025, check site) | Ideal for |
|---|---|---|---|
| Crawl4AI | LLM-ready crawling | Free (Apache 2.0) | RAG pipelines and local agents |
| Firecrawl | Cloud API crawling | From ~$30/month | Teams without infra, polished API |
| Jina Reader | Single page extraction | Free / Paid API | Quick extraction, rapid prototyping |
| Milvus | Vector store | Free (self-hosted) | Vector storage for RAG |
Technical architecture — What makes the difference under the hood
Crawl4AI relies on two central abstractions that change everything compared to classic scrapers: BrowserConfig and CrawlerRunConfig.
BrowserConfig controls the browsing environment. You can define the browser type (Chromium by default), headless mode, headers, proxies, and JavaScript rendering behavior. The idea: each site has its own anti-bot constraints, and you need to be able to adjust them finely without touching the crawling code.
CrawlerRunConfig manages the crawl logic itself. This is where you define the exploration strategy (BFS or BestFirst), maximum depth, URL filters, extraction mode (CSS, XPath, or LLM-based), and automatic stopping criteria. This separation between browser and crawl logic makes the framework modular and predictable.
Full JavaScript rendering is a key point. Many modern sites load their content via SPA frameworks (React, Vue, Next.js). A classic HTTP scraper will only see an empty HTML shell. Crawl4AI waits for the DOM to be fully rendered before extracting content, thanks to its underlying Playwright integration.
The output is automatically cleaned. Raw HTML is converted to Markdown with the removal of navigations, footers, ads, and irrelevant elements. Result: your LLMs consume up to 60% fewer tokens compared to raw HTML injected as-is, according to Scrapfly benchmarks.
Structured extraction — CSS, XPath, and LLM-based
Extraction is the core of Crawl4AI, and it offers three levels of sophistication.
CSS and XPath extraction is the fastest and most deterministic. You precisely target the elements you want to extract (titles, prices, descriptions) via selectors. Ideal for sites with a stable and predictable DOM structure.
LLM-based extraction changes the game. Instead of writing fragile selectors, you describe in natural language what you want to extract, and an LLM (like Claude Sonnet 4.6 or GPT-5) interprets the page content to structure it. Crawl4AI sends the cleaned Markdown to the model with your expected output schema, and retrieves validated JSON.
This pattern is particularly powerful for sites whose structure changes regularly. A CSS class change no longer breaks your pipeline — the LLM adapts. The additional token cost is real, but Inference.net shows that the maintenance gain more than compensates for the LLM bill on production pipelines.
Schematron output adds a validation layer. You define an XML Schematron schema that constrains the structure of the output JSON. If the LLM produces a response that doesn't respect the schema, Crawl4AI can reject or retry the extraction. An essential safety net in production.
Intelligent crawling — BFS and BestFirst
Crawl4AI doesn't just scrape one page at a time. It implements multi-page crawling strategies that bring it closer to a real search engine.
The BFS (Breadth-First Search) strategy explores the site level by level. It starts with the root page, follows all first-level links, then moves to the second level, and so on. Simple, predictable, and easy to control via a maximum depth parameter.
The BestFirst strategy is smarter. It uses a relevance score to decide which link to follow first. Crawl4AI can evaluate the semantic similarity between each discovered link and your target query, then prioritize exploring the most promising pages. The result: fewer useless pages crawled, fewer tokens wasted, and more relevant data.
Automatic stopping is a detail that matters. Rather than setting an arbitrary depth, you can define a relevance threshold below which the crawler stops. If level 4 pages no longer contain anything relevant, Crawl4AI goes no further. ScrapingBee details this mechanism well in its practical guide.
Concrete use case — Building a RAG pipeline with Crawl4AI and Milvus
The most obvious use case is the RAG pipeline. Milvus published a complete tutorial showing the end-to-end integration.
The flow is simple. Crawl4AI extracts a website's content as clean Markdown. This Markdown is split into chunks (via a built-in or external chunker). The chunks are embedded and stored in Milvus. At query time, the vector store returns the relevant chunks, and the LLM generates the answer.
What changes with Crawl4AI compared to a classic scraper is the quality of the chunks. Clean Markdown means semantically coherent chunks, without parasitic HTML tags, without navigation repetitions. The retrieval is more precise, and the final answer is better. If you want to dig into the nuances between approaches, our article on RAG vs fine-tuning vs agents details when to favor RAG over other methods.
The n8n integration via webhook is another important use case. Crawl4AI can be deployed as a service and receive crawl requests via n8n webhooks. This allows it to be integrated into automation workflows without writing orchestration code. An agent triggers a crawl, the data arrives in n8n, which distributes it to the rest of the pipeline.
Crawl4AI and AI agents — Why it's different from a simple scraper
An AI agent doesn't consume data the same way a batch pipeline does. It needs real-time, contextual data, often limited to a single page or a few relevant pages.
Crawl4AI meets this need with its LLM-based extraction. An agent like those presented in our guide to the best autonomous AI agents can ask Crawl4AI: "Extract the prices and features from this product page". The crawler interprets the page with an LLM and returns structured JSON that the agent can manipulate directly.
The flexibility of navigation scripts is another asset. Crawl4AI allows you to execute custom JavaScript scripts before extraction: scroll down to load lazy content, click "See more" buttons, accept cookies. This ability to interact with the page as a human would is essential for agents that need to navigate complex sites.
The GenericAgent project, which reached 6700 stars in a week on GitHub, illustrates this trend well: modern agents dynamically build their skills, and web access is a pillar of this. Crawl4AI can serve as a data access layer for these evolving agents.
Deployment — Docker, CLI, and production
Crawl4AI is not just a Python script. It is designed for production.
The crwl CLI allows you to run crawls from the terminal without writing code. You specify the URL, strategy, depth, and output format. Handy for quick tests and integration into shell scripts.
Docker deployment is the recommended method for production. The official image includes Chromium, Playwright, and all dependencies. You launch the container, expose the API, and your other services communicate with Crawl4AI via HTTP. Browser isolation in a container avoids dependency conflicts on the host machine.
Monitoring is the main point of attention in production. MobileProxy souligne that load management, proxy tuning, and cost monitoring (server + proxies + potential LLM calls) are often underestimated aspects. Crawl4AI gives you control, but this control comes with infrastructure responsibility.
Crawl4AI vs Firecrawl vs Jina Reader — The honest benchmark
Spider published a detailed comparative benchmark in February 2026. Here is what came out of it, supplemented by the analysis of Fastio and MobileProxy.
| Criterion | Crawl4AI | Firecrawl | Jina Reader |
|---|---|---|---|
| License | Apache 2.0 (open-source) | Proprietary + cloud API | Proprietary + cloud API |
| Cost | Server + proxies only | Starting at ~$30/month | Free / paid API |
| Extraction control | Total (CSS, XPath, LLM, Schematron) | Medium (predefined schema) | Low (raw Markdown) |
| Multi-page crawling | BFS + BestFirst, depth control | Yes, but less flexible | No (single page) |
| JavaScript rendering | Complete (Playwright) | Complete | Partial |
| LLM-ready output | Clean Markdown + structured JSON | Markdown + JSON | Raw Markdown |
| Required infra | Self-hosted (Docker) | None (SaaS) | None (SaaS) |
| Ideal for | AI prototyping, limited budget, total control | Teams without infra, polished API | Quick, one-off extraction |
The verdict is clear according to Spider: Crawl4AI is recommended for prototyping AI pipelines with a limited budget and a need for total control. Firecrawl remains better if you want a turnkey cloud API without managing infrastructure. Jina Reader is suited for quick, one-off extractions where fine-grained control is not necessary.
Crawl4AI and search agents — The link with OpenSeeker-v2
The search agent ecosystem is evolving rapidly. The OpenSeeker-v2 project illustrates how open-source breaks the monopoly of industrial search agents by offering a transparent and modifiable alternative.
Crawl4AI fits into this same logic. Proprietary search agents (like Perplexity or enterprise solutions) encapsulate crawling, extraction, and ranking in a black box. With Crawl4AI, you control every step: which pages to crawl, how to extract them, which LLM to use for structuring, how to rank them.
This transparency comes at a cost in terms of effort, but it is essential for sensitive use cases (compliance, internal data, regulated sectors) where you need to know exactly where each piece of information comes from.
Why available LLMs change the game
The quality of Crawl4AI's LLM-based extraction depends directly on the model used. With current models like Claude Sonnet 4.6 (agentic score 81.4) or GPT-5 (78.1), web content structuring is reliable and fast. For complex cases requiring deeper reasoning, GPT-5.4 Pro (91.8) or Claude Opus 4.6 (84.7) offer superior extraction accuracy.
The important point: you choose the model. Crawl4AI does not lock you into a proprietary LLM. You can use a cloud model via API, or a local model via Ollama to keep your data entirely private. Our guide on open-source AI agents with local Ollama details this approach.
This flexibility is strategic. A RAG pipeline for internal enterprise data can use a local model for extraction, ensuring that no data leaves the network. A public pipeline can use a more powerful cloud model for more accurate extraction.
❌ Common mistakes
Mistake 1: Using Crawl4AI like a classic HTTP scraper
What's wrong: running Crawl4AI on a single URL without configuring BrowserConfig or CrawlerRunConfig, then complaining that the rendering is incomplete. Crawl4AI shines when you leverage its JS rendering, structured extraction, and multi-page crawling capabilities. Configuring it like a simple requests.get() is a waste.
The solution: take 10 minutes to configure BrowserConfig (headless, JS, proxies if needed) and CrawlerRunConfig (strategy, extraction, depth) before running your first crawl.
Mistake 2: Ignoring proxy costs in production
What's wrong: deploying Crawl4AI in production without a proxy, then getting blocked by rate limits and anti-bot protections after a few hundred requests. Full JavaScript rendering consumes resources on the target server, and sites detect massive crawl patterns.
The solution: integrate a proxy rotation layer from the start. MobileProxy recommends budgeting for this cost line as early as the design phase.
Mistake 3: Using LLM-based extraction for everything
What's wrong: sending every page to an LLM for extraction when a CSS selector would do the job. The token cost explodes, latency increases, and reliability is no better for stable DOM structures.
The solution: start with CSS/XPath extraction. Only switch to LLM-based extraction for sites whose structure varies or whose data is poorly structured in HTML.
Mistake 4: Neglecting data cleaning after extraction
What's wrong: assuming that the Markdown produced by Crawl4AI is perfect and directly injectable. Some sites have atypical structures that can let noise through (recurring menus, modification dates, useless metadata).
The solution: add a post-processing step (filtering by chunk length, removal of recurring patterns, deduplication) before embedding.
❓ Frequently asked questions
Is Crawl4AI really free?
Yes, under the Apache 2.0 license. But "free" does not mean "without cost": you pay for the infrastructure (server, proxies) and potentially for LLM calls for extraction. The cost is zero in licensing, but not in operations.
Can Crawl4AI entirely replace Firecrawl?
Yes for crawling and extraction. No if you need a managed cloud API without any infra to manage. The choice depends on your ability to manage Docker containers and the level of control you demand.
Which LLM to use with Crawl4AI's LLM-based extraction?
Claude Sonnet 4.6 offers a good cost/performance balance for structured extraction. GPT-5.4 Pro is preferable for complex sites. For local, a model hosted via Ollama works for simple cases.
Does Crawl4AI handle sites with infinite pagination?
Yes, via custom navigation scripts. You can inject JavaScript that scrolls down to trigger lazy loading, then launch extraction once the desired content is visible.
Does Crawl4AI work for e-commerce scraping?
Yes, it is even one of its strong use cases. Structured extraction (price, reviews, features) combined with full JavaScript rendering allows scraping dynamically loaded product pages. CSS extraction targets specific fields, LLM extraction adapts to layout variations between sites.
✅ Conclusion
Crawl4AI is the first open-source crawler designed specifically for the LLM era, and its #1 positioning on GitHub is well-deserved. It solves the real problem of RAG pipelines and AI agents: the quality of source data, not the quantity. If you are building AI systems that need reliable and structured web data, Crawl4AI deserves a place in your stack — especially since it integrates naturally with the best AI tools for code to accelerate your development.