Firecrawl Rust Agent Quickstart
This file is the canonical quickstart for external agents integrating Firecrawl via the Rust SDK. It is generated from SDK source and OpenAPI spec.Install
Add toCargo.toml:
Authenticate
new_selfhosted. If omitted, the client falls back to keyless free tier (rate-limited per IP).
When To Use What
search: Use when you start with a query and need to discover relevant URLs and their content. Returns results from web, news, and image sources.scrape: Use when you already have a specific URL and want its page content in markdown, HTML, JSON, or other formats.interact: Use when the page needs post-scrape browser actions like clicking, typing, scrolling, or executing code in a live browser session.
Search
Why use it
Search the web for a query and optionally scrape the results. Returns categorized results from web, news, and image sources with optional content extraction.Preferred SDK method
Example
Parameters
All fields onSearchOptions are Option<T> and default to None via #[derive(Default)].
Convenience method
scrape_options to defaults and returns Vec<Document> directly, filtering out non-document results.
Scrape
Why use it
Scrape a single URL and get its content in one or more formats. Supports browser automation, LLM extraction, screenshots, and more.Preferred SDK method
Example
Parameters
All fields onScrapeOptions are Option<T> and default to None via #[derive(Default)].
Actions (enum variants)
Convenience method
serde_json::Value.
Interact
Why use it
Execute code or send natural-language prompts in a live browser session tied to a scrape job. Use for post-scrape interactions like clicking buttons, filling forms, or running scripts.Preferred SDK method
Example
Parameters
All fields onScrapeExecuteOptions are Option<T> and default to None.
At least one of
code or prompt must be a non-empty string, or a FirecrawlError::Misuse is returned before any HTTP call.
Use client.stop_interaction(job_id).await? to end the browser session.
Notes
- Naming style: All struct fields use snake_case. Serde handles the camelCase conversion for the API.
- Deprecated aliases:
scrape_execute()is deprecated in favor ofinteract().stop_interactive_browser()anddelete_scrape_browser()are deprecated in favor ofstop_interaction(). - Async: All methods are async and require a tokio runtime.
- Error handling: All methods return
Result<T, FirecrawlError>.
Source Of Truth
/firecrawl/apps/rust-sdk/src/v2/client.rs/firecrawl/apps/rust-sdk/src/v2/search.rs/firecrawl/apps/rust-sdk/src/v2/scrape.rs/firecrawl-docs/api-reference/v2-openapi.json

