Crawl4ai logo

Crawl4ai

CommunityPopular
unclecode

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.

Publisherunclecode
Repositorycrawl4ai
LanguagePython
Forks
8.8K
Stars
85.3K
Available tools
0
Transport typestdio
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Crawl4ai exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    85.3K stars and 8.8K forks from the linked repository.

πŸš€πŸ€– Crawl4AI: the open-source web crawler for LLMs and AI agents

GitHub Stars PyPI version Downloads Discord Crawl4AI Cloud

Latest: v0.9.4 (23 Sep 2026) Β· all releases β†’

Crawl4AI turns any website into clean, LLM-ready Markdown for RAG, AI agents and data pipelines. Run the open-source web crawler and scraper yourself, free forever, or use it hosted with one key: /scrape a page to Markdown, /extract it to JSON, /search the web, /serp for Google's results page as data, /answer a question with sources; MCP for your agent. Free: 10 a minute, 2 at a time, 2,000 credits to start. Paid: 120 a minute, 10 at a time, from $10.

Two ways to use Crawl4AI

🐍 Run it yourself: open source, forever

bash
pip install -U crawl4ai
crawl4ai-setup        # installs the browser, once
python
import asyncio
from crawl4ai import AsyncWebCrawler

async def main():
    async with AsyncWebCrawler() as crawler:
        result = await crawler.arun(url="https://news.ycombinator.com")
        print(result.markdown)

asyncio.run(main())

Docker server, CLI and every option: Installation Β· docs.crawl4ai.com

☁️ Or use the cloud: no browsers, no proxies

  1. Get a key in 10 seconds
    Verify your email and free credit to start is yours. No card. Soft launch: prices can change, what you buy stays yours.

  2. Get any 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

    The same key works for /extract, /search, /serp, /answer and many URLs at once (/scrape/batch, /scrape/jobs). Pay as you go: live prices.

  3. Give it to your AI agent. Claude Code shown; Codex, Cursor and OpenCode β†’

    bash
    claude mcp add --transport http crawl4ai https://api.crawl4ai.com/mcp \
      --header "Authorization: Bearer $CRAWL4AI_KEY"

Which one?

🐍 Library🐳 Your own server☁️ Crawl4AI Cloud
Runs the browsersyou, in your Python processyou, in Docker on your machinewe do
JS-heavy pages and bot wallsyour settings, your proxiesyour settings, your proxieshandled for you, automatically
Web search––/search, /serp and /answer
Pricefree, foreverfree (your hosting)pay as you go; free credit to start

I grew up on an Amstrad, thanks to my dad, and never stopped building. In grad school I specialized in NLP and built crawlers for research. That’s where I learned how much extraction matters.

In 2023, I needed web-to-Markdown. The β€œopen source” option wanted an account, API token, and $16, and still under-delivered. I went turbo anger mode, built Crawl4AI in days, and it went viral. Now it’s the most-starred crawler on GitHub.

I made it open source for availability, anyone can use it without a gate. Now I’m building the platform for affordability, anyone can run serious crawls without breaking the bank. If that resonates, join in, send feedback, or just crawl something amazing.

That platform is live now: Crawl4AI Cloud.

  • LLM-ready output: smart Markdown with headings, tables, code and citation hints
  • Fast in practice: async browser pool, caching, minimal hops
  • Full control: sessions, proxies, cookies, user scripts, hooks
  • Adaptive intelligence: learns site patterns, explores only what matters
  • Deploy anywhere: no keys needed, CLI and Docker, or the hosted cloud

✨ Features

  • 🧹 Clean Markdown: headings, lists, tables and code blocks, in a structure an LLM reads well.
  • 🎯 Fit Markdown: filters remove menus, footers and boilerplate: PruningContentFilterLXML, BM25ContentFilter (for a query) and LLMContentFilter.
  • πŸ”— Citations: page links become a numbered reference list.
  • πŸ› οΈ Your own strategy: plug in a custom Markdown generator.

☁️ Same in the cloud: POST /scrape returns this Markdown, with no browser to run. Docs β†’

  • πŸ”Ž CSS and XPath schemas: fast extraction with no LLM (JsonCssExtractionStrategy, JsonXPathExtractionStrategy, RegexExtractionStrategy).
  • πŸͺ„ Schema generator: describe what you want once; generate_schema writes a reusable schema.
  • πŸ€– LLM extraction: any LLM provider, open-source or hosted, into a typed JSON schema (LLMExtractionStrategy).
  • 🧱 Chunking: topic, regex and sentence chunking for long pages.
  • 🌌 Cosine similarity: find the chunks that match a query (CosineStrategy).

☁️ Same in the cloud: POST /extract, with no LLM key of your own. Docs β†’

  • πŸ–₯️ Your own browser: persistent profiles with saved logins, cookies and settings.
  • πŸ”„ Remote browsers: connect over the Chrome DevTools Protocol (CDP).
  • πŸ”’ Sessions: keep a browser state across multi-step crawls.
  • 🧩 Proxies: with authentication and rotation.
  • πŸ•ΆοΈ Stealth mode: enable_stealth, and an undetected-browser adapter for sites that detect automation.
  • βš™οΈ Full control: headers, cookies, user agents, viewport.
  • 🌍 Chromium, Firefox and WebKit.
  • πŸ•ΈοΈ Deep crawl: BFS, DFS and best-first strategies, with crash recovery (resume_state) for long crawls.
  • 🧠 Adaptive crawling: AdaptiveCrawler stops when it has learned enough to answer your query.
  • 🌱 URL discovery: AsyncUrlSeeder (sitemaps, Common Crawl) and DomainMapper; prefetch=True finds URLs 5 to 10 times faster.
  • πŸš€ Dynamic pages: run JavaScript, wait for elements, scroll the full page (scan_full_page) for infinite scroll and lazy images.
  • πŸ“Έ Screenshots and PDFs of any page.
  • πŸ–ΌοΈ Media and links: images, audio, video, srcset, internal and external links, iframes, metadata.
  • πŸ“‚ Raw HTML and local files: raw: and file://.
  • πŸ› οΈ Hooks at every step of a crawl.
  • πŸ’Ύ Caching to skip repeated fetches.
  • ⚑ Many URLs at once: arun_many with a memory-adaptive dispatcher.

☁️ Same in the cloud: up to 50 URLs in one streamed call, or 10,000 in a background job. Docs β†’

  • πŸ” Secure by default: every endpoint needs your CRAWL4AI_API_TOKEN.
  • 🧰 REST API: /md, /html, /crawl, /crawl/stream, /screenshot, /pdf, /execute_js.
  • πŸ€– MCP: connect Claude Code and other agents to your own server.
  • πŸ“Š Monitoring dashboard and playground, a browser pool with pre-warmed pages.
  • πŸ—οΈ AMD64 and ARM64 images.

☁️ Rather not run a server? The cloud is the same idea, hosted. Get a key β†’

  • πŸ” Web search API: GET /search, browser-free, ranked and cleaned. Docs β†’
  • πŸ“Š SERP API: GET /serp, Google's results page as data: true ranks, every block, localised to a place. Beta. Docs β†’
  • πŸ’¬ Answers: GET /answer gives a direct answer to a question (experimental). Docs β†’
  • πŸ§ͺ Extraction without your own LLM key: POST /extract. Docs β†’
  • πŸ§— JS-heavy pages and bot walls: handled automatically; you never pick an engine. Docs β†’
  • 🀝 MCP for your agent: one line in Claude Code, Codex, Cursor or OpenCode. Docs β†’

πŸ› οΈ Installation

bash
pip install -U crawl4ai
crawl4ai-setup      # installs and sets up the browser
crawl4ai-doctor     # checks the installation

If the browser setup fails, install it by hand:

bash
python -m playwright install --with-deps chromium

Pre-release versions: pip install crawl4ai --pre

Development install, for contributors:

bash
git clone https://github.com/unclecode/crawl4ai.git
cd crawl4ai
pip install -e ".[all]"     # or: pip install -e .   (the core only)

The server needs a token. Without one it answers only inside its container.

bash
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

Test it (allow about 10 seconds for the start):

bash
curl -s http://localhost:11235/md \
  -H "Authorization: Bearer $CRAWL4AI_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://news.ycombinator.com"}' | jq -r .markdown

The dashboard is at http://localhost:11235/dashboard, the playground at http://localhost:11235/playground. LLM keys, MCP and every setting: Self-hosting guide.

bash
# A page as Markdown
crwl https://news.ycombinator.com -o markdown

# Deep crawl, breadth first, at most 10 pages
crwl https://docs.crawl4ai.com --deep-crawl bfs --max-pages 10

# Ask a question about a page (needs an LLM key: crwl config)
crwl https://www.example.com/products -q "Extract all product prices"

πŸ”¬ Advanced usage examples

More in docs/examples.

python
import asyncio
from crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode
from crawl4ai.content_filter_strategy import PruningContentFilterLXML
from crawl4ai.markdown_generation_strategy import DefaultMarkdownGenerator

async def main():
    run_config = CrawlerRunConfig(
        cache_mode=CacheMode.BYPASS,
        markdown_generator=DefaultMarkdownGenerator(
            content_filter=PruningContentFilterLXML(threshold=0.48, threshold_type="fixed", min_word_threshold=0)
        ),
    )
    async with AsyncWebCrawler(config=BrowserConfig(headless=True)) as crawler:
        result = await crawler.arun(url="https://en.wikipedia.org/wiki/Web_crawler", config=run_config)
        print(len(result.markdown.raw_markdown), "characters of raw Markdown")
        print(len(result.markdown.fit_markdown), "characters after the filter")

asyncio.run(main())
python
import asyncio, json
from crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode, JsonCssExtractionStrategy

schema = {
    "name": "Quotes",
    "baseSelector": "div.quote",
    "fields": [
        {"name": "text", "selector": "span.text", "type": "text"},
        {"name": "author", "selector": "small.author", "type": "text"},
        {"name": "tags", "selector": "a.tag", "type": "list", "fields": [{"name": "tag", "type": "text"}]},
    ],
}

async def main():
    run_config = CrawlerRunConfig(
        extraction_strategy=JsonCssExtractionStrategy(schema),
        scan_full_page=True,   # scroll to the end, so the page loads every quote
        scroll_delay=0.5,
        cache_mode=CacheMode.BYPASS,
    )
    async with AsyncWebCrawler(config=BrowserConfig(headless=True)) as crawler:
        result = await crawler.arun(url="https://quotes.toscrape.com/scroll", config=run_config)
        quotes = json.loads(result.extracted_content)
        print(f"Extracted {len(quotes)} quotes")
        print(json.dumps(quotes[0], indent=2))

asyncio.run(main())
python
import os, asyncio
from pydantic import BaseModel, Field
from crawl4ai import AsyncWebCrawler, CrawlerRunConfig, CacheMode, LLMConfig, LLMExtractionStrategy

class ModelFee(BaseModel):
    model_name: str = Field(..., description="Name of the model.")
    input_fee: str = Field(..., description="Fee for input tokens.")
    output_fee: str = Field(..., description="Fee for output tokens.")

async def main():
    run_config = CrawlerRunConfig(
        cache_mode=CacheMode.BYPASS,
        extraction_strategy=LLMExtractionStrategy(
            # any provider LiteLLM supports, e.g. "ollama/llama3.3" with api_token="no-token"
            llm_config=LLMConfig(provider="openai/gpt-4o-mini", api_token=os.getenv("OPENAI_API_KEY")),
            schema=ModelFee.model_json_schema(),
            extraction_type="schema",
            instruction="Extract every model name with its input and output token fee.",
        ),
    )
    async with AsyncWebCrawler() as crawler:
        result = await crawler.arun(url="https://openai.com/api/pricing/", config=run_config)
        print(result.extracted_content)

asyncio.run(main())
python
import os, asyncio
from pathlib import Path
from crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode

async def main():
    user_data_dir = os.path.join(Path.home(), ".crawl4ai", "browser_profile")
    os.makedirs(user_data_dir, exist_ok=True)
    browser_config = BrowserConfig(headless=True, user_data_dir=user_data_dir, use_persistent_context=True)
    run_config = CrawlerRunConfig(cache_mode=CacheMode.BYPASS, magic=True)
    async with AsyncWebCrawler(config=browser_config) as crawler:
        result = await crawler.arun(url="ADDRESS_OF_A_CHALLENGING_WEBSITE", config=run_config)
        print(result.success, len(result.markdown))

asyncio.run(main())

πŸ“– Documentation

🀝 Contributing

We welcome contributions from the open-source community. Check out our contribution guidelines for more information.

πŸ“„ License & Attribution

This project is licensed under the Apache License 2.0, attribution is recommended via the badges below. See the Apache 2.0 License file for details.

Attribution Requirements

When using Crawl4AI, you must include one of the following attribution methods:

ThemeBadge
Disco Theme (Animated)
Night Theme (Dark with Neon)
Dark Theme (Classic)
Light Theme (Classic)

HTML code for adding the badges:

html
<!-- Disco Theme (Animated) -->
<a href="https://github.com/unclecode/crawl4ai">
  <img src="https://raw.githubusercontent.com/unclecode/crawl4ai/main/docs/assets/powered-by-disco.svg" alt="Powered by Crawl4AI" width="200"/>
</a>

<!-- Night Theme (Dark with Neon) -->
<a href="https://github.com/unclecode/crawl4ai">
  <img src="https://raw.githubusercontent.com/unclecode/crawl4ai/main/docs/assets/powered-by-night.svg" alt="Powered by Crawl4AI" width="200"/>
</a>

<!-- Dark Theme (Classic) -->
<a href="https://github.com/unclecode/crawl4ai">
  <img src="https://raw.githubusercontent.com/unclecode/crawl4ai/main/docs/assets/powered-by-dark.svg" alt="Powered by Crawl4AI" width="200"/>
</a>

<!-- Light Theme (Classic) -->
<a href="https://github.com/unclecode/crawl4ai">
  <img src="https://raw.githubusercontent.com/unclecode/crawl4ai/main/docs/assets/powered-by-light.svg" alt="Powered by Crawl4AI" width="200"/>
</a>

<!-- Simple Shield Badge -->
<a href="https://github.com/unclecode/crawl4ai">
  <img src="https://img.shields.io/badge/Powered%20by-Crawl4AI-blue?style=flat-square" alt="Powered by Crawl4AI"/>
</a>

πŸ“š Citation

If you use Crawl4AI in your research or project, please cite:

bibtex
@software{crawl4ai2024,
  author = {UncleCode},
  title = {Crawl4AI: Open-source LLM Friendly Web Crawler & Scraper},
  year = {2024},
  publisher = {GitHub},
  journal = {GitHub Repository},
  howpublished = {\url{https://github.com/unclecode/crawl4ai}},
  commit = {Please use the commit hash you're working with}
}

Text citation format:

UncleCode. (2024). Crawl4AI: Open-source LLM Friendly Web Crawler & Scraper [Computer software]. 
GitHub. https://github.com/unclecode/crawl4ai

πŸ—Ύ Mission

Our mission is to unlock the value of personal and enterprise data by turning digital footprints into structured, useful assets. Crawl4AI gives individuals and organizations open-source tools to extract and structure data, and a fair way to benefit from it. Full mission statement β†’

πŸ’– Support Crawl4AI

  1. ⭐ Star the repo: it helps more people find it.
  2. ☁️ Use the cloud: crawl4ai.com. It funds the library.
  3. πŸ’ Sponsor on GitHub: github.com/sponsors/unclecode
  4. 🏒 Companies: the sponsor tiers and benefits are in SPONSORS.md.

🌟 Current Sponsors

🀝 Strategic Partners

These companies provide core infrastructure and technology that power Crawl4AI’s capabilities β€” from web access and proxy networks to AI tooling and data pipelines.

CompanyAbout
Massive is a web access API backed by millions of volunteer devices in 195+ countries. AI agents, models, and data pipelines use it to reach any site on the internet, reliably, in real time, and at scale.

🏒 Enterprise Sponsors

Our enterprise sponsors support Crawl4AI and help scale it to power production-grade data pipelines.

CompanyAboutSponsorship Tier
Helps engineers and buyers find, compare, and source electronic & industrial parts in seconds, with specs, pricing, lead times & alternatives.πŸ₯‡ Gold
Kidocode is a hybrid technology and entrepreneurship school for kids aged 5–18, offering both online and on-campus education.πŸ₯‡ Gold
Singapore-based Aleph Null is Asia’s leading edtech hub, dedicated to student-centric, AI-driven educationβ€”empowering learners with the tools to thrive in a fast-changing world.πŸ₯‡ Gold

πŸ’Ό Become a Strategic Partner or Sponsor

Interested in partnering with Crawl4AI?

Whether you’re a proxy provider, AI infrastructure company, cloud platform, or an organization looking to support the Crawl4AI ecosystem, we’d love to hear from you.

πŸ“© Contact: hello@crawl4ai.com

πŸ§‘β€πŸ€ Individual Sponsors

A heartfelt thanks to our individual supporters! Every contribution helps us keep our opensource mission alive and thriving!

Want to join them? Sponsor Crawl4AI β†’

πŸ“§ Contact

Discord Β· X @unclecode Β· GitHub @unclecode Β· hello@crawl4ai.com

  • Building crawlers or AI agents for a living? DM me on X. I want to work with people like you, and we are hiring.
  • From a company? We have an enterprise offer and we tailor it to your business. SOC 2 Type I is done, Type II is in progress. Write to hello@crawl4ai.com.

Happy crawling! πŸ•ΈοΈπŸš€

Star History

Use Crawl4ai MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Crawl4ai is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Crawl4ai as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Crawl4ai MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "crawl4ai": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Crawl4ai MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Crawl4ai MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Crawl4ai to help me with this task?
Crawl4ai
Sure. I read it.
Here is what I found using Crawl4ai.

Frequently asked questions

What is the Crawl4ai MCP server used for?

Crawl4ai is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Crawl4ai MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Crawl4ai with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Crawl4ai MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Crawl4ai connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Crawl4ai MCP to TypingMind?

Crawl4ai runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Crawl4ai MCP provide in TypingMind?

Crawl4ai exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Crawl4ai MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Crawl4ai requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter πŸ‘‡