Firecrawl Elixir Agent Quickstart
This file is the canonical quickstart for external agents integrating with Firecrawl via the Elixir SDK. It is generated from SDK source and the OpenAPI spec.Install
Add to yourmix.exs:
Authenticate
opts keyword list on any function call):
All other opts are passed through to
Req.
When To Use What
search_and_scrape: Use when you start with a query and need to discover relevant pages across the web.scrape_and_extract_from_url: Use when you already have a URL and want to extract page content.interact_with_scrape_browser_session: Use when the page needs clicks, form fills, or post-scrape browser actions via code execution.
Search
Why use it
Search finds relevant web pages for a query. Optionally scrapes each result in the same call viascrape_options.
Preferred SDK method
Example
Parameters
All parameters are passed as a keyword list.query is required.
Returns:
{:ok, %Req.Response{}} with JSON body containing data with web, news, images arrays.
Bang variant: Firecrawl.search_and_scrape!/2 raises on error.
Scrape
Why use it
Scrape extracts content from a single URL in any format: markdown, HTML, structured JSON, screenshots, and more.Preferred SDK method
Example
Parameters
All parameters are passed as a keyword list.url is required.
Returns:
{:ok, %Req.Response{}} with JSON body containing data with markdown, html, links, etc.
Bang variant: Firecrawl.scrape_and_extract_from_url!/2 raises on error.
Interact
Why use it
Interact lets you execute code in a browser session that was started by a scrape. Use it for post-scrape actions like clicking buttons, filling forms, or extracting dynamic content.Preferred SDK method
Example
Parameters
job_id is the first positional argument. Body parameters are passed as a keyword list.
Returns:
{:ok, %Req.Response{}} with JSON body containing success, stdout, result, stderr, exitCode, killed, error.
Related: Firecrawl.stop_interactive_scrape_browser_session(job_id) ends the browser session.
Bang variant: Firecrawl.interact_with_scrape_browser_session!/3 raises on error.
Notes
- The Elixir SDK is auto-generated from the OpenAPI spec. Function names match the OpenAPI operation IDs in snake_case.
- All parameters use snake_case keys in keyword lists. They are automatically converted to camelCase JSON for the API.
- The
promptparameter (natural-language browser instructions for interact) is not yet available in the Elixir SDK — use the Node.js or Python SDK for prompt-based interaction. - There are no deprecated aliases in the Elixir SDK.
- Every function has a bang (
!) variant that raisesFirecrawl.Errorinstead of returning{:error, ...}. - Returns are raw
Req.Responsestructs — access JSON data viaresponse.body. - An
originfield ("elixir-sdk@{version}") is auto-injected into every request body.
Source Of Truth
firecrawl/apps/elixir-sdk/lib/firecrawl.exfirecrawl/apps/elixir-sdk/mix.exsfirecrawl-docs/api-reference/v2-openapi.json

