Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents. Generated from SDK source (firecrawl hex package v1.11.0) and the v2 OpenAPI spec. The Elixir client is auto-generated from the OpenAPI spec; function names match the spec operation IDs.

Install

Add to mix.exs:

Authenticate

Every function accepts a trailing opts keyword list with :api_key and :base_url (default https://api.firecrawl.dev/v2) overrides. Scrape, search, and interact work without an API key (keyless free tier, rate-limited by IP).

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.

Why use it

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

Preferred SDK method

Firecrawl.search_and_scrape(params \\ [], opts \\ [])

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 \\ [])

Example

Parameters

Format strings: "markdown", "html", "rawHtml", "links", "images", "screenshot", "summary", "changeTracking", "json", "branding", "audio", "video". Format maps:
  • %{type: "json", prompt: "...", schema: %{...}}
  • %{type: "question", question: "..."}
  • %{type: "highlights", query: "..."}
  • %{type: "screenshot", fullPage: true, quality: 80, viewport: %{width: 1280, height: 720}}
  • %{type: "changeTracking", modes: ["git-diff"], tag: "..."}

Interact

Why use it

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

Preferred SDK method

Firecrawl.interact_with_scrape_browser_session(job_id, params \\ [], opts \\ [])

Example

Parameters

Notes

  • The Elixir client is auto-generated from the OpenAPI spec via mix run generate.exs.
  • Every function has a bang (!) variant: scrape_and_extract_from_url!/2 raises on error instead of returning {:error, _}.
  • Parameters are snake_case keyword lists, auto-converted to camelCase for the JSON body.
  • Atoms are accepted for enum values (:basic, :node, etc.) and auto-stringified.
  • origin is auto-injected as "elixir-sdk@<version>" when not set.
  • This SDK exposes code-based interactions only — there is no prompt parameter on the interact function (unlike Node.js, Python, and Rust SDKs).

Source Of Truth

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