Skip to main content
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

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.