Firecrawl Rust Agent Quickstart
Canonical quickstart for external agents. Generated from SDK source (firecrawl crate v2.18.0) and the v2 OpenAPI spec. Method names, parameters, and types match the SDK public API.
Install
Authenticate
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 a scrape job ID from 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:, for example site:docs.firecrawl.dev crawl webhooks.
Preferred SDK method
client.search(query, options) → Result<SearchResponse, FirecrawlError>
Example
Parameters
Scrape
Why use it
Fetch structured content from a URL in one or more formats. Use when you already have the URL.Preferred SDK method
client.scrape(url, options) → Result<Document, FirecrawlError>
Example
Parameters
Format enum values:
Simple:
Markdown, Html, RawHtml, Links, Images, Screenshot, Summary, ChangeTracking, Json, Attributes, Branding, Product, Menu, Audio, Video.
Object variants: Question(QuestionFormat { question }), Highlights(HighlightsFormat { query }).
Interact
Why use it
Control the browser session tied to a scrape job. Use for code execution or natural-language instructions after a scrape creates a session.Preferred SDK method
client.interact(job_id, options) → Result<ScrapeExecuteResponse, FirecrawlError>
Example
Parameters
At least one of
code or prompt must be non-empty (SDK returns FirecrawlError::Misuse otherwise).
Stop session: client.stop_interaction(job_id) ends the browser session.
Notes
- Deprecated aliases:
scrape_execute→interact;stop_interactive_browser/delete_scrape_browser→stop_interaction. - All option structs derive
Default; use struct-update syntax:ScrapeOptions { formats: Some(vec![...]), ..Default::default() }. - The
optionsparameter onscrapeandsearchacceptsimpl Into<Option<T>>, so you can passNoneor a bare struct. - All methods are
asyncand require a Tokio runtime. search_and_scrape(query, limit)is a convenience helper that returnsVec<Document>.- All serialization uses camelCase for the API wire format.
Source Of Truth
firecrawl/apps/rust-sdk/Cargo.tomlfirecrawl/apps/rust-sdk/src/lib.rsfirecrawl/apps/rust-sdk/src/client.rsfirecrawl/apps/rust-sdk/src/scrape.rsfirecrawl/apps/rust-sdk/src/search.rsfirecrawl-docs/api-reference/v2-openapi.json

