Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents. Generated from SDK source (:firecrawl Hex package) and the v2 OpenAPI spec. Function names and parameters match the SDK public API. The Elixir client is OpenAPI-generated — function names and parameter keys come from the spec.

Install

Add to mix.exs:

Authenticate

All functions accept api_key and base_url (default "https://api.firecrawl.dev/v2") as trailing opts. A nil/empty key falls back to the keyless free tier.

When To Use What

  • search: use when you start with a query and need discovery.
  • scrape: use when you already have a URL and want page content.
  • interact: use when the page needs clicks, forms, or post-scrape browser actions. Requires a scrape job ID.

Why use it

Discover relevant pages from a query, then pick URLs to scrape or interact with. Constrain results to a site with site: in the query.

Preferred SDK method

Firecrawl.search_and_scrape(params \\ [], opts \\ []){:ok, Req.Response.t()} | {:error, Exception.t()}

Example

Parameters

Scrape

Why use it

Get structured content from a URL in one or more formats.

Preferred SDK method

Firecrawl.scrape_and_extract_from_url(params \\ [], opts \\ []){:ok, Req.Response.t()} | {:error, Exception.t()}

Example

Parameters

Interact

Why use it

Execute code in the browser session tied to a prior scrape. The Elixir SDK supports code-based interactions only (no prompt parameter).

Preferred SDK method

Firecrawl.interact_with_scrape_browser_session(job_id, params \\ [], opts \\ []){:ok, Req.Response.t()} | {:error, Exception.t()}

Example

Parameters

Stop the session with Firecrawl.stop_interactive_scrape_browser_session(job_id).

Notes

  • Every function has a bang (!) variant that raises on error instead of returning {:error, _}.
  • The Elixir client is OpenAPI-generated; function names come from the spec (e.g. search_and_scrape, scrape_and_extract_from_url).
  • This SDK exposes code-based interactions only — no prompt parameter on interact_with_scrape_browser_session (unlike Node.js, Python, and Rust SDKs).
  • Uses snake_case parameter keys. Maps use camelCase keys for format objects (e.g. %{type: "json", prompt: "..."}).
  • No deprecated aliases exist — function names have been stable since the OpenAPI codegen.

Source Of Truth

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