Skip to main content

Firecrawl Elixir Agent Quickstart

This file is the canonical quickstart for external agents integrating Firecrawl via the Elixir SDK. It is generated from SDK source (apps/elixir-sdk) plus the OpenAPI spec (api-reference/v2-openapi.json). The Elixir SDK is auto-generated from the OpenAPI spec. Function names are verbose and OpenAPI-shaped — use them exactly as shown.

Install

Add firecrawl to your mix.exs:
Then run:

Authenticate

Configure your API key in config/config.exs:
Or pass it per-request:
All functions accept a trailing opts keyword list supporting:

When To Use What

  • search_and_scrape — Use when you start with a query and need to discover relevant pages.
  • scrape_and_extract_from_url — Use when you already have a URL and want page content.
  • interact_with_scrape_browser_session — Use when the page needs code execution in a post-scrape browser session.

Why use it

Search the web with a query and get structured results. Each result can optionally include full scraped page content.

Preferred SDK function

Example

Parameters

Pass as a keyword list. All parameters use snake_case keys; the SDK converts to camelCase for the API.

Response

Returns {:ok, %Req.Response{}} or {:error, exception}. Access data via result.body["data"].

Scrape

Why use it

Fetch a single URL and get back clean content in your chosen formats: markdown, HTML, screenshots, structured JSON extraction, and more.

Preferred SDK function

Example

Parameters

Interact

Why use it

After scraping a page, use interact_with_scrape_browser_session to execute code in the live browser session: run Playwright scripts in Node.js, Python, or Bash.

Preferred SDK function

Stop the session when done:

Example

Parameters

Interact limitation: no prompt support

The Elixir SDK’s interact_with_scrape_browser_session requires code — it does not currently support the prompt parameter for natural-language browser interaction. For prompt-based interaction, use the REST API directly:

Notes

  • Function names: The Elixir SDK is auto-generated from the OpenAPI spec. Function names are verbose (e.g. scrape_and_extract_from_url, search_and_scrape, interact_with_scrape_browser_session). Use them exactly as documented.
  • Naming: Parameters use snake_case keys in keyword lists. The SDK converts to camelCase for the API.
  • Bang variants: Every function has a ! bang variant that raises on error instead of returning {:error, ...}.
  • Return type: Non-bang functions return {:ok, %Req.Response{}} or {:error, exception}. Access response data via result.body["data"].
  • Interact prompt: Not supported in the SDK. Use raw Req.post to the REST API for prompt-based interaction.

Source Of Truth

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