Firecrawl Elixir Agent Quickstart
Canonical quickstart for external agents integrating with Firecrawl using the Elixir SDK. Generated from SDK source and OpenAPI spec.Install
Add to yourmix.exs dependencies:
Authenticate
Configure the API key in your application config:opts keyword list:
When To Use What
search_and_scrape: You start with a query and need to discover relevant URLs and their content. Use when you don’t have a specific URL yet.scrape_and_extract_from_url: You already have a URL and want its page content as markdown, HTML, or structured JSON. Use for targeted extraction.interact_with_scrape_browser_session: The page needs clicks, form fills, or other browser actions after an initial scrape. Use for multi-step browser automation.
Search
Why use it
Search the web for a query and optionally scrape the results. Returns structured results grouped by source type (web, news, images). Use this when you need to discover relevant pages before extracting content.Preferred SDK method
search_and_scrape!/2 raises on error instead of returning {:error, ...}.
Example
Parameters
All parameters are passed as a keyword list. Required parameters are marked.Scrape
Why use it
Scrape a single URL and get its content as markdown, HTML, screenshots, structured JSON, or other formats. The primary tool for extracting page content when you already know the URL.Preferred SDK method
scrape_and_extract_from_url!/2 raises on error.
Example
Parameters
Interact
Why use it
Execute code in the browser session created by a prior scrape. Use this for multi-step workflows: scrape a page first to get a job ID, then interact with the live browser to click buttons, fill forms, or run JavaScript.Preferred SDK method
interact_with_scrape_browser_session!/3 raises on error.
Example
Parameters
The response body includes:
Call
Firecrawl.stop_interactive_scrape_browser_session(job_id) to end the session.
Notes
- The Elixir SDK is auto-generated from the OpenAPI spec via
mix run generate.exs. Function names match the OpenAPI operation IDs converted to snake_case. - Function names are longer than other SDKs because they follow the OpenAPI operation IDs:
scrape_and_extract_from_url(notscrape),search_and_scrape(notsearch),interact_with_scrape_browser_session(notinteract). - All parameters use snake_case in Elixir. The SDK converts to camelCase for the API wire format.
- Enum values are passed as atoms:
proxy: :auto,language: :node. - All functions return
{:ok, %Req.Response{}}or{:error, exception}. Use bang variants (!) to raise instead. - HTTP 4xx/5xx responses are wrapped in
Firecrawl.Errorwithstatusandbodyfields. - Parameters are validated at runtime via NimbleOptions. Invalid params return
{:error, %NimbleOptions.ValidationError{}}. - The Elixir SDK’s
interact_with_scrape_browser_sessiondoes not support apromptparameter (unlike Node.js, Python, and Rust). Usecodewith the appropriate language. - There are no deprecated aliases in the Elixir SDK.
Source Of Truth
- SDK:
firecrawl/apps/elixir-sdk/lib/firecrawl.ex - OpenAPI:
firecrawl-docs/api-reference/v2-openapi.json

