Firecrawl Elixir Agent Quickstart
This file is the canonical quickstart for external agents integrating with Firecrawl using Elixir. It is generated from SDK source (:firecrawl v1.11.0) and the Firecrawl OpenAPI spec.
Install
req ~> 0.5 and nimble_options ~> 1.1 (pulled as transitive deps).
Authenticate
opts keyword list.
When To Use What
search_and_scrape: Use when you start with a query and need to discover relevant pages. Returns search results across web, news, and images. Optionally scrapes each result page.scrape_and_extract_from_url: Use when you already have a URL and want page content (markdown, HTML, structured data, screenshots, etc.).interact_with_scrape_browser_session: Use when the page needs post-scrape browser actions — clicking buttons, filling forms, or executing code in the browser sandbox.
Search
Why use it
Search finds pages matching a query across the web, news, or images. Use it for discovery when you don’t have a specific URL.Preferred SDK method
Example
Parameters
All parameters are passed as a keyword list. Snake_case keys are auto-mapped to camelCase for the API.Scrape
Why use it
Scrape fetches and processes a single URL. Returns markdown, HTML, structured JSON, screenshots, and more. Use it when you have a specific page to extract content from.Preferred SDK method
Example
Parameters
All parameters are passed as a keyword list. Snake_case keys are auto-mapped to camelCase.Interact
Why use it
Interact lets you execute code in the browser sandbox tied to a scrape job. Use it for post-scrape actions: clicking buttons, filling forms, or running JavaScript.Preferred SDK method
Example
Parameters
Stop session:
Firecrawl.stop_interactive_scrape_browser_session(job_id) sends DELETE /scrape/{jobId}/interact.
Notes
- Auto-generated SDK: The Elixir SDK is auto-generated from the OpenAPI spec (
mix run generate.exs). Do not expect hand-written conveniences. - Function names mirror OpenAPI operation IDs:
search_and_scrape(notsearch),scrape_and_extract_from_url(notscrape),interact_with_scrape_browser_session(notinteract). - Bang variants: Every function has a
!variant that raises instead of returning{:error, ...}. - NimbleOptions validation: All parameters are validated at call time before the HTTP request. Invalid keys or types return
{:error, %NimbleOptions.ValidationError{}}. - snake_case to camelCase: You pass snake_case keyword lists; the SDK auto-converts to camelCase for the JSON body. Nested keyword lists are also recursively camelCased.
- Error handling: HTTP 400+ responses are converted to
Firecrawl.Errorstructs (withstatusandbodyfields), not rawReq.Response. - No deprecated aliases: The Elixir SDK has no deprecated function aliases.
- Proxy as atom: The
proxyparameter accepts atoms (:basic,:enhanced,:auto), not strings.
Source Of Truth
firecrawl/apps/elixir-sdk/lib/firecrawl.exfirecrawl/apps/elixir-sdk/lib/firecrawl/error.exfirecrawl/apps/elixir-sdk/mix.exsfirecrawl-docs/api-reference/v2-openapi.json

