Canonical Firecrawl Rust source of truth for agents. Generated from SDK source and the v2 OpenAPI spec.Documentation Index
Fetch the complete documentation index at: https://docs.firecrawl.dev/llms.txt
Use this file to discover all available pages before exploring further.
Install
firecrawl on crates.io. The current SDK version is 2.0.0 (verify the latest release on crates.io before pinning).
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.
Search
Why use it
Use search to discover relevant pages from a query, then pick URLs to scrape or interact with. You can constrain results to a site withsite:, for example site:docs.firecrawl.dev crawl webhooks.
Preferred SDK method
client.search(query, options) → Result<SearchResponse, FirecrawlError>
Simple Example
Complex Example
Return type
client.search(...) returns Result<SearchResponse, FirecrawlError>.
SearchResponsesuccess: booldata: SearchDatawarning: Option<String>
SearchDataweb: Option<Vec<SearchResultOrDocument>>— each item is eitherSearchResultOrDocument::WebResult(SearchResultWeb)(url, title, description, …) orSearchResultOrDocument::Document(Document)when the API returned scraped content for that row (detected when markdown, html, rawHtml, or metadata is present).news: Option<Vec<SearchResultNews>>images: Option<Vec<SearchResultImage>>
Parameters
-
query- Type:
impl AsRef<str> - Use when: you need a search query.
- Notes: use
site:example.comto limit results to a domain.
- Type:
-
options.sources- Type:
Vec<SearchSource> - Use when: you want to control which sources are searched.
- Confirmed values:
Web,News,Images
- Type:
-
options.categories- Type:
Vec<SearchCategory> - Use when: you want to filter results by category.
- Confirmed values:
Github,Research,Pdf
- Type:
-
options.limit- Type: u32
- Use when: you want to cap results.
-
options.tbs- Type: String
- Use when: you need a time-based filter (for example
qdr:d,qdr:w,sbd:1,qdr:m).
-
options.location- Type: String
- Use when: you want localized results.
-
options.ignore_invalid_urls- Type: bool
- Use when: you want to drop URLs that cannot be scraped by other endpoints.
-
options.timeout- Type: u32
- Use when: you need a request timeout in milliseconds.
-
options.scrape_options- Type:
ScrapeOptions - Use when: you want to scrape each search result (see Scrape parameters for fields).
- Type:
-
options.integration- Type:
Option<String> - Use when: you need an integration identifier for server-side tracking.
- Notes: omit in agent-oriented examples unless your product intentionally sets it.
- Type:
Scrape
Why use it
Use scrape when you already have a URL and want structured content in one or more formats.Preferred SDK method
client.scrape(url, options) → Result<Document, FirecrawlError> (the HTTP response data field is unwrapped in the SDK).
Simple Example
Complex Example
Parameters
-
url- Type:
impl AsRef<str> - Use when: you want to scrape a specific page.
- Type:
-
options.formats- Type:
Vec<Format> - Use when: you want multiple output formats.
- Confirmed values:
Markdown,Html,RawHtml,Links,Images,Screenshot,Summary,ChangeTracking,Json,Attributes,Branding,Audio
- Type:
-
options.headers- Type:
HashMap<String, String> - Use when: you need custom request headers.
- Type:
-
options.include_tags- Type:
Vec<String> - Use when: you want to include only specific HTML tags.
- Type:
-
options.exclude_tags- Type:
Vec<String> - Use when: you want to exclude specific HTML tags.
- Type:
-
options.only_main_content- Type: bool
- Use when: you want to strip nav, footer, and other boilerplate.
-
options.timeout- Type: u32
- Use when: you need a timeout in milliseconds.
-
options.wait_for- Type: u32
- Use when: you need to wait for the page to render (milliseconds).
-
options.mobile- Type: bool
- Use when: you want a mobile viewport.
-
options.parsers- Type:
Vec<ParserConfig> - Use when: you need file parsing controls.
- Confirmed values:
ParserConfig::Simple("pdf".to_string())ParserConfig::Pdf { parser_type: "pdf", max_pages: Some(n) }
- Type:
-
options.actions- Type:
Vec<Action> - Use when: you need lightweight pre-scrape actions.
- Confirmed action types:
Wait:millisecondsorselectorrequiredScreenshot:full_page,quality,viewportoptionalClick:selectorrequiredWrite:textrequired (click to focus the input first)Press:keyrequiredScroll:direction(UporDown) required,selectoroptionalScrape: no additional fieldsExecuteJavascript:scriptrequiredPdf:format(A0, A1, A2, A3, A4, A5, A6, Letter, Legal, Tabloid, Ledger),landscape,scaleoptional
- Type:
-
options.location- Type:
LocationConfig - Use when: you need geo or language-aware scraping.
- Confirmed fields:
country,languages
- Type:
-
options.skip_tls_verification- Type: bool
- Use when: you need to skip TLS verification.
-
options.remove_base64_images- Type: bool
- Use when: you want to drop base64 images from markdown output.
-
options.fast_mode- Type: bool
- Use when: you want faster scrapes with reduced fidelity.
-
options.block_ads- Type: bool
- Use when: you want ad and cookie popup blocking.
-
options.proxy- Type:
ProxyType - Use when: you need proxy control.
- Confirmed values:
Basic,Stealth,Enhanced,Auto
- Type:
-
options.max_age- Type: u32
- Use when: you want cached data up to a maximum age (milliseconds).
-
options.min_age- Type: u32
- Use when: you want cached data only if it is at least this old (milliseconds).
-
options.store_in_cache- Type: bool
- Use when: you want Firecrawl to cache the result.
-
options.profile- Type:
ProfileConfig - Use when: you want a persistent browser profile shared across scrapes and interactions.
- Confirmed fields:
name,save_changes
- Type:
-
options.integration- Type:
Option<String> - Use when: you need an integration identifier for server-side tracking.
- Notes: omit in agent-oriented examples unless your product intentionally sets it.
- Type:
-
options.json_options- Type:
JsonOptions - Use when: you want to configure JSON extraction.
- Confirmed fields:
schema,system_prompt,prompt
- Type:
-
options.screenshot_options- Type:
ScreenshotOptions - Use when: you want to configure screenshot output.
- Confirmed fields:
full_page,quality,viewport
- Type:
-
options.change_tracking_options- Type:
ChangeTrackingOptions - Use when: you want to configure change tracking output.
- Confirmed fields:
modes(GitDifforJson),schema,prompt,tag
- Type:
-
options.attribute_selectors- Type:
Vec<AttributeSelector> - Use when: you want attribute extraction output.
- Confirmed fields:
selector,attribute
- Type:
Interact
Why use it
Use interact when a page requires browser actions or code execution after a scrape starts.Preferred SDK method
client.interact(job_id, options)
To end the browser session, use client.stop_interaction(job_id) (HTTP DELETE on /v2/scrape/{jobId}/interact).
Simple Example
Complex Example
Stop session
Parameters
-
job_id- Type:
impl AsRef<str> - Use when: you have a scrape job ID.
- Type:
-
options.code- Type:
Option<String> - Use when: you want to run code in the browser session.
- Type:
-
options.prompt- Type:
Option<String> - Use when: you want the browser agent to follow a natural-language instruction.
- Type:
-
options.language- Type:
ScrapeExecuteLanguage - Use when: you need a specific runtime.
- Confirmed values:
Python,Node,Bash - Notes: defaults to
Nodein the SDK if omitted.
- Type:
-
options.timeout- Type: u32
- Use when: you need an execution timeout in seconds.
-
options.origin- Type:
Option<String> - Use when: you need an optional origin label for execution telemetry.
- Notes: omit in agent-oriented examples unless your product intentionally sets it.
- Type:
options.code or options.prompt must be non-empty; otherwise the SDK returns FirecrawlError::Misuse before calling the API.
Response types
interact→Result<ScrapeExecuteResponse, FirecrawlError>success: boolis always present;live_view_url,interactive_live_view_url,output,stdout,result,stderr,exit_code,killed, anderrorareOptionfields on the struct.
stop_interaction→Result<ScrapeBrowserDeleteResponse, FirecrawlError>success: boolis always present;session_duration_ms,credits_billed, anderrorare optional.
code as required; the Rust SDK matches server behavior by accepting either code or prompt (see ScrapeExecuteOptions in scrape.rs).
Notes
- Deprecated aliases:
scrape_execute,stop_interactive_browser, anddelete_scrape_browsermap tointeractandstop_interaction. ScrapeOptionsincludes dedicatedjson_options,screenshot_options, andchange_tracking_optionsfor advanced formats.search_and_scrape(query, limit)is a convenience helper: it callssearchwith defaultScrapeOptionsand returnsVec<Document>built fromSearchResultOrDocument::Documententries indata.web(seesearch.rs).- v2 SDK exports all types at the crate root:
use firecrawl::Client(notuse firecrawl::v2::Client). - Error types simplified in v2:
CrawlJobFailed(String, CrawlStatus)→JobFailed(String),Missuse→Misuse.
Source Of Truth
firecrawl/apps/rust-sdk/Cargo.tomlfirecrawl/apps/rust-sdk/src/lib.rsfirecrawl/apps/rust-sdk/src/client.rsfirecrawl/apps/rust-sdk/src/scrape.rsfirecrawl/apps/rust-sdk/src/search.rsfirecrawl/apps/rust-sdk/src/crawl.rsfirecrawl/apps/rust-sdk/src/map.rsfirecrawl/apps/rust-sdk/src/batch_scrape.rsfirecrawl/apps/rust-sdk/src/agent.rsfirecrawl/apps/rust-sdk/src/types.rsfirecrawl-docs/api-reference/v2-openapi.json

