Guides · From the library
From the library to the cloud
You already know crawl4ai, the open-source crawler. The cloud runs the same engine behind one key: no browser to install, no proxies to buy, no cookies to manage. Each library call has one tool, run with POST /tools/{id}.
# one page → Markdown
async with AsyncWebCrawler() as crawler:
result = await crawler.arun("https://example.com")
print(result.markdown)
# many pages
results = await crawler.arun_many(urls, config=run_conf)
# typed JSON out of a page
config = CrawlerRunConfig(extraction_strategy=LLMExtractionStrategy(schema=..., instruction=...))
result = await crawler.arun(url, config=config)# one page → Markdown (the scrape tool)
curl -X POST https://api.crawl4ai.com/tools/scrape -H "Authorization: Bearer $CRAWL4AI_API_KEY" -H "Content-Type: application/json" -d '{"url": "https://example.com", "format": "md"}'
# many pages, results stream as they land (POST /tools/batch; without "stream", one job for thousands)
curl -N -X POST https://api.crawl4ai.com/tools/batch -H "Authorization: Bearer $CRAWL4AI_API_KEY" -H "Content-Type: application/json" -d '{"tool": "scrape", "stream": true, "inputs": [{"url": "https://a.com"}, {"url": "https://b.com"}]}'
# typed rows out of a page (the extract tool)
curl -X POST https://api.crawl4ai.com/tools/extract -H "Authorization: Bearer $CRAWL4AI_API_KEY" -H "Content-Type: application/json" -d '{"url": "https://example.com", "instruction": "the product name and price"}'
# web search, which the library does not have (the search tool)
curl -X POST https://api.crawl4ai.com/tools/search -H "Authorization: Bearer $CRAWL4AI_API_KEY" -H "Content-Type: application/json" -d '{"q": "web scraping"}'import os, requests
H = {"Authorization": f"Bearer {os.environ['CRAWL4AI_API_KEY']}"}
BASE = "https://api.crawl4ai.com/tools"
# one page → Markdown
md = requests.post(BASE + "/scrape", json={"url": "https://example.com", "format": "md"}, headers=H).json()["data"]["markdown"]
# typed rows out of a page
rows = requests.post(BASE + "/extract", json={"url": url, "instruction": "the product name and price"}, headers=H).json()["rows"]
# web search
hits = requests.post(BASE + "/search", json={"q": "web scraping"}, headers=H).json()["rows"]| in the library | in the cloud | what changes |
|---|---|---|
crawler.arun(url) |
POST /tools/scrape |
the engine is picked per domain (cache → HTTP → browser); bot walls and proxies are handled; the page is data.markdown |
crawler.arun_many(urls) |
POST /tools/batch |
up to 50 pages stream back as they land, or one job for thousands, followed under /tools/jobs |
LLMExtractionStrategy / JsonCssExtractionStrategy |
POST /tools/extract |
a plain-English instruction or a JSON schema; no selectors to write; the items are rows |
PruningContentFilter → fit_markdown |
on by default | every scrape returns clean Markdown with the boilerplate stripped |
| (no web search) | POST /tools/search |
ranked results as rows, from our own search stack |
| (no site scrapers) | 98 data tools | one tool per named site (Amazon, LinkedIn, YouTube and more), rows with the same columns every time: GET /tools?kind=sites |
| your machine's browser, proxies, cookies | ours | three regions, routed to the nearest; the library stays open source, forever |