Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents. Generated from :firecrawl hex package v1.11.0 source (firecrawl/apps/elixir-sdk) and the v2 OpenAPI spec. Function names are auto-generated from the OpenAPI spec; parameters use snake_case and are converted to camelCase for the API.

Install

Authenticate

Additional per-call options: base_url (override default https://api.firecrawl.dev/v2), plus any keyword passed through to Req.

When To Use What

  • search_and_scrape — start with a query, discover relevant pages, then scrape or interact with the results.
  • scrape_and_extract_from_url — you already have a URL and want structured page content.
  • interact_with_scrape_browser_session — the page needs code execution in a post-scrape browser session.

Why use it

Discover relevant pages from a text query. Supports site: scoping, source filtering, category narrowing, and inline scraping of results.

Preferred SDK function

Firecrawl.search_and_scrape(params, opts \\ []) → {:ok, %Req.Response{}} or {:error, exception} Bang variant: Firecrawl.search_and_scrape!(params, opts) → %Req.Response{} or raises.

Example

Parameters

First argument (keyword list):

Scrape

Why use it

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

Preferred SDK function

Firecrawl.scrape_and_extract_from_url(params, opts \\ []) → {:ok, %Req.Response{}} or {:error, exception} Bang variant: Firecrawl.scrape_and_extract_from_url!(params, opts) → %Req.Response{} or raises.

Example

Parameters

First argument (keyword list):

Interact

Why use it

Execute code in the browser session tied to a scrape job for post-scrape automation.

Preferred SDK function

Firecrawl.interact_with_scrape_browser_session(job_id, params, opts \\ []) → {:ok, %Req.Response{}} or {:error, exception} Bang variant: Firecrawl.interact_with_scrape_browser_session!(job_id, params, opts) → %Req.Response{} or raises.

Example

Parameters

First argument: job_id (String.t) — scrape job ID. Second argument (keyword list):

Stop session

Firecrawl.stop_interactive_scrape_browser_session(job_id, opts \\ []) → {:ok, %Req.Response{}} or {:error, exception}

Notes

  • Function names are auto-generated from the OpenAPI spec, so they are verbose: search_and_scrape, scrape_and_extract_from_url, interact_with_scrape_browser_session.
  • Every function has a bang (!) variant that raises on error.
  • Parameters use snake_case keys; they are converted to camelCase for the JSON body automatically.
  • The last argument to every function is always opts \\ [] for :api_key, :base_url, and Req pass-through options.
  • Responses are raw %Req.Response{} structs; access data via response.body["data"].
  • The Elixir SDK’s interact_with_scrape_browser_session requires code; it does not support prompt-based natural-language interaction.
  • Parameters are validated at call time by NimbleOptions.

Source Of Truth

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