Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents integrating with Firecrawl via the Elixir SDK. Generated from SDK source and OpenAPI spec.

Install

Add to your mix.exs dependencies:
Then run:

Authenticate

Set the API key globally in your application config:
Or pass it per-request:
No API key is required for a keyless free tier (rate-limited per IP). All functions accept an optional trailing keyword list for client options: Additional keys are passed through to the underlying Req HTTP client.

When To Use What

  • search_and_scrape: Start with a query and need to discover URLs and content. Returns search results from web, news, and image sources.
  • scrape_and_extract_from_url: Already have a URL and want page content as markdown, HTML, screenshots, or structured JSON.
  • interact_with_scrape_browser_session: The page needs clicks, form fills, or post-scrape browser actions. Runs code in a browser session tied to a prior scrape.

Why use it

Search the web for a query and optionally scrape each result page. Returns results grouped by source type.

Preferred SDK function

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

Example

Parameters

First argument is a keyword list. query is required; all others are optional.

Scrape

Why use it

Fetch and convert a single URL to markdown, HTML, screenshots, structured JSON, or other formats. Supports browser actions, mobile emulation, caching, and PDF parsing.

Preferred SDK function

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

Example

Extract structured data:

Parameters

First argument is a keyword list. url is required; all others are optional.

Interact

Why use it

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

Preferred SDK function

Stop the session:
Bang variants available: interact_with_scrape_browser_session!, stop_interactive_scrape_browser_session!.

Example

Parameters

First argument is the job_id (string). Second is a keyword list of body parameters.

Notes

  • The Elixir SDK is auto-generated from the OpenAPI spec (generate.exs). Function names directly reflect OpenAPI operation IDs.
  • Parameter keys use snake_case atoms (e.g. :only_main_content, :include_tags). The SDK converts them to camelCase JSON keys automatically.
  • The Elixir SDK does not support prompt-based interaction — only code execution. To use natural-language prompts, use the Node.js or Python SDK.
  • The proxy parameter accepts atoms (:basic, :enhanced, :auto) rather than strings. The :stealth proxy mode is not validated by the Elixir SDK.
  • All functions return {:ok, Req.Response.t()} or {:error, exception}. Bang variants (! suffix) return the response directly and raise on error.
  • No deprecated aliases exist 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