Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents integrating Firecrawl with Elixir. Generated from SDK source and OpenAPI spec. The Elixir SDK is auto-generated from the OpenAPI spec, so function names mirror the API operation names.

Install

Add to mix.exs:
Then run:

Authenticate

Add to your config:
Or pass api_key per-request:
All functions accept a trailing opts keyword list supporting: Additional keys in opts are passed through to Req.

When To Use What

  • search: Start with a query, discover relevant URLs, and get their content in one call.
  • scrape: You already have a URL and want its page content as markdown, HTML, JSON, or other formats.
  • interact: The page needs clicks, form fills, or post-scrape browser actions on a live session.

Why use it

Search the web for a query and get scraped content from the top results. Combines discovery and content extraction in one call.

Preferred SDK method

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

Example

Every function also has a bang variant (search_and_scrape!) that raises on error instead of returning {:error, ...}.

Parameters

All parameters are passed as a keyword list.

Scrape

Why use it

Get the content of a single URL as markdown, HTML, JSON, screenshots, or other formats.

Preferred SDK method

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

Example

Parameters

All parameters are passed as a keyword list.

Interact

Why use it

Control a live browser session tied to a scrape job. Execute code in the browser sandbox to click buttons, fill forms, navigate, and extract dynamic content.

Preferred SDK method

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

Example

Parameters

Stop the session when done:

Notes

  • Parameter names use snake_case and are passed as keyword lists.
  • The Elixir SDK is auto-generated from the OpenAPI spec, so function names are verbose and mirror API operation names directly.
  • The interact function requires code — it does not support a prompt parameter. Use the code parameter with JavaScript to control the browser.
  • Every function has a bang variant (! suffix) that raises Firecrawl.Error instead of returning {:error, ...}.
  • An origin field ("elixir-sdk@{version}") is automatically injected into every request body.
  • There are no deprecated aliases in the Elixir SDK.

Source Of Truth

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