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 and the OpenAPI spec.

Install

Add to your mix.exs dependencies:
Then run mix deps.get.

Authenticate

The Elixir SDK has no client struct. Configure the API key globally or pass it per-call. Global configuration (in config/config.exs):
Per-call override (via the opts keyword list):
A nil/empty key is allowed — scrape, search, and interact fall back to a keyless free tier (rate-limited per IP). The opts keyword list (always the last argument) also accepts:

When To Use What

  • search_and_scrape — Use when you start with a query and need discovery. Returns web, news, and image results with optional scraping of each result.
  • scrape_and_extract_from_url — Use when you already have a URL and want page content (markdown, HTML, screenshots, structured JSON, etc.).
  • interact_with_scrape_browser_session — Use when the page needs clicks, form fills, or post-scrape browser actions. Runs code against an active browser session.

Why use it

Search the web with a query and get back structured results. Optionally scrape each result page inline. Useful for discovery, research, and finding relevant URLs before scraping them in detail.

Preferred SDK method

Example

Bang variant raises on error: Firecrawl.search_and_scrape!(params, opts).

Parameters

All parameters are passed as a keyword list:

Scrape

Why use it

Fetch a single URL and get back structured page data — markdown, HTML, screenshots, extracted JSON, and more. The workhorse endpoint for turning a known URL into usable content.

Preferred SDK method

Example

Bang variant: Firecrawl.scrape_and_extract_from_url!(params, opts).

Parameters

All parameters are passed as a keyword list:

Interact

Why use it

Run code against an active browser session tied to a scrape job. Use it for clicking buttons, filling forms, navigating multi-step flows, or extracting data that requires browser interaction after the initial scrape.

Preferred SDK method

Example

Bang variant: Firecrawl.interact_with_scrape_browser_session!(job_id, params, opts).

Parameters

Stopping a session

Notes

  • Auto-generated SDK — The Elixir SDK is auto-generated from the OpenAPI spec. Every function maps 1:1 to an API operation. The file header says “DO NOT EDIT MANUALLY”.
  • No client struct — There is no client object to initialize. Firecrawl is a module with static functions.
  • Keyword list parameters — All params must be keyword lists (e.g. [url: "...", limit: 10]). NimbleOptions validates at runtime.
  • Nested params are keyword lists too — For scrape_options, location, audit_metadata, profile, pass keyword lists. The SDK auto-converts snake_case keys to camelCase when serializing to JSON.
  • Enum values are atoms — For constrained params, pass atoms: proxy: :enhanced, language: :node. They become strings in the JSON body.
  • No deprecated aliases — The SDK has no deprecated aliases or renamed functions.
  • Return shape — All functions return {:ok, %Req.Response{}} or {:error, exception}. Bang variants return Req.Response.t() directly and raise on error.
  • Function names are verbose — The function names (scrape_and_extract_from_url, search_and_scrape, interact_with_scrape_browser_session) are generated from the OpenAPI operation IDs. Do not rename them.

Source Of Truth

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