Skip to main content

Firecrawl Rust Agent Quickstart

Canonical quickstart for external agents integrating Firecrawl with Rust. Generated from SDK source and OpenAPI spec.

Install

Authenticate

For self-hosted instances:
Set FIRECRAWL_API_KEY environment variable for keyless initialization (handled at the application level — the SDK accepts an empty or None key for keyless free tier).

When To Use What

  • search: Start with a query, discover relevant URLs, and get their content in one call.
  • scrape: You already have a URL and want its page content as markdown, HTML, JSON, or other formats.
  • interact: The page needs clicks, form fills, or post-scrape browser actions on a live session.

Why use it

Search the web for a query and get scraped content from the top results. Combines discovery and content extraction in one call.

Preferred SDK method

client.search(query, options)

Example

Parameters

All fields on SearchOptions are Option<T> and default to None. There is also a convenience method client.search_and_scrape(query, limit) that returns Vec<Document> directly.

Scrape

Why use it

Get the content of a single URL as markdown, HTML, JSON, screenshots, or other formats.

Preferred SDK method

client.scrape(url, options)

Example

Parameters

All fields on ScrapeOptions are Option<T> and default to None. There is also a convenience method client.scrape_with_schema(url, schema, prompt) for JSON extraction.

Interact

Why use it

Control a live browser session tied to a scrape job. Click buttons, fill forms, navigate, and extract dynamic content using code or natural-language prompts.

Preferred SDK method

client.interact(job_id, options)

Example

Parameters

All fields on ScrapeExecuteOptions are Option<T> and default to None. Stop the session when done:

Notes

  • All option structs use snake_case fields and derive Default — use struct literal syntax with ..Default::default().
  • The options parameter on scrape and search accepts impl Into<Option<T>>, so you can pass None directly to skip options.
  • The origin field is automatically set to the SDK version string if not provided.
  • Deprecated aliases (do not use in new code):
    • scrape_execute() → use interact()
    • stop_interactive_browser() / delete_scrape_browser() → use stop_interaction()

Source Of Truth

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