Skip to main content

Installation

The official Rust SDK is maintained in the EvoCrawl monorepo at apps/rust-sdk. To install the EvoCrawl Rust SDK, add the dependency from crates.io:
Or install via Cargo:
Requires Rust 1.70 or later.

Usage

  1. Get an API key from evocrawl.com
  2. Set the API key as an environment variable named EVOCRAWL_API_KEY, or pass it directly to Client::new(...)
Here is a quick example using the SDK:

Scraping a URL

To scrape a single URL, use the scrape method.

JSON Extraction

Extract structured JSON using scrape_with_schema:
Or configure JSON extraction via ScrapeOptions directly:

Crawling a Website

To crawl a website and wait for completion, use crawl.

Start a Crawl

Start a job without waiting using start_crawl.

Checking Crawl Status

Check crawl progress with get_crawl_status.

Cancelling a Crawl

Cancel a running crawl with cancel_crawl.

Checking Crawl Errors

Retrieve errors from a crawl job with get_crawl_errors.

Mapping a Website

Discover links on a site using map.
For a simpler result with just URLs, use map_urls:

Searching the Web

Search with optional settings using search.
For a convenience method that returns scraped documents directly:

Batch Scraping

Scrape multiple URLs in parallel using batch_scrape.

Agent

Run an AI-powered agent with agent.
With a JSON schema for structured output:

Scrape-Bound Interactive Session

Use a scrape job ID to run follow-up browser code in the same context:
  • interact(...) runs code or prompts in the scrape-bound browser session.
  • stop_interaction(...) stops the interactive session when you are done.

Configuration

Client::new(...) and Client::new_selfhosted(...) create the client.

Environment Variable

Set the EVOCRAWL_API_KEY environment variable instead of passing the key directly:

Poll Intervals

Synchronous methods (crawl, batch_scrape, agent) poll until completion. You can customize the poll interval via the options struct:

Error Handling

The SDK uses the EvocrawlError enum, which implements Error, Debug, and Display. All methods return Result<T, EvocrawlError>.
Are you an AI agent that needs a EvoCrawl API key? See evocrawl.com/agent-onboarding/SKILL.md for automated onboarding instructions.