firecrawl-scraper
Original:🇺🇸 English
Translated
1 scriptsChecked / no sensitive code detected
Web scraping skill using Firecrawl API for deep content extraction, format conversion, and page interaction. Use when you need to scrape web pages, extract structured data, take screenshots, parse PDFs, or crawl entire websites. Triggers: firecrawl, scrape, extract content, screenshot, parse pdf, crawl website, 抓取网页, 提取内容, 网页截图
26installs
Added on
NPX Install
npx skill4agent add benedictking/firecrawl-scraper firecrawl-scraperTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Firecrawl Scraper Skill
Trigger Conditions & Endpoint Selection
Choose Firecrawl endpoint based on user intent:
- scrape: Need to extract content from a single web page (markdown, html, json, screenshot, pdf)
- crawl: Need to crawl entire website with depth control and path filtering
- map: Need to quickly get a list of all URLs on a website
- batch-scrape: Need to scrape multiple URLs in parallel
- crawl-status: Given crawl job ID, check crawl progress/results (optional )
--wait
Recommended Architecture (Main Skill + Sub-skill)
This skill uses a two-phase architecture:
- Main skill (current context): Understand user question → Choose endpoint → Assemble JSON payload
- Sub-skill (fork context): Only responsible for HTTP call execution, avoiding conversation history token waste
Execution Method
Use Task tool to invoke sub-skill, passing command and JSON (stdin):
firecrawl-fetcherTask parameters:
- subagent_type: Bash
- description: "Call Firecrawl API"
- prompt: cat <<'JSON' | node .claude/skills/firecrawl-scraper/firecrawl-api.js <scrape|crawl|map|batch-scrape|crawl-status> [--wait]
{ ...payload... }
JSONPayload Examples
1) Scrape Single Page
bash
cat <<'JSON' | node .claude/skills/firecrawl-scraper/firecrawl-api.js scrape
{
"url": "https://example.com",
"formats": ["markdown", "links"],
"onlyMainContent": true,
"includeTags": [],
"excludeTags": ["nav", "footer"],
"waitFor": 0,
"timeout": 30000
}
JSONAvailable formats:
- ,
"markdown","html","rawHtml","links","images""summary" {"type": "json", "prompt": "Extract product info", "schema": {...}}{"type": "screenshot", "fullPage": true, "quality": 85}
2) Scrape with Actions (Page Interaction)
bash
cat <<'JSON' | node .claude/skills/firecrawl-scraper/firecrawl-api.js scrape
{
"url": "https://example.com",
"formats": ["markdown"],
"actions": [
{"type": "wait", "milliseconds": 2000},
{"type": "click", "selector": "#load-more"},
{"type": "wait", "milliseconds": 1000},
{"type": "scroll", "direction": "down", "amount": 500}
]
}
JSONAvailable actions:
- ,
wait,click,write,press,scroll,screenshot,scrapeexecuteJavascript
3) Parse PDF
bash
cat <<'JSON' | node .claude/skills/firecrawl-scraper/firecrawl-api.js scrape
{
"url": "https://example.com/document.pdf",
"formats": ["markdown"],
"parsers": ["pdf"]
}
JSON4) Extract Structured JSON
bash
cat <<'JSON' | node .claude/skills/firecrawl-scraper/firecrawl-api.js scrape
{
"url": "https://example.com/product",
"formats": [
{
"type": "json",
"prompt": "Extract product information",
"schema": {
"type": "object",
"properties": {
"name": {"type": "string"},
"price": {"type": "number"},
"description": {"type": "string"}
},
"required": ["name", "price"]
}
}
]
}
JSON5) Crawl Entire Website
bash
cat <<'JSON' | node .claude/skills/firecrawl-scraper/firecrawl-api.js crawl
{
"url": "https://docs.example.com",
"formats": ["markdown"],
"includePaths": ["^/docs/.*"],
"excludePaths": ["^/blog/.*"],
"maxDiscoveryDepth": 3,
"limit": 100,
"allowExternalLinks": false,
"allowSubdomains": false
}
JSON5.1) Crawl + Wait for Completion
bash
cat <<'JSON' | node .claude/skills/firecrawl-scraper/firecrawl-api.js crawl --wait
{
"url": "https://docs.example.com",
"formats": ["markdown"],
"limit": 100
}
JSON6) Map Website URLs
bash
cat <<'JSON' | node .claude/skills/firecrawl-scraper/firecrawl-api.js map
{
"url": "https://example.com",
"search": "documentation",
"limit": 5000
}
JSON7) Batch Scrape Multiple URLs
bash
cat <<'JSON' | node .claude/skills/firecrawl-scraper/firecrawl-api.js batch-scrape
{
"urls": [
"https://example.com/page1",
"https://example.com/page2",
"https://example.com/page3"
],
"formats": ["markdown"]
}
JSON8) Check Crawl Status
bash
node .claude/skills/firecrawl-scraper/firecrawl-api.js crawl-status <crawl-id>Wait for completion:
bash
node .claude/skills/firecrawl-scraper/firecrawl-api.js crawl-status <crawl-id> --waitKey Features
Formats
- markdown: Clean markdown content
- html: Parsed HTML
- rawHtml: Original HTML
- links: All links on page
- images: All images on page
- summary: AI-generated summary
- json: Structured data extraction with schema
- screenshot: Page screenshot (PNG)
Content Control
- : Extract only main content (default: true)
onlyMainContent - : CSS selectors to include
includeTags - : CSS selectors to exclude
excludeTags - : Wait time before scraping (ms)
waitFor - : Cache duration (default: 48 hours)
maxAge
Actions (Browser Automation)
- : Wait for specified time
wait - : Click element by selector
click - : Input text into field
write - : Press keyboard key
press - : Scroll page
scroll - : Run custom JS
executeJavascript
Crawl Options
- : Regex patterns to include
includePaths - : Regex patterns to exclude
excludePaths - : Maximum crawl depth
maxDiscoveryDepth - : Maximum pages to crawl
limit - : Follow external links
allowExternalLinks - : Follow subdomains
allowSubdomains
Environment Variables & API Key
Two ways to configure API Key (priority: environment variable > ):
.env- Environment variable:
FIRECRAWL_API_KEY - file: Place in
.env, can copy from.claude/skills/firecrawl-scraper/.env.env.example
Response Format
All endpoints return JSON with:
- : Boolean indicating success
success - : Extracted content (format depends on endpoint)
data - For crawl: Returns job ID, use (or GET /v2/crawl/{id}) to check status
crawl-status