Skip to main content

Elixir

Firecrawl Elixir SDK is an auto-generated client for the Firecrawl API v2, built with Req and NimbleOptions.
3 min read

Scrape single pages, crawl entire sites, and map URLs from your Elixir application. The SDK validates all parameters at runtime with NimbleOptions and uses Req for HTTP, so you get clear errors for typos and invalid options before any request is made.

Every function has a bang (!) variant that raises on error instead of returning {:error, ...} tuples.

Installation#

Add firecrawl to your list of dependencies in mix.exs and configure your API key:

Elixir

Or pass the API key per-request:

Elixir

Usage#

  1. Get an API key from firecrawl.dev
  2. Set the API key in your application config or pass it as an option to any function.
Elixir

Scraping a URL#

Scrape a single URL with scrape_and_extract_from_url. It returns the page content as structured data, including markdown, metadata, and any other formats you request.

Elixir

Crawl a Website#

To crawl a website, use crawl_urls. It takes the starting URL and optional parameters such as page limit, allowed domains, and output format.

Elixir

Start a Crawl#

Start a crawl job and get back the job ID without blocking:

Elixir

Checking Crawl Status#

Check the status of a crawl job with get_crawl_status:

Elixir

Cancelling a Crawl#

Cancel a crawl job with cancel_crawl:

Elixir

Map a Website#

Use map_urls to generate a list of URLs from a website:

Elixir

Search the web and optionally scrape results:

Elixir

Batch Scrape#

Scrape multiple URLs in a single batch job:

Elixir

Agent#

Start an agentic data extraction task:

Elixir

Browser#

Launch cloud browser sessions and execute code remotely.

Create a Session#

Elixir

Execute Code#

Elixir

Profiles#

Save and reuse browser state (cookies, localStorage, etc.) across sessions:

Elixir

List & Close Sessions#

Elixir

Self-Hosted Instances#

To use a self-hosted Firecrawl instance, pass the base_url option:

Elixir

Error Handling#

Non-bang functions return {:ok, response} or {:error, exception}. Bang variants raise on error. NimbleOptions validates all parameters before the request is sent, catching typos, missing required fields, and type errors immediately.

Elixir

All Available Functions#

FunctionDescription
scrape_and_extract_from_urlScrape a single URL
scrape_and_extract_from_urlsBatch scrape multiple URLs
crawl_urlsCrawl a website
get_crawl_statusCheck crawl job status
get_crawl_errorsGet crawl job errors
get_active_crawlsList active crawls
cancel_crawlCancel a crawl job
map_urlsMap URLs on a website
search_and_scrapeSearch and scrape results
start_agentStart an agent extraction task
get_agent_statusCheck agent job status
cancel_agentCancel an agent job
create_browser_sessionCreate a browser session
execute_browser_codeExecute code in a browser session
list_browser_sessionsList browser sessions
delete_browser_sessionDelete a browser session
get_batch_scrape_statusCheck batch scrape status
get_batch_scrape_errorsGet batch scrape errors
cancel_batch_scrapeCancel a batch scrape
get_credit_usageGet remaining credits

Every function above has a bang (!) variant (e.g., scrape_and_extract_from_url!) that raises instead of returning error tuples.

For full API documentation, see hexdocs.pm/firecrawl.