Firecrawl Elixir Agent Quickstart
This file is the canonical quickstart for external agents integrating Firecrawl via the Elixir SDK. It is generated from SDK source (apps/elixir-sdk) plus the OpenAPI spec (api-reference/v2-openapi.json).
The Elixir SDK is auto-generated from the OpenAPI spec. Function names are verbose and OpenAPI-shaped — use them exactly as shown.
Install
Addfirecrawl to your mix.exs:
Authenticate
Configure your API key inconfig/config.exs:
opts keyword list supporting:
When To Use What
search_and_scrape— Use when you start with a query and need to discover relevant pages.scrape_and_extract_from_url— Use when you already have a URL and want page content.interact_with_scrape_browser_session— Use when the page needs code execution in a post-scrape browser session.
Search
Why use it
Search the web with a query and get structured results. Each result can optionally include full scraped page content.Preferred SDK function
Example
Parameters
Pass as a keyword list. All parameters usesnake_case keys; the SDK converts to camelCase for the API.
Response
Returns{:ok, %Req.Response{}} or {:error, exception}. Access data via result.body["data"].
Scrape
Why use it
Fetch a single URL and get back clean content in your chosen formats: markdown, HTML, screenshots, structured JSON extraction, and more.Preferred SDK function
Example
Parameters
Interact
Why use it
After scraping a page, useinteract_with_scrape_browser_session to execute code in the live browser session: run Playwright scripts in Node.js, Python, or Bash.
Preferred SDK function
Example
Parameters
Interact limitation: no prompt support
The Elixir SDK’s interact_with_scrape_browser_session requires code — it does not currently support the prompt parameter for natural-language browser interaction. For prompt-based interaction, use the REST API directly:
Notes
- Function names: The Elixir SDK is auto-generated from the OpenAPI spec. Function names are verbose (e.g.
scrape_and_extract_from_url,search_and_scrape,interact_with_scrape_browser_session). Use them exactly as documented. - Naming: Parameters use
snake_casekeys in keyword lists. The SDK converts to camelCase for the API. - Bang variants: Every function has a
!bang variant that raises on error instead of returning{:error, ...}. - Return type: Non-bang functions return
{:ok, %Req.Response{}}or{:error, exception}. Access response data viaresult.body["data"]. - Interact
prompt: Not supported in the SDK. Use rawReq.postto the REST API for prompt-based interaction.
Source Of Truth
firecrawl/apps/elixir-sdk/mix.exsfirecrawl/apps/elixir-sdk/lib/firecrawl.exfirecrawl-docs/api-reference/v2-openapi.json

