Official Crawl4AI Cloud: a hosted web scraping, extraction, and search API for AI agents. Free API key, 1,000 credits a month, no card. Fully open source: this repo is the Apache-2.0 crawler that powers it, and you can self-host it.
Python aiai-agentscrawl4ai-cloudcrawlerdata-extractionllmmarkdownmcpopen-sourceplaywrightpythonragscraperweb-crawlerweb-crawlingweb-scraping
cloud notice: the monthly offer, once per release, and the two moments of pain
unclecode5face68778c6
diff --git a/README.md b/README.mdindex 96beb035..8253d5b0 100644--- a/README.md+++ b/README.md@@ -14,7 +14,7 @@---#### ☁️ Crawl4AI Cloud is live — the same crawler, hosted-No browsers to run, no proxies to buy, no cookies to babysit. One key with **$5 of free credit**, and your AI agent can search, scrape, crawl and extract the web through the engine you already use. Works in Claude Code, Codex, OpenCode and Cursor with one pasted line.+No browsers to run, no proxies to buy, no cookies to babysit. One key with **$5 free every month** (no card), and your AI agent can search, scrape, crawl and extract the web through the engine you already use. Works in Claude Code, Codex, OpenCode and Cursor with one pasted line.👉 **[Get a key in 10 seconds](https://crawl4ai.com/?ref=readme)** · [Cloud docs](https://crawl4ai.com/docs?ref=readme)_The library stays open source, forever. The cloud is for the days you want to build fast and let us run the infrastructure._diff --git a/crawl4ai/async_webcrawler.py b/crawl4ai/async_webcrawler.pyindex a9ba6660..110773ca 100644--- a/crawl4ai/async_webcrawler.py+++ b/crawl4ai/async_webcrawler.py@@ -638,6 +638,13 @@ class AsyncWebCrawler:if _blocked:crawl_result.success = Falsecrawl_result.error_message = f"Blocked by anti-bot protection: {_block_reason}"+ # the moment the hosted crawler helps most; at most once a day+ try:+ from .cloud_notice import show_blocked++ show_blocked(self.logger)+ except Exception:+ passcrawl_result.crawl_stats = _crawl_statselse:# All proxies threw exceptions and fallback either wasn'tdiff --git a/crawl4ai/cloud_notice.py b/crawl4ai/cloud_notice.pyindex 4111cae7..db6783b6 100644--- a/crawl4ai/cloud_notice.py+++ b/crawl4ai/cloud_notice.py@@ -1,24 +1,43 @@-"""The Crawl4AI Cloud notice: one short block that tells a user the hosted version exists.+"""The Crawl4AI Cloud notice: short lines that tell a user the hosted version exists.-It prints in two places: at the end of ``crawl4ai-setup`` (every time), and once per machine when the-first ``AsyncWebCrawler`` starts or the ``crwl`` CLI first runs (a marker file in the crawl4ai home-folder remembers it). ``CRAWL4AI_NO_CLOUD_NOTICE=1`` turns it off everywhere, for operators who run the-library in production logs.+It prints in four places:++- at the end of ``crawl4ai-setup``, every time (``show_at_install``);+- once per minor release per machine, when the first ``AsyncWebCrawler`` starts or the ``crwl`` CLI runs+ (``show_once``; a marker file in the crawl4ai home folder holds the last minor version shown);+- when a crawl is blocked by anti-bot protection, at most once a day (``show_blocked``);+- when ``crawl4ai-setup`` could not install the browser (``show_setup_failed``).++Each link carries its own ``ref`` so the cloud can tell which moment brought a user.+``CRAWL4AI_NO_CLOUD_NOTICE=1`` turns every line off, for operators who run the library in production logs."""import os+import timefrom pathlib import PathCLOUD_URL = "https://crawl4ai.com/?ref=pip"+BLOCKED_URL = "https://crawl4ai.com/?ref=blocked"+SETUP_URL = "https://crawl4ai.com/?ref=setup"_ENV_OFF = "CRAWL4AI_NO_CLOUD_NOTICE"_MARKER = ".cloud-notice-shown"+_BLOCKED_MARKER = ".cloud-notice-blocked"LINES = (- "Crawl4AI Cloud is live: the same crawler, hosted. No browsers to run, no proxies, $5 of free credit.",+ "Crawl4AI Cloud is live: the same crawler, hosted. $5 free every month, no card. Try it now with no signup.",f"Get a key in 10 seconds: {CLOUD_URL} (the library stays open source, forever)",f"Hide this notice: {_ENV_OFF}=1",)+BLOCKED_LINES = (+ f"Blocked? Crawl4AI Cloud gets through the hard sites, $5 free every month: {BLOCKED_URL}",+ f"Hide this notice: {_ENV_OFF}=1",+)++SETUP_LINES = (+ f"Browser setup failed? Skip it: the same crawler, hosted, nothing to install, $5 free every month: {SETUP_URL}",+)+def _home() -> Path:try:@@ -29,6 +48,16 @@ def _home() -> Path:return Path.home() / ".crawl4ai"+def _minor_version() -> str:+ """This release's minor version, "0.9" for 0.9.3: the notice returns once per minor release."""+ try:+ from .__version__ import __version__++ return ".".join(__version__.split(".")[:2])+ except Exception:+ return ""++def is_off() -> bool:"""True when the operator turned the notice off with the environment variable."""return os.environ.get(_ENV_OFF, "").strip().lower() in ("1", "true", "yes")@@ -39,35 +68,55 @@ def text() -> str:return "\n".join(LINES)-def show_at_install(logger=None) -> None:- """Print the notice at the end of ``crawl4ai-setup``. Every run; nothing is remembered."""- if is_off():- return+def _print(lines, logger=None) -> None:if logger is not None:- for line in LINES:+ for line in lines:logger.info(line, tag="CLOUD")else:- print(text())+ print("\n".join(lines))-def show_once(logger=None) -> bool:- """Print the notice the first time the library or the CLI runs on this machine. Returns True when- it printed. The marker file keeps it to one time; a machine without a writable home never repeats- the notice more than once per process."""- if is_off():- return False- marker = _home() / _MARKER+def _claim(name: str, value: str) -> bool:+ """True when the marker file ``name`` does not hold ``value`` yet, and writes it. A home folder that+ cannot be written answers True, so the line shows once per process there (rare, acceptable)."""+ marker = _home() / nametry:- if marker.exists():+ if marker.exists() and marker.read_text().strip() == value:return Falsemarker.parent.mkdir(parents=True, exist_ok=True)- marker.write_text("shown\n")+ marker.write_text(value + "\n")except Exception:- # no writable home: show it this once, and again next process (rare, acceptable)pass- if logger is not None:- for line in LINES:- logger.info(line, tag="CLOUD")- else:- print(text())return True+++def show_at_install(logger=None) -> None:+ """Print the notice at the end of ``crawl4ai-setup``. Every run; nothing is remembered."""+ if is_off():+ return+ _print(LINES, logger)+++def show_once(logger=None) -> bool:+ """Print the notice the first time the library or the CLI runs on this machine after a new minor+ release. Returns True when it printed."""+ if is_off() or not _claim(_MARKER, _minor_version() or "shown"):+ return False+ _print(LINES, logger)+ return True+++def show_blocked(logger=None) -> bool:+ """Print the blocked line when a crawl hit anti-bot protection: the moment the cloud helps most.+ At most once a day per machine. Returns True when it printed."""+ if is_off() or not _claim(_BLOCKED_MARKER, time.strftime("%Y-%m-%d", time.gmtime())):+ return False+ _print(BLOCKED_LINES, logger)+ return True+++def show_setup_failed(logger=None) -> None:+ """Print the setup line when ``crawl4ai-setup`` could not install the browser."""+ if is_off():+ return+ _print(SETUP_LINES, logger)diff --git a/crawl4ai/install.py b/crawl4ai/install.pyindex 5c4e69bf..515201db 100644--- a/crawl4ai/install.py+++ b/crawl4ai/install.py@@ -39,6 +39,16 @@ def setup_home_directory():with open(crawl4ai_config, "w") as f:f.write("")+def _cloud_setup_hint():+ """After a failed browser install, name the hosted crawler that needs no browser."""+ try:+ from .cloud_notice import show_setup_failed++ show_setup_failed(logger)+ except Exception:+ pass++def post_install():"""Run all post-installation tasks.@@ -120,11 +130,13 @@ def install_playwright():logger.warning(f"Please run '{sys.executable} -m playwright install --with-deps' manually after the installation.")+ _cloud_setup_hint()except Exception:# logger.error(f"Unexpected error during Playwright installation: {e}", tag="ERROR")logger.warning(f"Please run '{sys.executable} -m playwright install --with-deps' manually after the installation.")+ _cloud_setup_hint()# Install Patchright browsers for undetected browser supportlogger.info("Installing Patchright browsers for undetected mode...", tag="INIT")diff --git a/docs/md_v2/overrides/partials/cloud-banner.html b/docs/md_v2/overrides/partials/cloud-banner.htmlindex 8826d11b..a92edc2e 100644--- a/docs/md_v2/overrides/partials/cloud-banner.html+++ b/docs/md_v2/overrides/partials/cloud-banner.html@@ -10,13 +10,13 @@<div class="c4b-text"><div class="c4b-eyebrow"><span class="c4b-tag">New</span> good news for everyone who runs Crawl4AI</div><h2 class="c4b-title">Crawl4AI <em>Cloud</em> is live.<br>The same crawler, hosted.</h2>- <p class="c4b-lead">No browsers to run, no proxies to buy, no cookies to babysit. One key with <b>$5 of free credit</b>, and your AI agent can <b>search, scrape, crawl and extract</b> the web through the same engine you already use.</p>+ <p class="c4b-lead">No browsers to run, no proxies to buy, no cookies to babysit. One key with <b>$5 free every month</b>, and your AI agent can <b>search, scrape, crawl and extract</b> the web through the same engine you already use.</p><p class="c4b-oss"><b>Always open source, forever.</b> The library stays here and stays free. The cloud is for the days you want to build fast and let us run the infrastructure.</p><div class="c4b-cta">- <a class="c4b-btn" href="https://crawl4ai.com/?ref=docs-banner" data-c4b-ev="banner_key_clicked">Get a key + $5 free credit →</a>+ <a class="c4b-btn" href="https://crawl4ai.com/?ref=docs-banner" data-c4b-ev="banner_key_clicked">Get a key, $5 free every month →</a><a class="c4b-btn c4b-ghost" href="https://crawl4ai.com/?ref=docs-banner" data-c4b-ev="banner_cloud_clicked">See Crawl4AI Cloud</a></div>- <div class="c4b-meta"><span>no card</span><span><b>$5 free credit</b> to start</span><span>EU · Singapore · US</span><span>MCP built in</span></div>+ <div class="c4b-meta"><span>no card</span><span><b>$5 free</b> every month</span><span>EU · Singapore · US</span><span>MCP built in</span></div></div><div class="c4b-paste" aria-label="Paste this into your agent"><div class="c4b-tabs" role="tablist">@@ -36,7 +36,7 @@<div class="c4b-small"><span class="c4b-star">★</span>- <span class="c4b-t"><b>Crawl4AI Cloud is live</b> — the same crawler, hosted. Get a key with $5 free credit and paste one line into your agent.</span>+ <span class="c4b-t"><b>Crawl4AI Cloud is live</b> — the same crawler, hosted. Get a key with $5 free every month and paste one line into your agent.</span><span class="c4b-sp"></span><a class="c4b-go" href="https://crawl4ai.com/?ref=docs-banner" data-c4b-ev="banner_key_clicked">Get a key →</a><button type="button" data-c4b-act="expand">show</button>