Firecrawl Elixir Agent Quickstart
Canonical quickstart for external agents. Generated from SDK source (firecrawl hex package 1.9.1) and the v2 OpenAPI spec. Function names are auto-generated from the OpenAPI spec and match the SDK exactly.
Install
Authenticate
api_key and base_url (default "https://api.firecrawl.dev/v2") in the trailing opts keyword list.
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.
Search
Why use it
Use search to discover relevant pages from a query, then pick URLs to scrape or interact with. Constrain results to a site withsite:, for example site:docs.firecrawl.dev crawl webhooks.
Preferred SDK function
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
Scrape
Why use it
Use scrape when you already have a URL and want structured content in one or more formats.Preferred SDK function
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
Interact
Why use it
Useinteract to run code in the browser session tied to a scrape job. The Elixir SDK accepts code (required) and does not support prompt — use code-based interaction.
Preferred SDK function
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
Stop session
Firecrawl.stop_interactive_scrape_browser_session(job_id, opts \\ []) → {:ok, Req.Response.t()} | {:error, Exception.t()}
Notes
- The Elixir SDK is auto-generated from the OpenAPI spec (
generate.exs). Function names are long and OpenAPI-derived — do not rename them. - No deprecated aliases exist in the Elixir SDK.
interactdoes not supportprompt— only code-based interaction is available.- The SDK uses
Requnder the hood. Extraoptsare passed through toReq. - The proxy parameter accepts atoms (
:basic,:enhanced,:auto), not strings. - Errors return
{:error, Firecrawl.Error.t()}withstatusandbodyfields.
Source Of Truth
firecrawl/apps/elixir-sdk/lib/firecrawl.exfirecrawl/apps/elixir-sdk/mix.exsfirecrawl-docs/api-reference/v2-openapi.json

