Installation
The official Rust SDK is maintained in the Firecrawl monorepo at apps/rust-sdk. To install the Firecrawl Rust SDK, add the dependency from crates.io:Requires Rust 1.70 or later.
Usage
- Get an API key from firecrawl.dev
- Set the API key as an environment variable named
FIRECRAWL_API_KEY, or pass it directly toClient::new(...)
Scraping a URL
To scrape a single URL, use thescrape method.
JSON Extraction
Extract structured JSON usingscrape_with_schema:
ScrapeOptions directly:
Parsing uploaded files
Useparse to upload a local file (.html, .htm, .pdf, .docx, .doc, .odt, .rtf, .xlsx, .xls) as multipart form data to /v2/parse. The endpoint returns a Document with the requested formats.
ParseOptions intentionally omits scrape-only fields that /v2/parse rejects (such as actions, waitFor, location, mobile, screenshot, branding, and changeTracking).
Build a ParseFile from in-memory bytes or directly from a path:
ParseFile
ParseOptions
Supported fields (all optional, camelCase on the wire):
formats: Vec<ParseFormat>— any ofMarkdown,Html,RawHtml,Links,Images,Summary,Json,Attributesonly_main_content: boolinclude_tags: Vec<String>/exclude_tags: Vec<String>headers: HashMap<String, String>timeout: u32(ms)parsers: Vec<ParserConfig>(e.g. PDF parser config)skip_tls_verification: boolremove_base64_images: boolfast_mode: boolblock_ads: boolproxy: ParseProxyType(BasicorAuto)json_options: JsonOptionsattribute_selectors: Vec<AttributeSelector>zero_data_retention: boolintegration: String,origin: String,use_mock: String
Crawling a Website
To crawl a website and wait for completion, usecrawl.
Start a Crawl
Start a job without waiting usingstart_crawl.
Checking Crawl Status
Check crawl progress withget_crawl_status.
Cancelling a Crawl
Cancel a running crawl withcancel_crawl.
Checking Crawl Errors
Retrieve errors from a crawl job withget_crawl_errors.
Mapping a Website
Discover links on a site usingmap.
map_urls:
Searching the Web
Search with optional settings usingsearch.
Batch Scraping
Scrape multiple URLs in parallel usingbatch_scrape.
Agent
Run an AI-powered agent withagent.
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 theFIRECRAWL_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 theFirecrawlError enum, which implements Error, Debug, and Display. All methods return Result<T, FirecrawlError>.
Are you an AI agent that needs a Firecrawl API key? See firecrawl.dev/agent-onboarding/SKILL.md for automated onboarding instructions.

