Skip to main content

Firecrawl Rust Agent Quickstart

This file is the canonical quickstart for external agents integrating with Firecrawl via the Rust SDK. It is generated from SDK source and the OpenAPI spec.

Install

Add to your Cargo.toml:

Authenticate

When To Use What

  • search: Use when you start with a query and need to discover relevant pages across the web.
  • scrape: Use when you already have a URL and want to extract page content (markdown, HTML, structured data, etc.).
  • interact: Use when the page needs clicks, form fills, or post-scrape browser actions via code or natural language.

Why use it

Search finds relevant web pages for a query. Optionally scrapes each result in the same call via scrape_options.

Preferred SDK method

Example

Parameters

All fields on SearchOptions are Option, defaulting to None. Returns: SearchResponse { success, data: SearchData, warning } where SearchData has web, news, images fields. Convenience: client.search_and_scrape(query, limit).await searches and returns only scraped Document results.

Scrape

Why use it

Scrape extracts content from a single URL in any format: markdown, HTML, structured JSON, screenshots, and more.

Preferred SDK method

Example

Parameters

All fields on ScrapeOptions are Option, defaulting to None. Returns: Document with markdown, html, raw_html, json, summary, metadata, links, images, screenshot, audio, video, actions, warning, change_tracking, branding, product, menu, pages, blocks. Convenience: client.scrape_with_schema(url, schema, prompt).await scrapes with JSON extraction and returns the extracted value.

Interact

Why use it

Interact lets you execute code or natural-language instructions in a browser session that was started by a scrape. Use it for post-scrape actions like clicking buttons, filling forms, or extracting dynamic content.

Preferred SDK method

Example

Parameters

Returns: ScrapeExecuteResponse with success, output, stdout, result, stderr, exit_code, killed, error, live_view_url, interactive_live_view_url. Related: client.stop_interaction(job_id).await ends the browser session and returns session_duration_ms and credits_billed.

Notes

  • All struct fields use snake_case (e.g. only_main_content, skip_tls_verification). The SDK handles serde serialization to camelCase for the API.
  • All option structs derive Default, so use ..Default::default() for omitted fields.
  • Deprecated aliases (use the preferred names instead):
    • scrape_execute()interact()
    • stop_interactive_browser()stop_interaction()
    • delete_scrape_browser()stop_interaction()
  • The SDK is fully async (requires tokio runtime).
  • origin is auto-injected as "rust-sdk@{version}" on every request.

Source Of Truth

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