Firecrawl Rust Agent Quickstart
This is the canonical quickstart for external agents integrating with Firecrawl using the official Rust SDK. Generated from SDK source and OpenAPI spec.Install
Add to yourCargo.toml:
Authenticate
Client::new requires an API key. Client::new_selfhosted allows an optional key for keyless free-tier usage.
When To Use What
search— Use when you start with a query and need to discover relevant pages. Returns search results grouped by source type, optionally with scraped content.scrape— Use when you already have a URL and want its content. Returns markdown, HTML, structured data, screenshots, or other formats.interact— Use when the page needs post-scrape browser actions like clicking, filling forms, or executing code in the browser sandbox.
Search
Why use it
Search the web and optionally scrape each result in one call. Start here when you have a question or topic but not a specific URL.Preferred SDK method
Example
Parameters
All fields onSearchOptions are Option and default to None.
A convenience method
search_and_scrape(query, limit) is also available. It searches with default scrape options and returns Vec<Document> directly.
Scrape
Why use it
Fetch and extract content from a single URL. Use when you have a specific page to read.Preferred SDK method
Example
Parameters
All fields onScrapeOptions are Option and default to None.
A convenience method
scrape_with_schema(url, schema, prompt) is also available for JSON extraction.
Interact
Why use it
Execute code or natural-language prompts in the browser sandbox associated with a scrape job. Use after a scrape to click buttons, fill forms, navigate, or extract additional data.Preferred SDK method
Example
Parameters
All fields onScrapeExecuteOptions are Option and default to None.
At least one of
code or prompt must be provided or the client returns FirecrawlError::Misuse.
Related method
Notes
- Naming style: All struct fields use snake_case. Serialization to camelCase is handled internally by serde.
- Deprecated aliases:
scrape_execute()→ useinteract()instead.stop_interactive_browser()anddelete_scrape_browser()→ usestop_interaction()instead.
- Async: All methods are async and return
Result<T, FirecrawlError>. - Origin auto-set: The SDK automatically sets
originto"rust-sdk@{version}"if not explicitly provided.
Source Of Truth
firecrawl/apps/rust-sdk/src/v2/client.rsfirecrawl/apps/rust-sdk/src/v2/scrape.rsfirecrawl/apps/rust-sdk/src/v2/search.rsfirecrawl/apps/rust-sdk/Cargo.tomlfirecrawl-docs/api-reference/v2-openapi.json

