Optimize Firecrawl scraping performance with caching, batch scraping, and format selection.
Use when experiencing slow scrapes, optimizing credit usage per page,
or building high-throughput scraping pipelines.
Trigger with phrases like "firecrawl performance", "optimize firecrawl",
"firecrawl latency", "firecrawl caching", "firecrawl slow", "firecrawl batch".
Optimize Firecrawl scraping performance with caching, batch scraping, and format selection.
Use when experiencing slow scrapes, optimizing credit usage per page,
or building high-throughput scraping pipelines.
Trigger with phrases like "firecrawl performance", "optimize firecrawl",
"firecrawl latency", "firecrawl caching", "firecrawl slow", "firecrawl batch".
allowed-tools
Read, Write, Edit
version
1.11.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
["saas","firecrawl","api","performance"]
compatibility
Designed for Claude Code, also compatible with Codex and OpenClaw
Firecrawl Performance Tuning
Overview
Optimize Firecrawl API performance by choosing efficient scraping modes, caching results, using batch endpoints, and minimizing unnecessary rendering. Key levers: format selection (markdown vs HTML vs screenshot), waitFor tuning, onlyMainContent, and batch vs individual scraping.
Latency Benchmarks
Operation
Typical
With JS Wait
With Screenshot
scrapeUrl (markdown)
2-5s
5-10s
8-15s
scrapeUrl (extract)
3-8s
8-15s
N/A
crawlUrl (10 pages)
20-40s
40-80s
N/A
mapUrl
1-3s
N/A
N/A
batchScrapeUrls (10)
10-20s
20-40s
N/A
Instructions
Step 1: Minimize Formats (Biggest Win)
importFirecrawlAppfrom"@mendable/firecrawl-js";
const firecrawl = newFirecrawlApp({
apiKey: process.env.FIRECRAWL_API_KEY!,
});
// SLOW: requesting everythingconst slow = await firecrawl.scrapeUrl(url, {
formats: ["markdown", "html", "links", "screenshot"],
// screenshot + full HTML = 3-5x slower
});
// FAST: request only what you needconst fast = await firecrawl.scrapeUrl(url, {
formats: ["markdown"],
: ,
});
// markdown only = fastest
onlyMainContent
true
// skip nav/footer/sidebar
Step 2: Tune waitFor for JS-Heavy Pages
// Default: no JS wait (fastest, works for static sites)const staticResult = await firecrawl.scrapeUrl("https://docs.example.com", {
formats: ["markdown"],
// No waitFor needed — content is in initial HTML
});
// SPA/dynamic pages: add minimal waitconst spaResult = await firecrawl.scrapeUrl("https://app.example.com", {
formats: ["markdown"],
waitFor: 3000, // 3s — enough for most SPAsonlyMainContent: true,
});
// Heavy interactive page: use actions instead of long waitconst heavyResult = await firecrawl.scrapeUrl("https://dashboard.example.com", {
formats: ["markdown"],
actions: [
{ type: "wait", selector: ".data-table" }, // wait for specific element
{ type: "scroll", direction: "down" }, // trigger lazy loading
],
});