Skip to main content
Canonical Firecrawl Rust quickstart for agents. Generated from SDK source (firecrawl crate v2.18.0) and the v2 OpenAPI spec.

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.

Why use it

Discover relevant pages from a query, then pick URLs to scrape or interact with. Constrain results to a site with site: in the query string.

Preferred SDK method

client.search(query, options)Result<SearchResponse, FirecrawlError>

Example

A convenience helper client.search_and_scrape(query, limit) returns Vec<Document> directly.

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 scrape job. Use for clicks, form fills, code execution, or natural-language browser instructions. Requires a scrape job ID from a prior scrape.

Preferred SDK method

client.interact(job_id, options)Result<ScrapeExecuteResponse, FirecrawlError> At least one of code or prompt must be provided, or the SDK returns FirecrawlError::Misuse.

Example

Parameters

client.stop_interaction(job_id) ends the browser session. Returns ScrapeBrowserDeleteResponse with success, optional session_duration_ms, credits_billed, error.

Notes

  • Deprecated aliases: scrape_executeinteract; stop_interactive_browser and delete_scrape_browserstop_interaction.
  • ScrapeOptions uses dedicated sub-structs (json_options, screenshot_options, change_tracking_options) for advanced format configuration.
  • search_and_scrape(query, limit) is a convenience helper returning Vec<Document> from web results.
  • All types export at the crate root: use firecrawl::Client (not use firecrawl::v2::Client).
  • Rust fields are snake_case but serialize to camelCase on the wire via serde.

Source Of Truth

  • firecrawl/apps/rust-sdk/Cargo.toml
  • firecrawl/apps/rust-sdk/src/client.rs
  • firecrawl/apps/rust-sdk/src/scrape.rs
  • firecrawl/apps/rust-sdk/src/search.rs
  • firecrawl-docs/api-reference/v2-openapi.json