Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for agents integrating Firecrawl via the Elixir SDK. Generated from SDK source (firecrawl hex package) and the v2 OpenAPI spec. Function names and parameters match the auto-generated OpenAPI client.

Install

Add to mix.exs:

Authenticate

When To Use What

  • search: use when you start with a query and need discovery. Returns categorized results from web, news, and image sources.
  • scrape: use when you already have a URL and want page content in one or more formats (markdown, HTML, JSON extraction, screenshots, etc.).
  • interact: use when the page needs clicks, forms, or post-scrape browser actions. Operates on a browser session created by a prior scrape.

Why use it

Discover relevant pages from a query, then pick URLs to scrape or interact with. Constrain results to a site with site: in the query (e.g. site:docs.firecrawl.dev webhooks).

Preferred SDK method

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

Example

Parameters

Scrape

Why use it

Get 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 \\ []){:ok, %Req.Response{}} or {:error, exception} Bang variant: Firecrawl.scrape_and_extract_from_url!(params, opts) raises on error.

Example

Parameters

Interact

Why use it

Control the browser session tied to a prior scrape job. Use for code execution in the browser runtime.

Preferred SDK method

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) raises on error.

Example

Parameters

Stop session

Firecrawl.stop_interactive_scrape_browser_session(job_id) ends the browser session.

Notes

  • The Elixir client is auto-generated from the OpenAPI spec; function names are derived from operation IDs, not hand-written aliases.
  • This SDK exposes code-based interactions only: there is no prompt parameter on interact_with_scrape_browser_session.
  • Each function has a bang (!) variant that raises on error instead of returning {:error, _}.
  • The SDK appends "origin": "elixir-sdk@<version>" to every request body for telemetry.
  • Uses snake_case parameter keys in Elixir, converted to camelCase JSON keys on the wire.

Source Of Truth

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