登录 注册

crawl4ai (面向AI的网页爬取与数据提取工具)

去点 Star
自动化与工作流网络与基础设施开发者工具
87,232
Stars
0
Forks
0
Watchers
0
Open Issues
未知
许可证
Python
语言
创建时间
最近更新

项目能做什么

为 AI Agent 打造的开源网页爬虫与信息提取工具,基于 Apache-2.0 协议开源。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

{
  "project_name": "Crawl4AI",
  "markdown_guide": "## 项目简介\n\nCrawl4AI 是一个面向 AI Agent 和数据处理管道的网页抓取、结构化提取与搜索工具。它支持将网页内容清洗转换为高质量的 Markdown(适用于 RAG 场景),或提取结构化的 JSON 数据。\n\n项目提供两种使用方式:\n1. **Crawl4AI Cloud**:官方托管 API,自动管理浏览器和代理(每月提供 1,000 免费额度,无需信用卡)。\n2. **开源自建(Self-hosted)**:基于 Apache-2.0 协议开源的底层爬虫引擎,支持通过 Python 库或 Docker 自主部署运行。\n\n---\n\n## 核心功能\n\n- **网页转 Markdown**:抓取目标网页并生成干净、适合 RAG 的 Markdown 文本。\n- **结构化提取**:支持从网页中提取结构化 JSON 数据(`/extract`)。\n- **实时网络搜索**:云端提供 `/search`、`/serp` 与 `/answer` 等接口。\n- **批量任务处理**:支持通过 `/scrape/batch` 和 `/scrape/jobs` 同时处理多个 URL。\n- **MCP 集成**:支持直接接入 Claude Code 等 AI 工具的 MCP(Model Context Protocol)服务。\n- **自建与云端灵活选择**:自建方案完全免费,云端方案开箱即用并托管浏览器与代理。\n\n---\n\n## 适合谁用\n\n- 正在构建 RAG 应用,需要将网页转化为清洗后 Markdown 的 AI 开发者。\n- 开发 AI Agent 并需要网络搜索、内容抓取能力的团队。\n- 需要批量采集网页数据或提取结构化 JSON 的数据工程师。\n\n---\n\n## 安装步骤\n\n### 方式一:本地 Python 安装(开源版)\n\n1. 安装 Python 依赖包:\n```bash\npip install -U crawl4ai\n```\n2. 安装底层所需的浏览器(只需运行一次):\n```bash\ncrawl4ai-setup        # installs the browser, once\n```\n\n### 方式二:Docker 部署\n\n> 此部分原文未详细列出具体 Docker 命令,请查看原仓库文档([Self-hosted docs](https://docs.crawl4ai.com))。\n\n---\n\n## 配置说明\n\n### 1. 云端 API(Crawl4AI Cloud)使用与配置\n\n首先获取 API Key,并将环境变量 `CRAWL4AI_KEY` 设置为你的密钥。\n\n#### cURL 调用示例:\n```bash\ncurl -s https://api.crawl4ai.com/scrape \\\n  -H \"Authorization: Bearer $CRAWL4AI_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\": \"https://news.ycombinator.com\"}' | jq -r .markdown\n```\n\n#### Python 调用云端 API 示例:\n```python\nimport json\nimport os\nfrom urllib.request import Request, urlopen\n\nrequest = Request(\n    \"https://api.crawl4ai.com/scrape\",\n    data=json.dumps({\"url\": \"https://news.ycombinator.com\"}).encode(\"utf-8\"),\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['CRAWL4AI_KEY']}\",\n        \"Content-Type\": \"application/json\",\n    },\n    method=\"POST\",\n)\n\nwith urlopen(request) as response:\n    print(json.load(response)[\"markdown\"])\n```\n\n#### Node.js (18+) 调用示例:\n```javascript\nasync function main() {\n  const key = process.env.CRAWL4AI_KEY;\n  if (!key) throw new Error(\"Set CRAWL4AI_KEY first.\");\n\n  const response = await fetch(\"https://api.crawl4ai.com/scrape\", {\n    method: \"POST\",\n    headers: {\n      Authorization: `Bearer ${key}`,\n      \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({ url: \"https://news.ycombinator.com\" }),\n  });\n\n  if (!response.ok) {\n    throw new Error(`Scrape failed (HTTP ${response.status}): ${await response.text()}`);\n  }\n\n  const { markdown } = await response.json();\n  console.log(markdown);\n}\n\nmain().catch((error) => {\n  console.error(error.message);\n  process.exitCode = 1;\n});\n```\n\n#### 配置 Claude Code MCP:\n```bash\nclaude mcp add --transport http crawl4ai https://api.crawl4ai.com/mcp \\\n  --header \"Authorization: Bearer $CRAWL4AI_KEY\"\n```\n\n### 2. 本地 Python 库直接调用\n\n```python\nimport asyncio\nfrom crawl4ai import AsyncWebCrawler\n\nasync def main():\n    async with AsyncWebCrawler() as crawler:\n        result = await crawler.arun(url=\"https://news.ycombinator.com\")\n        print(result.markdown)\n\nasyncio.run(main())\n```\n\n---\n\n## 常见问题\n\n此部分原文未说明,请查看原仓库。"
}
原始 README 摘录(英文原文,节选前 3000 字符)
<h1><a href="https://trendshift.io/repositories/11716" target="_blank"><img align="right" src="https://trendshift.io/api/badge/repositories/11716" alt="unclecode%2Fcrawl4ai | Trendshift" width="130"/></a>Crawl4AI</h1>

**Crawl4AI Cloud is a hosted web scraping, extraction, and search API for AI agents and data pipelines.** Turn pages into clean Markdown for RAG, extract structured JSON, or search the live web with one API key. Crawl4AI runs the browsers and manages the proxies.

**[Get a free API key](https://crawl4ai.com/?ref=readme)** · 1,000 free credits every month. No credit card required.

[Try a URL in the playground](https://crawl4ai.com/?ref=readme-playground#playground) · [Set up Crawl4AI Cloud in Claude Code, Cursor, or Codex](https://crawl4ai.com/llms.txt?ref=readme-llms)

This repository is home to the Apache-2.0 crawler that powers Crawl4AI Cloud. [Run it yourself](#run-crawl4ai-yourself) with Python or Docker.

<a href="https://crawl4ai.com/?ref=readme-banner">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/unclecode/crawl4ai/main/docs/assets/cloud-launch-banner-dark.svg">
    <img alt="Crawl4AI Cloud is live. 1,000 free credits every month, no card. Get your key." src="https://raw.githubusercontent.com/unclecode/crawl4ai/main/docs/assets/cloud-launch-banner-light.svg" width="960">
  </picture>
</a>

<div align="center">

[![GitHub Stars](https://img.shields.io/github/stars/unclecode/crawl4ai?style=social)](https://github.com/unclecode/crawl4ai/stargazers)
[![PyPI version](https://badge.fury.io/py/crawl4ai.svg)](https://badge.fury.io/py/crawl4ai)
[![Downloads](https://static.pepy.tech/badge/crawl4ai/month)](https://pepy.tech/project/crawl4ai)
[![Discord](https://img.shields.io/badge/Discord-join%20us-5865F2?logo=discord&logoColor=white)](https://discord.gg/jP8KfhDhyN)

</div>

## Cloud quickstart

Hosted API base URL: `https://api.crawl4ai.com`.

[Cloud API reference](https://api.crawl4ai.com/docs) · [Agent setup and MCP](https://crawl4ai.com/llms.txt?ref=readme-llms)

Set `CRAWL4AI_KEY` to your API key, then scrape a page as Markdown:

```bash
curl -s https://api.crawl4ai.com/scrape \
  -H "Authorization: Bearer $CRAWL4AI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://news.ycombinator.com"}' | jq -r .markdown
```

<details>
<summary>Python 3</summary>

```python
import json
import os
from urllib.request import Request, urlopen

request = Request(
    "https://api.crawl4ai.com/scrape",
    data=json.dumps({"url": "https://news.ycombinator.com"}).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['CRAWL4AI_KEY']}",
        "Content-Type": "application/json",
    },
    method="POST",
)

with urlopen(request) as response:
    print(json.load(response)["markdown"])
```

</details>

<details>
<summary>Node.js (18+)</summary>

```javascript
async function main() {
  const key = process.env.CRAWL4AI_KEY;
  if (!key) throw new Error("S
阅读完整原文

商业机会分析 AI 生成

垂直领域结构化监控 SaaS(如电商价格/竞品动态/招聘情报)

产品构想基于 Crawl4AI 的 Markdown/JSON 提取能力,封装面向非技术或轻开发者的特定领域定时抓取、差异告警与数据沉淀平台,直接对接 Notion、Airtable 或 Webhook。
核心功能零代码配置目标 URL 与提取 Schema、定时巡检调度、内容变更 Diff 识别、下游推送(钉钉/飞书/Slack/Email)。
目标用户电商运营人员、独立分析师、中小企业市场情报团队。
难度/周期中等 · 2 - 4 周 · 成本:极低(按量服务器 + 动态住宅代理费用)
收费模式SaaS 阶梯订阅制(按监控网页频次与任务数收费)。
竞争风险目标站点反爬对抗成本随规模上升;易被同类通用抓取产品替代。
依据 数据支持的判断

企业级私有化/局域网 Crawl4AI 部署套件与运维方案

产品构想针对金融、医疗等无法使用公共 Cloud API 的合规敏感企业,提供可在私有 Kubernetes/Docker 环境一键交付的高可用爬虫网关,提供负载均衡、任务队列与私有代理池管理。
核心功能Kubernetes Helm 部署包、分布式任务队列(Celery/Temporal 集成)、多节点 Playwright 实例弹性伸缩、RBAC 权限审计与监控看板。
目标用户有数据安全与合规要求的企业技术架构师、内网 RAG 研发团队。
难度/周期中等 · 3 - 5 周 · 成本:开发阶段低,主要为测试基础设施费用。
收费模式软件包私有化授权费 + 部署支持费 + 年度技术维保订阅。
竞争风险企业销售周期长;官方未来可能推出官方自建企业版削弱需求(推测)。
依据 已验证事实

面向 Local AI / Desktop Agent 的本地知识增强客户端与 MCP 伴侣

产品构想利用 Crawl4AI 开源引擎与 MCP 支持,打造搭配 Ollama、LM Studio、Cursor 运行的本地桌面增强插件/托盘应用,提供带缓存与向量存储的网页一键入库检索能力。
核心功能轻量桌面常驻、内置单机 Crawl4AI 运行环境、本地 SQLite/LanceDB 向量索引、标准 MCP 端点暴露与快捷键唤起。
目标用户本地大模型重度用户、注重隐私的开发者、Cursor/Claude Code 用户。
难度/周期较高 · 3 - 6 周 · 成本:极低(纯本地客户端运行,无中心服务器压力)
收费模式软件买断制(Lifetime License)或高级功能(高级提取规则编辑器)付费。
竞争风险用户端机器配置差异导致 Playwright 环境安装易失败;目标客群付费意愿偏极客风格。
依据 已验证事实
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
morluto/rea 借助智能体逆向工程各类应用行为及原生二进制文件。 449,698 TypeScript
openclaw/openclaw 跨操作系统与平台的任务执行型 AI 智能体。 394,302 TypeScript
obra/superpowers 实用的智能体技能框架与软件开发方法论。 315,699 Shell
NousResearch/hermes-agent 能与用户共同成长的 AI 智能体。 262,415 Python
n8n-io/n8n 支持原生 AI 能力与可视化编排的工作流自动化平台。 210,014 TypeScript
firecrawl/firecrawl 抓取网络及外部数据,为 AI 智能体提供数据支持的工具。 200,477 TypeScript
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 ,最近推送 ,发布过 23 个 Release
社区活跃Star 87,232 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/unclecode/crawl4ai.git
cd crawl4ai
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。