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 yourmix.exs dependencies:
mix deps.get.
Authenticate
Application config (recommended)::base_url— override the defaulthttps://api.firecrawl.dev/v2(for self-hosted).- Any other keys are passed through to the underlying
Reqrequest.
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.
Search
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. Onlyquery 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. Onlyurl 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 isjob_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 raisesFirecrawl.Erroron HTTP errors instead of returning{:error, ...}. - Return values are
{:ok, %Req.Response{}}or{:error, exception}. Access response data viaresponse.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.exfirecrawl/apps/elixir-sdk/mix.exsfirecrawl-docs/api-reference/v2-openapi.json

