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 match the auto-generated client from the OpenAPI spec.

Install

Add to mix.exs:

Authenticate

Self-hosted:

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

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

Example

Parameters

Scrape

Why use it

Use scrape when you already have a URL and want structured content in one or more formats.

Preferred SDK method

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

Example

Parameters

Interact

Why use it

Use interact for code-based control of the browser session tied to a scrape job. The Elixir SDK requires code (no prompt parameter).

Preferred SDK method

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

Example

Parameters

Stop session

Firecrawl.stop_interactive_scrape_browser_session(job_id, opts \\ [])

Notes

  • The Elixir client is auto-generated from the OpenAPI spec — function names are derived from operation IDs and may look verbose (e.g. scrape_and_extract_from_url instead of scrape).
  • All functions return {:ok, %Req.Response{}} or {:error, exception}. Bang variants (e.g. scrape_and_extract_from_url!) raise on error.
  • Parameters use snake_case keyword lists, but are converted to camelCase JSON for the API.
  • Atoms in parameter values (e.g. :node, :web) are converted to strings in the request body.
  • Per-call options (api_key:, base_url:) are passed in the second argument (opts).

Source Of Truth

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