Firecrawl Elixir Agent Quickstart
This is the canonical quickstart for external agents integrating with Firecrawl using the official Elixir SDK. Generated from SDK source and OpenAPI spec.Install
Add to yourmix.exs dependencies:
Authenticate
The Elixir SDK does not use a client struct. Authentication is resolved per-call in this order::api_keyoption passed in the trailingoptskeyword list of any function call.- Application config:
Application.get_env(:firecrawl, :api_key). - If nil or empty, the key is omitted (keyless free tier for scrape, search, and interact).
https://api.firecrawl.dev/v2 but can be overridden per-call with :base_url in opts.
When To Use What
search_and_scrape— Use when you start with a query and need to discover relevant pages. Returns search results grouped by source type, optionally with scraped content.scrape_and_extract_from_url— Use when you already have a URL and want its content. Returns markdown, HTML, structured data, screenshots, or other formats.interact_with_scrape_browser_session— Use when the page needs post-scrape browser actions like clicking, filling forms, or executing code in the browser sandbox.
Search
Why use it
Search the web and optionally scrape each result in one call. Start here when you have a question or topic but not a specific URL.Preferred SDK function
Firecrawl.search_and_scrape!(params, opts) raises on error.
Example
Parameters
All parameters are passed as a keyword list. All are optional exceptquery.
Scrape
Why use it
Fetch and extract content from a single URL. Use when you have a specific page to read.Preferred SDK function
Firecrawl.scrape_and_extract_from_url!(params, opts) raises on error.
Example
Parameters
All parameters are passed as a keyword list. All are optional excepturl.
Interact
Why use it
Execute code in the browser sandbox associated with a scrape job. Use after a scrape to click buttons, fill forms, navigate, or extract additional data.Preferred SDK function
Firecrawl.interact_with_scrape_browser_session!(job_id, params, opts) raises on error.
Example
Parameters
Related function
Notes
- Naming style: Parameters use snake_case in Elixir and are serialized to camelCase JSON keys internally.
- OpenAPI-shaped client: The Elixir SDK is generated from the OpenAPI spec, so function names directly mirror operation IDs (
search_and_scrape,scrape_and_extract_from_url,interact_with_scrape_browser_session). - Return type: All functions return
{:ok, %Req.Response{}} | {:error, Exception.t() | Firecrawl.Error.t()}. Bang variants raise on error. - No prompt parameter: Unlike the JS, Python, and Rust SDKs, the Elixir SDK’s interact function does not support a
promptparameter. Usecodeonly. - Per-call auth: Every function accepts
:api_keyand:base_urlin the trailingoptskeyword list, allowing different credentials per call.
Source Of Truth
firecrawl/apps/elixir-sdk/lib/firecrawl.exfirecrawl/apps/elixir-sdk/mix.exsfirecrawl-docs/api-reference/v2-openapi.json

