---
source_url: "https://github.com/spider-rs/spider"
title: "GitHub - spider-rs/spider: Get web data for AI agents and LLMs · GitHub"
mirrored_at: 2026-08-16T15:33:54.919Z
host: github.com
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/github.com/spider-rs/spider"
---

> **Original source:** https://github.com/spider-rs/spider

The fastest web crawler and scraper for Rust.

    

#### [spider.cloud](https://spider.cloud/?utm_source=github&utm_medium=readme&utm_campaign=spider_rs) · [Guides](https://spider.cloud/guides?utm_source=github&utm_medium=readme&utm_campaign=spider_rs) · [Docs](https://docs.rs/spider) · [Examples](https://github.com/spider-rs/spider/blob/main/examples) · [Discord](https://discord.spider.cloud/)

* * *

Spider is a concurrency-first crawling engine built in Rust. It streams pages the moment they arrive, renders JavaScript only when a page demands it, and scales from a single script to a distributed fleet without changing your code. The same engine powers [Spider Cloud](https://spider.cloud/?utm_source=github&utm_medium=readme&utm_campaign=spider_rs), so you can prototype locally and move to managed infrastructure with one config change.

## Start in the cloud

The hardest part of crawling at scale isn't the code. It's the proxies, headless browsers, and constant anti-bot churn. Spider Cloud runs all of that for you behind the same API.

[**Get a free API key →**](https://spider.cloud/?utm_source=github&utm_medium=readme&utm_campaign=spider_rs) (no card required)

\[dependencies\]
spider = { version = "2", features = \["spider\_cloud"\] }

use spider::configuration::{SpiderCloudConfig, SpiderCloudMode};
use spider::website::Website;

let cloud = SpiderCloudConfig::new("sk-...")
    .with\_mode(SpiderCloudMode::Smart); // proxy by default, auto-unblock when blocked

let mut website = Website::new("https://example.com")
    .with\_spider\_cloud\_config(cloud)
    .build()?;

`Smart` mode routes through proxies first and escalates to the unblocker only on pages that fight back, so you pay for bypass exactly when it's needed and never when it isn't.

## Or run it locally

No key, no service. Just the crawler.

\[dependencies\]
spider = "2"

use spider::{tokio, website::Website};

#\[tokio::main\]
async fn main() {
    let mut website = Website::new("https://example.com");
    let mut rx = website.subscribe(16);

    tokio::spawn(async move {
        while let Ok(page) = rx.recv().await {
            println!("{}  {}", page.status\_code, page.get\_url());
        }
    });

    website.crawl().await;
    website.unsubscribe();
}

Pages stream in as they're fetched. The crawler discovers links, respects boundaries, and stops on its own.

## How it works

Spider runs HTTP-first and only launches headless Chrome when a page actually needs JavaScript. Streaming is built into both the HTTP and Chrome paths, so pages flow back the moment they're fetched instead of batching at the end. That design delivers best-in-class concurrency throughput, sustaining extremely high request volumes that scale from a single async task to a distributed worker fleet on the same API. Proxies, retries, rate limiting, and stealth are built in.

## Install

You want…

Run

Rust library

`cargo add spider`

Command-line tool

`cargo install spider_cli`

Node.js package

`npm i @spider-rs/spider-rs`

Python package

`pip install spider_rs`

MCP server (Claude, Cursor, …)

`cargo install spider_mcp`

Managed crawling

[spider.cloud](https://spider.cloud/?utm_source=github&utm_medium=readme&utm_campaign=spider_rs)

## Configuration

Every option has a sensible default, so set only what you need.

let mut website = Website::new("https://example.com")
    .with\_limit(50)                    // concurrent requests
    .with\_depth(10)                    // how deep to follow links
    .with\_delay(500)                   // pause between requests (ms)
    .with\_respect\_robots\_txt(true)
    .with\_subdomains(true)
    .with\_user\_agent(Some("MyBot/1.0"))
    .with\_stealth(true)
    .build()
    .unwrap();

Full reference in the [`Configuration` docs](https://docs.rs/spider/latest/spider/configuration/struct.Configuration.html).

For JavaScript-heavy sites, enable `features = ["chrome"]` and call `crawl_smart()`. Spider tries HTTP first and only launches Chrome on pages that need it.

## Use cases

Teams use Spider to feed the open web into vector stores for LLM and RAG pipelines, monitor sites for SEO and price changes, export pages as Markdown, JSON, or WARC, and drive headless Chrome for AI browsing agents. There are [50+ runnable examples](https://github.com/spider-rs/spider/blob/main/examples) to start from.

## Learn more

-   📚 [Guides](https://spider.cloud/guides?utm_source=github&utm_medium=readme&utm_campaign=spider_rs): recipes and integrations
-   📖 [API docs](https://docs.rs/spider): every option and method
-   💬 [Discord](https://discord.spider.cloud/): questions and ideas
-   🐛 [Issues](https://github.com/spider-rs/spider/issues): bugs and feature requests

## Contributing

PRs welcome. See [`CONTRIBUTING.md`](https://github.com/spider-rs/spider/blob/main/CONTRIBUTING.md).

cargo test -p spider                  # unit tests
RUN\_LIVE\_TESTS=1 cargo test           # live network tests

## License

[MIT](https://github.com/spider-rs/spider/blob/main/LICENSE).