Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents. Generated from the firecrawl Elixir SDK source and the v2 OpenAPI spec. Function names match the auto-generated module in lib/firecrawl.ex.

Install

Add to mix.exs:

Authenticate

Every function accepts base_url in opts (defaults to "https://api.firecrawl.dev/v2"). Additional opts are passed through to Req.

When To Use What

  • search: use when you start with a query and need discovery. Returns relevant pages you can then scrape or interact with.
  • scrape: use when you already have a URL and want structured page content (markdown, HTML, JSON extraction, screenshots, etc.).
  • interact: use when the page needs clicks, form fills, or other browser actions after a scrape has created a session. Requires a scrape job ID from a prior scrape.

Why use it

Discover relevant pages from a query. Constrain results to a site with site: in the query string (e.g. site:docs.firecrawl.dev webhooks).

Preferred SDK method

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

Example

Every function has a bang variant (search_and_scrape!) that raises on error.

Parameters

Keyword list params:

Scrape

Why use it

Retrieve structured content from a URL in one or more formats: markdown, HTML, JSON extraction, screenshots, and more.

Preferred SDK method

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

Example

Parameters

Keyword list params:

Interact

Why use it

Control the browser session tied to a prior scrape. Use for code execution in the browser session. Requires a scrape job ID from a prior scrape response.

Preferred SDK method

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

Example

To stop the session: Firecrawl.stop_interactive_scrape_browser_session(job_id)

Parameters

Notes

  • Function names are auto-generated from the OpenAPI spec and follow a verbose pattern: scrape_and_extract_from_url, search_and_scrape, interact_with_scrape_browser_session. Use them exactly as named.
  • Every function has a bang variant (e.g. search_and_scrape!) that raises Firecrawl.Error on failure instead of returning {:error, ...}.
  • Parameter names in the keyword list use snake_case (e.g. only_main_content, scrape_options), which the SDK converts to camelCase JSON keys before sending.
  • The Elixir SDK’s interact_with_scrape_browser_session only exposes the code parameter, not prompt. For natural-language browser instructions, use the HTTP API directly or another SDK.
  • No deprecated aliases exist — the SDK is auto-generated from the OpenAPI spec.
  • Proxy values use atoms (:basic, :enhanced, :auto) rather than strings.
  • All functions accept api_key and base_url in the trailing opts keyword list.

Source Of Truth

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