Firecrawl Elixir Agent Quickstart
This is the canonical quickstart for external agents using the Firecrawl Elixir SDK. It coverssearch, scrape, and interact — the three endpoints agents need most. Generated from SDK source (:firecrawl hex package v1.x) and the Firecrawl OpenAPI spec.
The Elixir SDK is auto-generated from the OpenAPI spec. Function names map directly to the API operations. Every function has a bang (!) variant that raises on error instead of returning {:error, ...} tuples.
Install
Add:firecrawl to your dependencies in mix.exs:
config/config.exs:
Authenticate
The API key is read from application config by default. You can also pass it per-request:base_url:
When To Use What
search_and_scrape— Start here when you have a query and need to discover relevant URLs and content from the web.scrape_and_extract_from_url— Use when you already have a specific URL and want its page content as markdown, HTML, structured JSON, or other formats.interact_with_scrape_browser_session— Use after a scrape when the page needs further browser actions: running code in the live browser session.
Search
Why use it
Search the web with a natural-language query and get back structured results with URLs, titles, descriptions, and optionally full scraped content for each result.Preferred SDK method
Example
Parameters
Parameters are passed as a keyword list. All use snake_case.
Return type:
{:ok, %Req.Response{}} with body containing "data" map with "web", "news", "images", "tools" keys.
Scrape
Why use it
Fetch a single URL and get back clean markdown, HTML, structured JSON, screenshots, or other formats.Preferred SDK method
Example
Parameters
Parameters are passed as a keyword list. All use snake_case.Interact
Why use it
Continue interacting with the same browser state from a previous scrape. Execute code in the live browser session — useful for clicking buttons, filling forms, navigating SPAs, or extracting data that requires interaction.Preferred SDK method
Example
Parameters
Stop method:
Firecrawl.stop_interactive_scrape_browser_session(job_id) — call this to end the browser session when done.
Notes
- The Elixir SDK is auto-generated from the OpenAPI spec. Function names are verbose and map directly to API operations.
- All parameters use snake_case (e.g.
only_main_content,include_tags,scrape_options). - Parameters are validated at runtime with NimbleOptions — you get clear errors for typos and invalid options before any request is made.
- Every function returns
{:ok, %Req.Response{}}or{:error, exception}. Use bang variants (!) to raise on error. - The
interact_with_scrape_browser_sessionfunction takescodeas a required parameter. Unlike JS/Python/Rust, there is no separatepromptparameter in the generated SDK — to use the AI browser agent with a natural-language prompt, use the API directly or passpromptvia a raw map. - Any
Reqoptions not consumed by:api_keyor:base_urlare passed through to the underlying HTTP request. - An
originfield ("elixir-sdk@{version}") is injected into every request body for SDK telemetry.
Source Of Truth
firecrawl/apps/elixir-sdk/mix.exsfirecrawl/apps/elixir-sdk/lib/firecrawl.exfirecrawl/apps/elixir-sdk/lib/firecrawl/error.exfirecrawl-docs/api-reference/v2-openapi.json

