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:
Or pass the API key per-request:
Usage#
- Get an API key from firecrawl.dev
- Set the API key in your application config or pass it as an option to any function.
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.
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.
Start a Crawl#
Start a crawl job and get back the job ID without blocking:
Checking Crawl Status#
Check the status of a crawl job with get_crawl_status:
Cancelling a Crawl#
Cancel a crawl job with cancel_crawl:
Map a Website#
Use map_urls to generate a list of URLs from a website:
Search#
Search the web and optionally scrape results:
Batch Scrape#
Scrape multiple URLs in a single batch job:
Agent#
Start an agentic data extraction task:
Browser#
Launch cloud browser sessions and execute code remotely.
Create a Session#
Execute Code#
Profiles#
Save and reuse browser state (cookies, localStorage, etc.) across sessions:
List & Close Sessions#
Self-Hosted Instances#
To use a self-hosted Firecrawl instance, pass the base_url option:
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.
All Available Functions#
| Function | Description |
|---|---|
scrape_and_extract_from_url | Scrape a single URL |
scrape_and_extract_from_urls | Batch scrape multiple URLs |
crawl_urls | Crawl a website |
get_crawl_status | Check crawl job status |
get_crawl_errors | Get crawl job errors |
get_active_crawls | List active crawls |
cancel_crawl | Cancel a crawl job |
map_urls | Map URLs on a website |
search_and_scrape | Search and scrape results |
start_agent | Start an agent extraction task |
get_agent_status | Check agent job status |
cancel_agent | Cancel an agent job |
create_browser_session | Create a browser session |
execute_browser_code | Execute code in a browser session |
list_browser_sessions | List browser sessions |
delete_browser_session | Delete a browser session |
get_batch_scrape_status | Check batch scrape status |
get_batch_scrape_errors | Get batch scrape errors |
cancel_batch_scrape | Cancel a batch scrape |
get_credit_usage | Get 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.

