Home
Relevant source files
The following files were used as context for generating this wiki page:- README.md
- SELF_HOST.md
- examples/blog-articles/mastering-map-endpoint/mastering-map-endpoint.md
- CONTRIBUTING.md
- examples/turning_docs_into_api_specs/turning_docs_into_api_specs.py
- apps/js-sdk/firecrawl/src/tests/e2e/v2/scrape.test.ts
- apps/api/src/tests/snips/v1/scrape.test.ts
- examples/gemini-2.0-crawler/gemini-2.0-crawler.py
Firecrawl is an API service designed to crawl any website and convert its content into clean, LLM-ready data formats like markdown or structured data. It handles common web scraping challenges such as proxies, anti-bot mechanisms, and JavaScript-rendered content, allowing developers to focus on building AI applications with reliable data. Firecrawl can be used via a hosted cloud API or self-hosted for environments with stringent security requirements.
The service provides several key features, including scraping single URLs, crawling all accessible subpages of a website without needing a sitemap, mapping a website's structure, performing web searches, and extracting structured data using AI. It is accessible through a REST API, official SDKs for Python and Node.js, and various community-supported SDKs and integrations with popular LLM frameworks.
Sources: README.md:22-26, SELF_HOST.md:11-14
Core Features
Firecrawl offers a suite of API endpoints to cover various data extraction needs. To use the API, you must sign up on the Firecrawl website and obtain an API key.
Sources: README.md:42-43
Scrape
The /v2/scrape endpoint retrieves content from a single URL and returns it in specified formats. This is a synchronous operation.
This diagram shows the sequence of a basic scrape request.
Sources: README.md:120-121
Example Request:
curl -X POST https://api.firecrawl.dev/v2/scrape \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"url": "https://docs.firecrawl.dev",
"formats" : ["markdown", "html"]
}'
Sources: README.md:123-130
Example Response:
The response contains the requested data formats and metadata about the scraped page.
{
"success": true,
"data": {
"markdown": "Launch Week I is here! ...",
"html": "<!DOCTYPE html>...",
"metadata": {
"title": "Home - Firecrawl",
"description": "Firecrawl crawls and converts any website into clean markdown.",
"sourceURL": "https://firecrawl.dev",
"statusCode": 200
}
}
}
Sources: README.md:134-154
Crawl
The /v2/crawl endpoint is an asynchronous operation that crawls a URL and all its accessible subpages. It submits a job and returns a jobId which can be used to check the status and retrieve the results.
This diagram illustrates the asynchronous nature of a crawl job.
Sources: README.md:83-84
Example Request:
curl -X POST https://api.firecrawl.dev/v2/crawl \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer fc-YOUR_API_KEY' \
-d '{
"url": "https://docs.firecrawl.dev",
"limit": 10
}'
Sources: README.md:86-95
Map
The /v2/map endpoint is an extremely fast tool for discovering all URLs on a website. It returns a list of links found on the site. This is useful for getting a quick overview of a site's structure or for providing users with a selection of pages to scrape.
Sources: README.md:52, examples/blog-articles/mastering-map-endpoint/mastering-map-endpoint.md:14-16
Example Request:
curl -X POST https://api.firecrawl.dev/v2/map \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"url": "https://firecrawl.dev"
}'
Sources: README.md:158-165
The search parameter can be used to filter URLs, making it useful for focused crawling tasks.
Sources: examples/blog-articles/mastering-map-endpoint/mastering-map-endpoint.md:120-123
Search
The /v2/search endpoint allows you to perform a web search and optionally scrape the content of the search results in a single API call.
Sources: README.md:53, README.md:200-202
Example Request:
curl -X POST https://api.firecrawl.dev/v2/search \
-H "Content-Type: application/json" \
-H "Authorization: Bearer fc-YOUR_API_KEY" \
-d '{
"query": "what is firecrawl?",
"limit": 5
}'
Sources: README.md:209-216
Extract
The /v2/extract endpoint (currently in Beta) uses AI to extract structured data from one or more URLs based on a provided prompt and/or a JSON schema. It can process single pages, multiple pages, or entire domains using wildcards (/*).
Sources: README.md:54, README.md:231-237
Example Request:
curl -X POST https://api.firecrawl.dev/v2/extract \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"urls": [
"https://firecrawl.dev/*"
],
"prompt": "Extract the company mission...",
"schema": {
"type": "object",
"properties": {
"company_mission": { "type": "string" },
"is_open_source": { "type": "boolean" }
}
}
}'
Sources: README.md:239-262
Feature Comparison: /crawl vs. /map
While both /crawl and /map can be used for URL discovery, they are optimized for different use cases.
| Feature | /map Endpoint | /crawl Endpoint |
|---|---|---|
| Primary Use Case | Extremely fast URL discovery and site mapping. | Comprehensive crawling and content extraction. |
| Speed | Very fast (e.g., ~2 seconds for a site). | Slower, as it fully loads and parses each page (e.g., ~2 minutes for the same site). |
| URL Coverage | Prioritizes speed, so it may not capture all links (in its alpha stage). | Captures a more exhaustive list of links by fully rendering pages. |
| Content | Returns only a list of URLs. | Returns the full content (Markdown, HTML, etc.) for each crawled page. |
| Best For | - Quick site structure analysis. - Providing users with a list of pages to choose from. - Topic-specific discovery using the search parameter. | - Building a complete RAG knowledge base. - Archiving a website. - When you need the content of every page. |
Sources: examples/blog-articles/mastering-map-endpoint/mastering-map-endpoint.md:183-221
This flowchart illustrates the decision process for choosing between /map and /crawl.
Usage and Integration
Firecrawl can be integrated into applications using its REST API or through official and community-provided SDKs.
SDKs
Official SDKs are available for:
- Python:
pip install firecrawl-py - Node.js:
npm install @mendable/firecrawl-js
Community SDKs exist for Go and Rust.
Sources: README.md:36-37, README.md:323-325, README.md:349-351
Python SDK Example
This example shows how to scrape a URL and extract structured data using the Python SDK and Pydantic.
from firecrawl import FirecrawlApp
from pydantic import BaseModel, Field
from typing import List
# Initialize with your API key
app = FirecrawlApp(api_key="YOUR_API_KEY")
# Scrape a single URL
scraped_data = app.scrape(
"https://firecrawl.dev",
formats=["markdown"],
)
print(scraped_data.markdown)
# Crawl a website
crawl_result = app.crawl_url("https://docs.firecrawl.dev")
print(f"Total pages crawled: {len(crawl_result['data'])}")
# Extract structured data
class Article(BaseModel):
title: str
url: str
class TopArticles(BaseModel):
top: List[Article] = Field(..., description="Top 5 stories")
extracted_data = app.scrape(
"https://news.ycombinator.com",
formats=[{"type": "json", "schema": TopArticles}],
)
print(extracted_data.json)
Sources: README.md:327-346, examples/turning_docs_into_api_specs/turning_docs_into_api_specs.py:18-23
LLM & Low-code Frameworks
Firecrawl integrates with many popular frameworks, including:
- LLM Frameworks: Langchain (Python/JS), Llama Index, Crew.ai
- Low-code Frameworks: Dify, Langflow, Flowise AI, Pipedream
Sources: README.md:38-40
Architecture
Firecrawl can be used as a managed cloud service or self-hosted.
Cloud vs. Self-hosted
The cloud offering provides additional features not available in the open-source version, such as advanced anti-bot handling and managed proxies.
| Feature | Open Source (Self-hosted) | Firecrawl Cloud |
|---|---|---|
| Scraping & Crawling | ✅ | ✅ |
| LLM-ready output | ✅ | ✅ |
| AI Extract | ✅ (Requires own OpenAI key) | ✅ |
| Managed Proxies | ❌ | ✅ |
| Anti-bot Evasion | Basic | ✅ (Advanced "Fire-engine") |
| Actions (click, scroll, etc.) | ❌ | ✅ |
| Batch Scraping | ❌ | ✅ |
| Change Tracking | ❌ | ✅ |
Sources: README.md:391-393, SELF_HOST.md:11-25
Self-Hosting Architecture
For organizations requiring data to remain within their own infrastructure, Firecrawl can be self-hosted using Docker. The architecture consists of several components.
This diagram shows the components of a self-hosted Firecrawl instance.
Sources: SELF_HOST.md:46-51, CONTRIBUTING.md:19-30
To self-host, you need to:
- Install Docker.
- Create an
.envfile from the provided template to configure services like the port, database, and optional AI features or proxies. - Run
docker compose buildanddocker compose up.
Sources: SELF_HOST.md:54-80