Skip to main content
The Firecrawl Rust SDK provides a robust, type-safe interface for scraping, crawling, and extracting structured data from websites. It leverages Rust’s async capabilities with Tokio and provides comprehensive error handling.

Installation

Add to your Cargo.toml:

Quick Start

Authentication

Get your API key from firecrawl.dev and initialize the client:

Scraping

Basic Scrape

Scrape a single URL:

Scrape with Options

Extract Structured Data

Extract data using a JSON schema:

Crawling

Basic Crawl (Auto-Wait)

Crawl a website and wait for completion:

Async Crawl (Manual Polling)

Start a crawl and check status manually:

Cancel a Crawl

Map

Discover all URLs on a website:

Map with Options

Search the web:

Batch Scraping

Scrape multiple URLs in parallel:

Using v2 API

The SDK also provides access to the v2 API:

Error Handling

The SDK uses the FirecrawlError enum for comprehensive error handling:

Configuration

Testing

Run the test suite:

Examples

See the examples directory for more usage examples:
  • example.rs - Basic v1 usage
  • v2_example.rs - v2 API usage
  • extract_example.rs - Structured data extraction
  • search_example.rs - Web search
  • batch_scrape_example.rs - Batch scraping
  • cancel_crawl_example.rs - Cancelling crawls

Resources