Skip to main content

Firecrawl Elixir Agent Quickstart

This is the canonical quickstart for external agents integrating with Firecrawl using the official Elixir SDK. Generated from SDK source and OpenAPI spec.

Install

Add to your mix.exs dependencies:

Authenticate

The Elixir SDK does not use a client struct. Authentication is resolved per-call in this order:
  1. :api_key option passed in the trailing opts keyword list of any function call.
  2. Application config: Application.get_env(:firecrawl, :api_key).
  3. If nil or empty, the key is omitted (keyless free tier for scrape, search, and interact).
The base URL defaults to https://api.firecrawl.dev/v2 but can be overridden per-call with :base_url in opts.

When To Use What

  • search_and_scrape — Use when you start with a query and need to discover relevant pages. Returns search results grouped by source type, optionally with scraped content.
  • scrape_and_extract_from_url — Use when you already have a URL and want its content. Returns markdown, HTML, structured data, screenshots, or other formats.
  • interact_with_scrape_browser_session — Use when the page needs post-scrape browser actions like clicking, filling forms, or executing code in the browser sandbox.

Why use it

Search the web and optionally scrape each result in one call. Start here when you have a question or topic but not a specific URL.

Preferred SDK function

Bang variant: Firecrawl.search_and_scrape!(params, opts) raises on error.

Example

Parameters

All parameters are passed as a keyword list. All are optional except query.

Scrape

Why use it

Fetch and extract content from a single URL. Use when you have a specific page to read.

Preferred SDK function

Bang variant: Firecrawl.scrape_and_extract_from_url!(params, opts) raises on error.

Example

Parameters

All parameters are passed as a keyword list. All are optional except url.

Interact

Why use it

Execute code in the browser sandbox associated with a scrape job. Use after a scrape to click buttons, fill forms, navigate, or extract additional data.

Preferred SDK function

Bang variant: Firecrawl.interact_with_scrape_browser_session!(job_id, params, opts) raises on error.

Example

Parameters

Stops the interactive browser session.

Notes

  • Naming style: Parameters use snake_case in Elixir and are serialized to camelCase JSON keys internally.
  • OpenAPI-shaped client: The Elixir SDK is generated from the OpenAPI spec, so function names directly mirror operation IDs (search_and_scrape, scrape_and_extract_from_url, interact_with_scrape_browser_session).
  • Return type: All functions return {:ok, %Req.Response{}} | {:error, Exception.t() | Firecrawl.Error.t()}. Bang variants raise on error.
  • No prompt parameter: Unlike the JS, Python, and Rust SDKs, the Elixir SDK’s interact function does not support a prompt parameter. Use code only.
  • Per-call auth: Every function accepts :api_key and :base_url in the trailing opts keyword list, allowing different credentials per call.

Source Of Truth

  • firecrawl/apps/elixir-sdk/lib/firecrawl.ex
  • firecrawl/apps/elixir-sdk/mix.exs
  • firecrawl-docs/api-reference/v2-openapi.json