crawl4ai
Apache-2.0PythonOpen-source web crawler and scraper for LLMs and AI agents: any website into clean, LLM-ready Markdown. Run it yourself, or use Crawl4AI Cloud with one key. Join our Discord https://discord.gg/VuxzM8mtf
Open-source web crawler and scraper for LLMs and AI agents: any website into clean, LLM-ready Markdown. Run it yourself, or use Crawl4AI Cloud with one key. Join our Discord https://discord.gg/VuxzM8mtf
Crawl4AI 是一个面向 LLM 与 AI Agent 的开源网页爬虫与抓取工具,目标是把任意网站转换成干净、适合大模型使用的 Markdown,用于 RAG、AI Agent 和数据管道。它既可以自行运行(pip 安装、Docker 自托管、命令行 crwl),也可以使用官方托管的 Crawl4AI Cloud 服务,通过一个 API Key 调用 /scrape、/extract、/search、/serp、/answer 等接口,并支持通过 MCP 接入 Claude Code 等 Agent。项目采用 Apache-2.0 许可,README 中说明其是 GitHub 上星标较多的爬虫项目之一。
export CRAWL4AI_API_TOKEN="$(openssl rand -hex 32)" docker run -d -p 11235:11235 --name crawl4ai --shm-size=1g \ -e CRAWL4AI_API_TOKEN="$CRAWL4AI_API_TOKEN" \ unclecode/crawl4ai:latest
开源库本身免费,可永久自行运行。README 同时提供 Crawl4AI Cloud 托管服务,采用按量付费模式,并提供初始免费额度(README 说明为 2000 credits,免费档每分钟 10 次、同时 2 个请求),具体价格以官方页面为准。
README 给出的方式是执行 pip install -U crawl4ai,然后运行 crawl4ai-setup 安装并配置浏览器,再用 crawl4ai-doctor 检查安装。若浏览器安装失败,可手动执行 python -m playwright install --with-deps chromium。
README 列出三种方式:作为 Python 库在本地进程中运行浏览器;通过 Docker 自托管服务器(提供 REST API、MCP、监控面板与 playground);或使用 Crawl4AI Cloud 托管服务,通过 API Key 调用 /scrape、/extract、/search、/serp、/answer 等接口。
可以。README 说明支持 JsonCssExtractionStrategy、JsonXPathExtractionStrategy、RegexExtractionStrategy 等无需 LLM 的抽取方式,也支持 LLMExtractionStrategy 通过任意 LLM 提供商抽取为 JSON,并提供 generate_schema 生成可复用 schema。
可以。README 说明云端提供 MCP 接口,可通过一行命令在 Claude Code 中添加,也支持 Codex、Cursor 和 OpenCode;自托管 Docker 服务同样提供 MCP 接入方式。
项目采用 Apache-2.0 许可。README 中说明署名是被推荐的,并提供了徽章署名与文字署名两种方式,例如在文档中添加“This project uses Crawl4AI (https://github.com/unclecode/crawl4ai) for web data extraction.”。