Firecrawl Elixir Agent Quickstart
Canonical quickstart for external agents integrating with Firecrawl via the Elixir SDK. Generated from SDK source and OpenAPI spec.Install
Add to yourmix.exs dependencies:
Authenticate
Set the API key globally in your application config:
Additional keys are passed through to the underlying
Req HTTP client.
When To Use What
search_and_scrape: Start with a query and need to discover URLs and content. Returns search results from web, news, and image sources.scrape_and_extract_from_url: Already have a URL and want page content as markdown, HTML, screenshots, or structured JSON.interact_with_scrape_browser_session: The page needs clicks, form fills, or post-scrape browser actions. Runs code in a browser session tied to a prior scrape.
Search
Why use it
Search the web for a query and optionally scrape each result page. Returns results grouped by source type.Preferred SDK function
Firecrawl.search_and_scrape!(params, opts) — raises on error.
Example
Parameters
First argument is a keyword list.query is required; all others are optional.
Scrape
Why use it
Fetch and convert a single URL to markdown, HTML, screenshots, structured JSON, or other formats. Supports browser actions, mobile emulation, caching, and PDF parsing.Preferred SDK function
Firecrawl.scrape_and_extract_from_url!(params, opts) — raises on error.
Example
Parameters
First argument is a keyword list.url is required; all others are optional.
Interact
Why use it
Control a live browser session tied to a prior scrape. Execute code to click buttons, fill forms, navigate, and extract dynamic content.Preferred SDK function
interact_with_scrape_browser_session!, stop_interactive_scrape_browser_session!.
Example
Parameters
First argument is thejob_id (string). Second is a keyword list of body parameters.
Notes
- The Elixir SDK is auto-generated from the OpenAPI spec (
generate.exs). Function names directly reflect OpenAPI operation IDs. - Parameter keys use snake_case atoms (e.g.
:only_main_content,:include_tags). The SDK converts them to camelCase JSON keys automatically. - The Elixir SDK does not support
prompt-based interaction — onlycodeexecution. To use natural-language prompts, use the Node.js or Python SDK. - The proxy parameter accepts atoms (
:basic,:enhanced,:auto) rather than strings. The:stealthproxy mode is not validated by the Elixir SDK. - All functions return
{:ok, Req.Response.t()}or{:error, exception}. Bang variants (!suffix) return the response directly and raise on error. - No deprecated aliases exist in the Elixir SDK.
Source Of Truth
firecrawl/apps/elixir-sdk/lib/firecrawl.exfirecrawl/apps/elixir-sdk/mix.exsfirecrawl-docs/api-reference/v2-openapi.json

