Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents. Generated from SDK source (:firecrawl hex package) and the OpenAPI spec. Use this file to get an agent calling Firecrawl correctly in one pass. The Elixir SDK is auto-generated from the OpenAPI spec. Function names follow the OpenAPI operation names rather than short aliases.

Install

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

Authenticate

Application config (recommended):
Per-call option (overrides config):
Additional per-call options:
  • :base_url — override the default https://api.firecrawl.dev/v2 (for self-hosted).
  • Any other keys are passed through to the underlying Req request.
No API key is required for scrape, search, and interact — they fall back to a keyless free tier (rate-limited per IP).

When To Use What

  • search_and_scrape: Start with a text query and need to discover relevant URLs and content across the web.
  • scrape_and_extract_from_url: Already have a URL and want page content (markdown, HTML, structured JSON, screenshots, etc.).
  • interact_with_scrape_browser_session: The page needs clicks, form fills, or post-scrape browser actions — run code against the live browser session.

Why use it

Search the web and optionally scrape each result. Returns categorized results (web, news, images) with optional content scraping.

Preferred SDK method

Example

Parameters

All parameters are passed as a keyword list. Only query is required. Return type: {:ok, %Req.Response{}} where response.body contains "data" with "web", "news", "images" arrays.

Scrape

Why use it

Fetch a single URL and extract content in various formats: markdown, HTML, structured JSON, screenshots, audio, video, and more. Handles JavaScript rendering, ad blocking, proxies, and caching.

Preferred SDK method

Example

Parameters

All parameters are passed as a keyword list. Only url is required.

Interact

Why use it

Execute code against the live browser session from a previous scrape. Use it to click buttons, fill forms, navigate, or extract dynamic content that only appears after user interaction.

Preferred SDK method

Example

Parameters

The first argument is job_id (string). Remaining parameters are a keyword list. Stop the session when done:

Notes

  • Function names are OpenAPI-derived: scrape_and_extract_from_url, search_and_scrape, interact_with_scrape_browser_session. These are the canonical names; there are no short aliases.
  • All parameter names use snake_case (e.g. only_main_content, skip_tls_verification).
  • Every function has a bang (!) variant that raises Firecrawl.Error on HTTP errors instead of returning {:error, ...}.
  • Return values are {:ok, %Req.Response{}} or {:error, exception}. Access response data via response.body.
  • No deprecated aliases exist in the Elixir SDK.
  • The Elixir SDK is auto-generated from the OpenAPI spec. Its parameter names match the API wire format (in snake_case).

Source Of Truth

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