Skip to main content

Firecrawl Elixir Agent Quickstart

Canonical quickstart for external agents. Generated from SDK source (:firecrawl hex package) and the v2 OpenAPI spec. Function names and parameter keys are auto-generated from the OpenAPI spec.

Install

Add to mix.exs:

Authenticate

All functions accept :api_key and :base_url (default "https://api.firecrawl.dev/v2") in the trailing opts keyword list.

When To Use What

  • search: start with a query and need discovery. Returns ranked results, optionally with scraped content.
  • scrape: already have a URL and want page content in one or more formats.
  • interact: the page needs clicks, forms, or post-scrape browser actions. Requires a scrape job ID from a prior scrape.

Why use it

Discover relevant pages from a query, then pick URLs to scrape or interact with. Use site:example.com in the query to limit results to a domain.

Preferred SDK method

Firecrawl.search_and_scrape(params \\ [], opts \\ [])

Example

Parameters

Scrape

Why use it

Get structured content from a URL in one or more formats — markdown, HTML, JSON extraction, screenshots, and more.

Preferred SDK method

Firecrawl.scrape_and_extract_from_url(params \\ [], opts \\ [])

Example

Parameters

Action types

Pass as list of maps: %{type: "wait", milliseconds: 750}, %{type: "click", selector: "#accept"}, %{type: "write", text: "hello"}, %{type: "press", key: "Enter"}, %{type: "scroll", direction: "down"}, %{type: "scrape"}, %{type: "executeJavascript", script: "..."}, %{type: "screenshot"}, %{type: "pdf"}.

Interact

Why use it

Execute code in the browser session tied to a scrape job. The Elixir SDK exposes code-based interactions only (no prompt parameter).

Preferred SDK method

Firecrawl.interact_with_scrape_browser_session(job_id, params \\ [], opts \\ [])

Example

Parameters

Stop session

Firecrawl.stop_interactive_scrape_browser_session(job_id)DELETE /scrape/{jobId}/interact. Ends the browser session.

Notes

  • The Elixir SDK is auto-generated from the OpenAPI spec. Function names are verbose (e.g. scrape_and_extract_from_url) and come directly from operation IDs.
  • Parameters use snake_case atom keys — they are automatically converted to camelCase JSON.
  • Nested keyword lists are recursively camelCased (e.g. scrape_options: [only_main_content: true]{"scrapeOptions": {"onlyMainContent": true}}).
  • Atom values (except true/false/nil) are converted to strings (e.g. proxy: :basic"proxy": "basic").
  • Every function has a bang (!) variant that raises on error instead of returning {:error, _}.
  • Responses are raw Req.Response structs — access data via res.body["data"].
  • Parameters are validated client-side with NimbleOptions before sending.
  • The Elixir SDK does not support prompt on interact — only code-based interactions.

Source Of Truth

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