Skip to main content

Firecrawl Rust Agent Quickstart

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

Install

Add to your Cargo.toml:

Authenticate

Or set the FIRECRAWL_API_KEY environment variable and use:

When To Use What

  • search — Use when you start with a query and need to discover relevant pages. Returns web results, news, images, and optionally scraped page content.
  • scrape — Use when you already have a URL and want structured page content (markdown, HTML, JSON extraction, screenshots, etc.).
  • interact — Use when a page needs browser automation after scraping — clicks, form fills, or post-scrape dynamic content extraction.

Why use it

Search the web for a query and get results with titles, URLs, descriptions, and optionally full page content. Supports filtering by domain, time range, category, and source type.

Preferred SDK method

Example

Parameters

SearchOptions fields (all Option, default None unless noted):

Scrape

Why use it

Scrape a URL and get its content in your chosen format — markdown, HTML, JSON (with schema-based extraction), screenshots, and more. Supports browser actions, caching, proxies, and PDF parsing.

Preferred SDK method

Example

Parameters

ScrapeOptions fields (all Option, default None unless noted):

Interact

Why use it

After scraping a page, interact with it in a live browser session — execute code or natural-language prompts to click buttons, fill forms, navigate, and extract dynamic content.

Preferred SDK method

Example

Parameters

ScrapeExecuteOptions fields (all Option except where noted):

Stopping an interaction

Call client.stop_interaction(job_id).await? to close the browser session and stop billing.

Notes

  • Deprecated aliases: scrape_execute → interact, stop_interactive_browser / delete_scrape_browser → stop_interaction. Always use the preferred names.
  • Naming style: All fields use snake_case (Rust convention). Serialized to camelCase for the API via serde.
  • Crate name: firecrawl (crates.io).
  • Async runtime: All methods are async and require a Tokio runtime.
  • Convenience method: client.search_and_scrape(query, limit) performs a search with scrape options and returns Vec<Document> directly.
  • JSON extraction: Use client.scrape_with_schema(url, schema, prompt) for schema-based extraction.
  • Base URL: Defaults to https://api.firecrawl.dev. Override with Client::new_with_url(api_key, url).

Source Of Truth

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