Firecrawl Rust Agent Quickstart
Canonical quickstart for external agents integrating with Firecrawl via the Rust SDK. Generated from SDK source and the OpenAPI spec.Install
Add to yourCargo.toml:
Authenticate
None::<&str> as the API key for keyless free tier (rate-limited per IP).
When To Use What
search: Start with a query and discover relevant pages. Returns URLs, titles, descriptions, and optionally scraped content.scrape: You already have a URL and want structured page content — markdown, HTML, screenshots, JSON extraction, etc.interact: The page needs post-scrape browser actions — clicking, typing, executing code, or natural-language browser instructions.
Search
Why use it
Discover web pages matching a query. Optionally scrape each result for full content in one call.Preferred SDK method
client.search(query, options).await
Example
Parameters
SearchOptions fields (all Option, default None):
There is also a convenience method
client.search_and_scrape(query, limit).await that returns Vec<Document> directly.
Scrape
Why use it
Extract structured content from a single URL — markdown, HTML, screenshots, JSON extraction, audio, video, and more.Preferred SDK method
client.scrape(url, options).await
Example
Parameters
ScrapeOptions fields (all Option, default None):
There is also
client.scrape_with_schema(url, schema, prompt).await for JSON extraction convenience.
Interact
Why use it
Continue interacting with a live browser session after scraping. Execute code or send natural-language prompts to control the page — click buttons, fill forms, navigate, and extract dynamic content.Preferred SDK method
client.interact(job_id, options).await
Example
Parameters
ScrapeExecuteOptions fields:
Call
client.stop_interaction(job_id).await to end the browser session when done.
Notes
- Struct literal construction: All options use
..Default::default()for unset fields. No builder pattern. impl Into<Option<T>>pattern:scrape()andsearch()acceptNonedirectly or a bare options struct — no need to wrap inSome(...).impl AsRef<str>parameters:url,query, andjob_idaccept&str,String, or anyAsRef<str>type.- serde camelCase: All fields serialize to camelCase JSON.
redact_piihas a manual rename to"redactPII". - Format enum variants with data:
Question(QuestionFormat),Highlights(HighlightsFormat), andQuery(QueryFormat)carry payloads and serialize as JSON objects with a"type"discriminator. - All methods are async and require a tokio runtime.
- Deprecated aliases:
scrape_execute->interact,stop_interactive_browser/delete_scrape_browser->stop_interaction.
Source Of Truth
- SDK source:
firecrawl/apps/rust-sdk/src/v2/client.rs,firecrawl/apps/rust-sdk/src/v2/scrape.rs,firecrawl/apps/rust-sdk/src/v2/search.rs - OpenAPI spec:
firecrawl-docs/api-reference/v2-openapi.json

