Firecrawl Elixir Agent Quickstart
This file is the canonical quickstart for external agents integrating with Firecrawl using the Elixir SDK. It is generated from SDK source and OpenAPI spec.Install
Add to yourmix.exs dependencies:
Authenticate
Set the API key in application config:When To Use What
search_and_scrape: Use when you start with a query and need to discover relevant pages. Returns ranked results with optional scraping.scrape_and_extract_from_url: Use when you already have a URL and want its content in markdown, HTML, JSON, or other formats.interact_with_scrape_browser_session: Use when a page needs post-scrape browser actions — clicking, filling forms, running code in the browser sandbox.
Search
Why use it
Search the web for a query and get back ranked results. Optionally scrape each result page inline by passingscrape_options.
Preferred SDK method
search_and_scrape!/2 raises on error.
Example
Parameters
All parameters are passed as a keyword list. All are optional exceptquery.
Returns:
{:ok, Req.Response.t()} or {:error, Exception.t()}. The response body contains "data" with "web", "news", and "images" lists.
Scrape
Why use it
Scrape a single URL and get its content as markdown, HTML, structured JSON, screenshots, or other formats.Preferred SDK method
scrape_and_extract_from_url!/2 raises on error.
Example
Parameters
All parameters are passed as a keyword list. All are optional excepturl.
Returns:
{:ok, Req.Response.t()} or {:error, Exception.t()}. The response body contains "data" with "markdown", "html", "links", "metadata", etc.
Interact
Why use it
Execute code 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
interact_with_scrape_browser_session!/3 raises on error.
Example
Parameters
Returns:
{:ok, Req.Response.t()} with body containing "success", "stdout", "stderr", "result", "exitCode", "killed", "error".
Stop the session:
Notes
- All parameter names use snake_case (e.g.
only_main_content,skip_tls_verification). The SDK converts them to camelCase JSON keys internally. - Parameters are passed as keyword lists, not maps.
- The SDK is auto-generated from the OpenAPI spec. Function names match the OpenAPI operation IDs closely.
- The
interact_with_scrape_browser_sessionfunction only supportscode, notprompt(natural-language browser instruction). Usecodeto execute scripts directly. - Proxy values are atoms (
:basic,:enhanced,:auto), not strings. - Every function has a bang variant (
!) that raises instead of returning{:error, ...}. - There are no deprecated aliases in the Elixir SDK.
Source Of Truth
firecrawl/apps/elixir-sdk/lib/firecrawl.exfirecrawl/apps/elixir-sdk/mix.exsfirecrawl-docs/api-reference/v2-openapi.json

