Firecrawl Rust Agent Quickstart
Canonical quickstart for external agents. Generated from SDK source (firecrawl crate) and the v2 OpenAPI spec. Method names and parameters match the SDK public API.
Install
firecrawl on crates.io.
Authenticate
Client::new(api_key) connects to https://api.firecrawl.dev. Client::new_selfhosted(api_url, api_key) connects to a self-hosted instance. An empty key falls back to the keyless free tier.
When To Use What
search: use when you start with a query and need discovery.scrape: use when you already have a URL and want page content.interact: use when the page needs clicks, forms, or post-scrape browser actions. Requires ascrapeIdfrom a prior scrape.
Search
Why use it
Discover relevant pages from a query, then pick URLs to scrape or interact with. Constrain results to a site withsite: in the query.
Preferred SDK method
client.search(query, options) → Result<SearchResponse, FirecrawlError>
Example
results.data.web, results.data.news, results.data.images.
Parameters
Scrape
Why use it
Get structured content from a URL in one or more formats.Preferred SDK method
client.scrape(url, options) → Result<Document, FirecrawlError>
Example
Parameters
Interact
Why use it
Control the browser session tied to a prior scrape. Use for clicks, form fills, code execution, or natural-language instructions.Preferred SDK method
client.interact(job_id, options) → Result<ScrapeExecuteResponse, FirecrawlError>
At least one of code or prompt must be non-empty; otherwise returns FirecrawlError::Misuse.
Example
Parameters
Stop the session with
client.stop_interaction(job_id).
Notes
- Deprecated aliases:
scrape_execute→interact,stop_interactive_browser/delete_scrape_browser→stop_interaction. - All types are exported at crate root:
use firecrawl::Client. ScrapeOptionshas dedicated sub-option structs:json_options,screenshot_options,change_tracking_options.search_and_scrape(query, limit)is a convenience that callssearchwith default scrape options and returnsVec<Document>.
Source Of Truth
firecrawl/apps/rust-sdk/Cargo.tomlfirecrawl/apps/rust-sdk/src/client.rsfirecrawl/apps/rust-sdk/src/scrape.rsfirecrawl/apps/rust-sdk/src/search.rsfirecrawl-docs/api-reference/v2-openapi.json

