unclecode/crawl4ai
Project Overview
Crawl4AI
Async Python web crawler that converts websites into clean, LLM-friendly Markdown for RAG and AI pipelines.
True Intent (AI Assessment)
Provide an open-source, browser-based web crawler that outputs LLM-ready Markdown and structured data for AI applications.
README Accuracy
Notes
Code matches the README's description. Worth noting: depends on a maintainer-forked `unclecode-litellm` package pinned to a specific version, and recent versions have patched serious Docker API vulnerabilities—users self-hosting should stay on current releases.
Crawl4AI is a large, mature Python web crawling and scraping framework built around Playwright (with a Patchright/stealth variant) that renders pages in a real browser and converts them into Markdown, structured JSON, and other LLM-ready formats. It ships as a pip-installable library, a CLI (`crwl`), and a Dockerized FastAPI server, with helper scripts like `crawl4ai-setup` and `crawl4ai-doctor` to install browsers and validate the environment.
The problem it addresses is that raw HTML is noisy and expensive to feed into LLMs, and most existing extraction APIs are gated behind accounts and per-page fees. Crawl4AI aims to give developers a self-hostable, open-source alternative that produces high-quality Markdown (with tables, code, headings, citation hints), handles JavaScript-heavy sites, and supports advanced patterns like deep crawling, adaptive crawling, session reuse, proxies, and anti-bot evasion.
The typical users are AI/ML engineers building RAG systems, agent frameworks, and data pipelines, as well as scraping practitioners who need a scriptable crawler. They use it either as a Python library (`AsyncWebCrawler`), via the CLI for one-off crawls, or by deploying the Docker image to expose an HTTP/MCP API that other services call.
Internally the codebase is organized around async strategies: `async_webcrawler.py` orchestrates crawls; `async_crawler_strategy.py` and `browser_manager.py` drive Playwright browser pools; `content_scraping_strategy.py`, `content_filter_strategy.py`, and the vendored `html2text` module clean and convert HTML; `extraction_strategy.py` plus `chunking_strategy.py` handle LLM- and CSS/XPath-based extraction; `deep_crawling/` implements BFS/DFS/best-first strategies with filters and scorers; and specialized crawlers (Amazon, Google Search) live under `crawlers/`. Caching, dispatching, monitoring, and a domain mapper round out the runtime, with SQLite (`aiosqlite`) used for local persistence.
Notable signals: the project is very active (v0.9.1 recent, dedicated SECURITY.md and security workflow, recent security-hardening releases fixing RCE/SSRF/auth bypass in the Docker API), uses a pinned fork `unclecode-litellm` instead of upstream litellm, and prominently advertises an upcoming closed-beta hosted cloud API. Nothing in the sampled code looks malicious; it is a legitimate, heavily-used OSS crawler with a commercial cloud offering being built on top.
| Languages | Python, JavaScript, Shell, Dockerfile |
| Runtime | Python 3.10+ (async) |
| Framework | Playwright + FastAPI (Docker server) |
| Database | SQLite via aiosqlite; Redis in Docker deploy |
| Package Manager | pip / uv (pyproject.toml) |
| Key Dependencies | playwright, patchright, aiohttp, httpx, beautifulsoup4, lxml, unclecode-litellm, pydantic, rank-bm25, nltk |
| Build Tool | setuptools (PEP 517) |
| Test Framework | pytest (tests/ directory) |