From firecrawl-pack
Create a minimal working Firecrawl example that scrapes a page to markdown. Use when starting a new Firecrawl integration, testing your setup, or learning the scrape/crawl/map/extract API surface. Trigger with phrases like "firecrawl hello world", "firecrawl example", "firecrawl quick start", "simple firecrawl code".
npx claudepluginhub flight505/skill-forge --plugin firecrawl-packThis skill is limited to using the following tools:
Four minimal examples covering Firecrawl's core endpoints: **scrape** (single page), **crawl** (multi-page), **map** (URL discovery), and **extract** (LLM structured data). Each is a standalone snippet you can run immediately.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Four minimal examples covering Firecrawl's core endpoints: scrape (single page), crawl (multi-page), map (URL discovery), and extract (LLM structured data). Each is a standalone snippet you can run immediately.
@mendable/firecrawl-js installed (npm install @mendable/firecrawl-js)FIRECRAWL_API_KEY environment variable setimport FirecrawlApp from "@mendable/firecrawl-js";
const firecrawl = new FirecrawlApp({
apiKey: process.env.FIRECRAWL_API_KEY!,
});
// Scrape one page — returns markdown, HTML, metadata, links
const result = await firecrawl.scrapeUrl("https://docs.firecrawl.dev", {
formats: ["markdown"],
});
console.log("Title:", result.metadata?.title);
console.log("Markdown:", result.markdown?.substring(0, 500));
// Crawl a site recursively — follows links, respects robots.txt
const crawlResult = await firecrawl.crawlUrl("https://docs.firecrawl.dev", {
limit: 10, // max 10 pages (saves credits)
scrapeOptions: {
formats: ["markdown"],
},
});
console.log(`Crawled ${crawlResult.data?.length} pages`);
for (const page of crawlResult.data || []) {
console.log(` ${page.metadata?.title} — ${page.metadata?.sourceURL}`);
}
// Discover all URLs on a site in ~2-3 seconds (uses sitemap + SERP)
const mapResult = await firecrawl.mapUrl("https://docs.firecrawl.dev");
console.log(`Found ${mapResult.links?.length} URLs`);
mapResult.links?.slice(0, 10).forEach(url => console.log(` ${url}`));
// Extract structured data from a page using an LLM + JSON schema
const extracted = await firecrawl.scrapeUrl("https://firecrawl.dev/pricing", {
formats: ["extract"],
extract: {
schema: {
type: "object",
properties: {
plans: {
type: "array",
items: {
type: "object",
properties: {
name: { type: "string" },
price: { type: "string" },
credits: { type: "number" },
},
},
},
},
},
},
});
console.log("Pricing plans:", JSON.stringify(extracted.extract, null, 2));
| Error | Cause | Solution |
|---|---|---|
Cannot find module | SDK not installed | npm install @mendable/firecrawl-js |
401 Unauthorized | Missing or invalid API key | Check FIRECRAWL_API_KEY env var |
429 Too Many Requests | Rate limit exceeded | Wait and retry with backoff |
Empty markdown | JS-heavy page not rendered | Add waitFor: 5000 to scrape options |
402 Payment Required | Credits exhausted | Check balance at firecrawl.dev/app |
from firecrawl import FirecrawlApp
firecrawl = FirecrawlApp(api_key="fc-YOUR_API_KEY")
# Scrape
result = firecrawl.scrape_url("https://example.com", params={
"formats": ["markdown"]
})
print(result["markdown"][:500])
# Map
urls = firecrawl.map_url("https://example.com")
print(f"Found {len(urls.get('links', []))} URLs")
// Scrape many URLs at once — more efficient than individual scrapes
const batchResult = await firecrawl.batchScrapeUrls(
[
"https://docs.firecrawl.dev/features/scrape",
"https://docs.firecrawl.dev/features/crawl",
"https://docs.firecrawl.dev/features/extract",
],
{ formats: ["markdown"] }
);
for (const page of batchResult.data || []) {
console.log(`${page.metadata?.title}: ${page.markdown?.length} chars`);
}
Proceed to firecrawl-local-dev-loop for development workflow setup.