Docs · Examples · Spider Cloud · Discord The crate crawled 10,000 pages on loopback in 0.28 s, and 100,000 in 3.9 s, on an Apple M1 Max. Run it yourself. Spider Cloud figures are from a 1,000 URL run on February 11, 2026, with its method . Quickstart Spider finds the links, fetches them concurrently and hands you each page the moment it lands. It stops when the site runs out or a limit you set is reached. Scale it…
The crate crawled 10,000 pages on loopback in 0.28 s, and 100,000 in 3.9 s, on an Apple M1 Max. Run it yourself. Spider Cloud figures are from a 1,000 URL run on February 11, 2026, with its method.
Quickstart
cargo add spider
use spider::{tokio, website::Website};
#[tokio::main]
async fn main() {
let mut website = Website::new("https://example.com");
let mut rx = website.subscribe(0);
let printer = tokio::spawn(async move {
while let Ok(page) = rx.recv().await {
println!("{} {}", page.status_code, page.get_url());
}
});
website.crawl().await;
website.unsubscribe();
let _ = printer.await;
}
Spider finds the links, fetches them concurrently and hands you each page the moment it lands. It stops when the site runs out or a limit you set is reached.
Scale it on Spider Cloud
A crawl outgrows one machine when it needs proxies and a fleet of browsers. Spider Cloud runs both, and moving to it takes one feature flag and a config.
[dependencies]
spider = { version = "2", features = ["spider_cloud"] }
use spider::configuration::{SpiderCloudConfig, SpiderCloudMode, SpiderCloudReturnFormat};
let cloud = SpiderCloudConfig::new("YOUR_API_KEY")
.with_mode(SpiderCloudMode::Smart)
.with_return_format(SpiderCloudReturnFormat::Markdown);
let mut website = Website::new("https://example.com")
.with_spider_cloud_config(cloud)
.build()
.unwrap();
Smart mode sends each request through Spider’s proxies. When that fetch fails, it hands the page to the scrape API, which can render it in a browser. Pages come back as markdown, ready for a model or a vector store.
HTTP first, Chrome when a page needs it. With the smart feature, crawl_smart() fetches over plain HTTP and opens Chrome only for pages that build their content with JavaScript. See smart.rs.
Streaming.subscribe() delivers each page as it is fetched, on both the HTTP and the Chrome path. See subscribe.rs.
Limits you set. Page count, depth, a budget per path, delay, concurrency, retries, robots.txt, and allow and deny lists that take regex patterns with the regex feature.
Scheduled and cached crawls. Cron schedules, HTTP caching to disk or memory, sitemap discovery and WARC 1.1 output.
More than one machine. The decentralized feature moves fetching to spider_worker processes on other hosts.
Chrome control. Screenshots, request interception, ad blocking and remote Chrome over CHROME_URL.
Your own proxies.with_proxies takes a list of proxy URLs for local crawls, with SOCKS5 under the socks feature.
let mut website = Website::new("https://example.com")
.with_limit(500) // stop after 500 pages
.with_depth(10) // how far to follow links
.with_concurrency_limit(Some(50)) // requests in flight
.with_delay(250) // pause between requests, in ms
.with_respect_robots_txt(true)
.build()
.unwrap();
Spider Cloud hosts an MCP server at https://mcp.spider.cloud/mcp. It signs in with OAuth on the first tool call. To run an MCP server on your own machine, install the spider_mcp crate. Coding agents working in this repository start at AGENTS.md.
评论