Firecrawl Rust Agent Quickstart
This file is the canonical quickstart for external agents integrating with Firecrawl using the Rust SDK. It is generated from SDK source and OpenAPI spec.Install
Authenticate
None for the API key uses the keyless free tier (rate-limited per IP).
When To Use What
search: Use when you start with a query and need to discover relevant pages. Returns ranked results with optional scraping of each result.scrape: Use when you already have a URL and want its content in markdown, HTML, JSON, or other formats.interact: Use when a page needs post-scrape browser actions — clicking, filling forms, running code, or prompting an AI agent in the browser.
Search
Why use it
Search the web for a query and get back ranked results. Optionally scrape each result page inline by settingscrape_options.
Preferred SDK method
Example
Parameters
All fields onSearchOptions are Option and default to None.
Returns:
SearchResponse containing SearchData with optional .web, .news, and .images vectors.
A convenience method search_and_scrape(query, limit) returns Vec<Document> directly.
Scrape
Why use it
Scrape a single URL and get its content as markdown, HTML, structured JSON, screenshots, or other formats.Preferred SDK method
Example
Parameters
All fields onScrapeOptions are Option and default to None.
Returns:
Document with optional fields like markdown, html, raw_html, links, images, screenshot, metadata, etc.
A convenience method scrape_with_schema(url, schema, prompt) extracts structured JSON using a JSON Schema.
Interact
Why use it
Execute code or send a natural-language prompt in the browser session of a previous scrape job. Use this for clicking buttons, filling forms, navigating multi-step flows, or running arbitrary JavaScript/Python/Bash in the browser sandbox.Preferred SDK method
Example
Parameters
Returns:
ScrapeExecuteResponse with success, stdout, stderr, result, exit_code, killed, error, and optional live_view_url / interactive_live_view_url.
Stop the session:
Notes
- Struct fields use snake_case (e.g.
only_main_content,skip_tls_verification). They serialize to camelCase JSON automatically. - All option structs derive
Default, so use..Default::default()to fill unset fields. - Methods accept
impl Into<Option<ScrapeOptions>>andimpl Into<Option<SearchOptions>>, so you can passNone, a bare struct, orSome(struct). - The
interactmethod requiresScrapeExecuteOptionsdirectly (not wrapped inOption) since at leastcodeorpromptmust be set. - Deprecated aliases (use the preferred names instead):
scrape_execute()→interact()stop_interactive_browser()/delete_scrape_browser()→stop_interaction()
Source Of Truth
firecrawl/apps/rust-sdk/src/v2/client.rsfirecrawl/apps/rust-sdk/src/v2/search.rsfirecrawl/apps/rust-sdk/src/v2/scrape.rsfirecrawl-docs/api-reference/v2-openapi.json

