Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents. Generated from SDK source (:firecrawl v1.11.0) and the v2 OpenAPI spec. Function names and parameter keys match the auto-generated SDK module.

Install

Add to mix.exs:

Authenticate

There is no client struct to instantiate. Auth is handled per-request via application config or the trailing opts keyword list.

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 code execution in a post-scrape browser session. 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:, for example site:docs.firecrawl.dev crawl webhooks.

Preferred SDK method

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

Example

Parameters

Scrape

Why use it

Fetch structured content from a URL in one or more formats. Use when you already have the URL.

Preferred SDK method

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

Example

Parameters

Interact

Why use it

Execute code in the browser session tied to a scrape job. Use for Playwright-style page manipulation after a scrape creates a session.

Preferred SDK method

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

Example

Parameters

The Elixir SDK exposes code-based interactions only. There is no prompt parameter (the SDK is auto-generated from the OpenAPI spec which lists code only). Stop session: Firecrawl.stop_interactive_scrape_browser_session(job_id) ends the browser session.

Notes

  • The Elixir SDK is auto-generated from the OpenAPI spec. Function names and parameter keys match the generated code.
  • Every function has a bang (!) variant that raises on error: e.g. search_and_scrape!, scrape_and_extract_from_url!.
  • Parameters are passed as snake_case keyword lists; the SDK converts them to camelCase JSON for the API.
  • Enum values (proxy, language) are passed as atoms: :basic, :node, etc.
  • Nested objects (location, scrape_options, profile) are passed as keyword lists.
  • All functions return {:ok, %Req.Response{}} or {:error, exception}. The response body is the decoded JSON map.
  • No SDK-level defaults are set; all defaults come from the server.

Source Of Truth

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