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 and OpenAPI spec.Install
Add tomix.exs:
Authenticate
Set the API key globally in your config:opts) that supports :api_key and :base_url (for self-hosted instances, default "https://api.firecrawl.dev/v2").
When To Use What
search_and_scrape: Use when you start with a query and need to discover relevant URLs and their content.scrape_and_extract_from_url: Use when you already have a specific URL and want its page content in markdown, HTML, JSON, or other formats.interact_with_scrape_browser_session: Use when the page needs post-scrape browser actions like clicking, typing, scrolling, or executing code in a live browser session.
Search
Why use it
Search the web for a query and optionally scrape the results. Returns categorized results from web, news, and image sources with optional content extraction.Preferred SDK method
Firecrawl.search_and_scrape!(params, opts) raises on error.
Example
Parameters
All parameters are passed as a keyword list. Onlyquery is required.
Scrape
Why use it
Scrape a single URL and get its content in one or more formats. Supports browser automation, LLM extraction, screenshots, and more.Preferred SDK method
Firecrawl.scrape_and_extract_from_url!(params, opts) raises on error.
Example
Parameters
All parameters are passed as a keyword list. Onlyurl is required.
Interact
Why use it
Execute code in a live browser session tied to a scrape job. Use for post-scrape interactions like clicking buttons, filling forms, or running scripts.Preferred SDK method
Firecrawl.interact_with_scrape_browser_session!(job_id, params, opts) raises on error.
Example
Parameters
The first argument is thejob_id (string). Remaining parameters are passed as a keyword list.
Use
Firecrawl.stop_interactive_scrape_browser_session(job_id) to end the browser session.
Notes
- Naming style: Parameters use snake_case atom keys. The SDK converts them to camelCase JSON keys automatically.
- OpenAPI-generated: The Elixir SDK is auto-generated from the OpenAPI spec. Function names match the OpenAPI operation IDs directly (e.g.
scrape_and_extract_from_url, notscrape). - Return type: All functions return
{:ok, %Req.Response{}}or{:error, exception}. The bang variants (!) raise on error and returnReq.Response.t()directly. HTTP 4xx/5xx responses raiseFirecrawl.Errorwith:statusand:bodyfields. - No
promptsupport: Unlike JS/Python/Rust, the Elixir SDKinteract_with_scrape_browser_sessiononly acceptscode, not a natural-languageprompt. - Origin auto-injection: The SDK automatically injects
"origin": "elixir-sdk@{version}"into every request body.
Source Of Truth
/firecrawl/apps/elixir-sdk/lib/firecrawl.ex/firecrawl/apps/elixir-sdk/mix.exs/firecrawl-docs/api-reference/v2-openapi.json

