Perbedaan Firecrawl Self-Host v1 vs v2 dan Cara Akses API & MCP
1️⃣ Perbedaan Firecrawl Self-Host v1 vs v2
Perbedaan Utama
| Aspek | v1 | v2 |
|---|---|---|
| URL API | https://api.firecrawl.dev/v1/ |
https://api.firecrawl.dev/v2/ |
| Caching | Tidak default | Default 2 hari (maxAge) |
| Default Options | Tidak ada | blockAds: true, skipTlsVerification: true, removeBase64Images: true |
| Summary Format | Tidak ada | ✅ "summary" tersedia |
| JSON Extraction | "extract" |
{ type: "json", prompt, schema } |
| Screenshot Format | Sederhana | { type: "screenshot", fullPage, quality, viewport } |
| Search Sources | Web saja | "web", "news", "images" |
| Crawl Prompt | Tidak ada | ✅ Natural language prompt dengan /crawl/params-preview |
Perubahan Nama Method (SDK)
JavaScript/TypeScript:
| v1 (FirecrawlApp) | v2 (Firecrawl) |
|---|---|
scrapeUrl(url, ...) |
scrape(url, options?) |
search(query, ...) |
search(query, options?) |
mapUrl(url, ...) |
map(url, options?) |
crawlUrl(url, ...) |
crawl(url, options?) |
asyncCrawlUrl(...) |
startCrawl(url, options?) |
checkCrawlStatus(id) |
getCrawlStatus(id) |
Python:
| v1 | v2 |
|---|---|
scrape_url(...) |
scrape(...) |
map_url(...) |
map(...) |
crawl_url(...) |
crawl(...) |
async_crawl_url(...) |
start_crawl(...) |
check_crawl_status(...) |
get_crawl_status(...) |
Perubahan Crawl Options
| v1 | v2 |
|---|---|
allowBackwardCrawling |
Gunakan crawlEntireDomain |
maxDepth |
Gunakan maxDiscoveryDepth |
ignoreSitemap (bool) |
`sitemap: "only" |
| - | ✅ prompt (natural language) |
2️⃣ Cara Akses API Firecrawl
A. API Firecrawl Cloud
Setup:
- Daftar di firecrawl.dev
- Dapatkan API key dari dashboard
- Gunakan base URL:
https://api.firecrawl.dev/v2/
Contoh Penggunaan (Python):
# Install
pip install firecrawl-py
# Kode
from firecrawl import Firecrawl
firecrawl = Firecrawl(api_key="fc-YOUR-API-KEY")
# Scrape single URL
doc = firecrawl.scrape(
"https://firecrawl.dev",
formats=["markdown", "html"],
)
# Crawl website
response = firecrawl.crawl(
"https://firecrawl.dev",
limit=100,
scrape_options={"formats": ["markdown", "html"]},
)
Contoh Penggunaan (JavaScript):
import Firecrawl from '@mendable/firecrawl-js';
const firecrawl = new Firecrawl({ apiKey: 'fc-YOUR-API-KEY' });
const doc = await firecrawl.scrape('https://firecrawl.dev', {
formats: ['markdown', 'html'],
});
Contoh HTTP Request (cURL):
curl -X POST https://api.firecrawl.dev/v2/scrape \
-H "Authorization: Bearer fc-YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://firecrawl.dev",
"formats": ["markdown", "html"]
}'
B. API Self-Hosted
Installation dengan Docker:
# Clone repository
git clone https://github.com/firecrawl/firecrawl.git
cd firecrawl
# Copy env file
cp apps/api/.env.example .env
# Edit .env - basic setup:
# USE_DB_AUTHENTICATION=false
# TEST_API_KEY=fc-my-firecrawl-key
# Build dan run
docker compose build
docker compose up -d
Akses API:
- Base URL:
http://localhost:3002 - Gunakan
TEST_API_KEYdari file.env - Semua endpoint v2 tersedia
Contoh ke API self-hosted:
curl -X POST http://localhost:3002/v2/scrape \
-H "Authorization: Bearer fc-my-firecrawl-key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"formats": ["markdown"]
}'
3️⃣ Cara Akses MCP (Model Context Protocol)
Apa itu Firecrawl MCP?
Firecrawl MCP adalah server MCP yang memungkinkan AI model (seperti Claude, Cursor, ChatGPT) mengakses kemampuan web scraping Firecrawl melalui protokol JSON-RPC 2.0 yang distandarisasi oleh Anthropic.
Installation & Setup
Prerequisites:
- Node.js dan npm
- Firecrawl API key
- MCP-compatible environment (Claude Desktop, Cursor IDE, dsb.)
Install MCP Server:
# Option 1: Jalankan langsung
FIRECRAWL_API_KEY=fc-yourkeyhere npx -y firecrawl-mcp
# Option 2: Install globally
npm install -g firecrawl-mcp
firecrawl-mcp
Environment Variables:
| Variable | Required | Description |
|---|---|---|
FIRECRAWL_API_KEY |
Yes | API key Firecrawl |
FIRECRAWL_API_URL |
Optional | Custom endpoint untuk self-hosted (misal: https://firecrawl.yourdomain.com) |
Setup di Cursor IDE
- Buka Cursor Settings
- Navigasi ke Features → MCP Servers
- Klik "+ Add New MCP Server"
- Masukkan konfigurasi:
- Name:
firecrawl-mcp - Type:
command - Command:
env FIRECRAWL_API_KEY=fc-your-api-key npx -y firecrawl-mcp
- Name:
Setup di Claude Desktop
Tambahkan ke file konfigurasi Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"firecrawl": {
"command": "npx",
"args": ["-y", "firecrawl-mcp"],
"env": {
"FIRECRAWL_API_KEY": "fc-your-api-key"
}
}
}
}
Penggunaan MCP
Setelah terhubung, Anda dapat:
- Meminta AI untuk mengambil konten dari website tertentu
- Extract structured data dari web pages
- Cari web content yang dirender dengan JavaScript
Contoh prompt di Claude/Cursor:
"Ambil judul dan konten utama dari halaman https://firecrawl.dev"
MCP server akan menangani rendering JavaScript, ekstraksi, dan mengembalikan data dalam format JSON yang siap untuk LLM.
📚 Ringkasan Singkat
| Topik | v1 | v2 |
|---|---|---|
| API URL | /v1/ |
/v2/ |
| SDK Class | FirecrawlApp |
Firecrawl |
| Methods | scrapeUrl(), mapUrl() |
scrape(), map() |
| Caching | Manual | Default 2 hari |
| Formats | markdown, html |
+ summary, json, screenshot objek |
| Crawl Options | maxDepth |
maxDiscoveryDepth, prompt |
Resources Tambahan:
Comments ()