Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents. Generated from SDK source (firecrawl hex package, firecrawl/apps/elixir-sdk) and the v2 OpenAPI spec. Function names and parameters match the auto-generated client.

Install

Authenticate

All functions accept api_key and base_url (defaults to https://api.firecrawl.dev/v2) as options in the last keyword list argument. If no API key is provided, requests fall back to a keyless free tier (rate-limited per IP).

When To Use What

  • search_and_scrape: use when you start with a query and need discovery.
  • 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 clicks, forms, or post-scrape browser actions.

Why use it

Use search to discover relevant pages from a query, then pick URLs to scrape or interact with.

Preferred SDK method

Firecrawl.search_and_scrape(params, opts){:ok, Req.Response.t()} | {:error, Exception.t()} Bang variant: Firecrawl.search_and_scrape!(params, opts) raises on error.

Example

Parameters

Parameters are passed as a keyword list (first argument). All are optional except query.

Scrape

Why use it

Use scrape when you already have a URL and want structured content in one or more formats.

Preferred SDK method

Firecrawl.scrape_and_extract_from_url(params, opts){:ok, Req.Response.t()} | {:error, Exception.t()} Bang variant: Firecrawl.scrape_and_extract_from_url!(params, opts) raises on error.

Example

Parameters

Parameters are passed as a keyword list (first argument). All are optional except url.

Interact

Why use it

Use interact_with_scrape_browser_session for code execution in the browser session tied to a scrape job. For multi-step interactive flows, prefer this over scrape-time actions.

Preferred SDK method

Firecrawl.interact_with_scrape_browser_session(job_id, params, opts){:ok, Req.Response.t()} | {:error, Exception.t()} Bang variant: Firecrawl.interact_with_scrape_browser_session!(job_id, params, opts) raises on error.

Example

Parameters

The first argument is the job_id (path parameter). Remaining parameters are a keyword list.

Return value

The response body contains: success, cdpUrl, liveViewUrl, interactiveLiveViewUrl, output, stdout, result, stderr, exitCode, killed, error.

Stop session

Firecrawl.stop_interactive_scrape_browser_session(job_id, opts) — ends the browser session.

Notes

  • The Elixir SDK is auto-generated from the OpenAPI spec. Function names follow the OpenAPI operation IDs rather than simplified aliases.
  • Function name mapping to other SDKs:
    • search_and_scrape = search in other SDKs
    • scrape_and_extract_from_url = scrape in other SDKs
    • interact_with_scrape_browser_session = interact in other SDKs
    • stop_interactive_scrape_browser_session = stopInteraction / stop_interaction in other SDKs
  • All functions have bang (!) variants that raise instead of returning error tuples.
  • Parameters use snake_case keys in the keyword list but are serialized to camelCase JSON keys.
  • The proxy parameter is typed as an enum (:basic, :enhanced, :auto) — note that :stealth is not in the Elixir SDK’s validated values.
  • Additional Req options (custom headers, adapter config, etc.) can be passed through in the opts keyword list.

Source Of Truth

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