Appearance
Usage
Python: scrape a single page
python
from firecrawl import Firecrawl
firecrawl = Firecrawl(api_key="fc-YOUR_API_KEY")
doc = firecrawl.scrape("https://firecrawl.dev", formats=["markdown"])
print(doc)The formats parameter accepts "markdown", "html", "screenshot", or "json". When omitted, markdown is the default.
Python: crawl an entire site
python
from firecrawl import Firecrawl
firecrawl = Firecrawl(api_key="fc-YOUR_API_KEY")
result = firecrawl.crawl(
"https://docs.firecrawl.dev",
limit=10, # max pages to crawl
formats=["markdown"]
)
for page in result.data:
print(page["metadata"]["url"])
print(page["markdown"][:200])Node.js: scrape a single page
javascript
import { Firecrawl } from 'firecrawl';
const firecrawl = new Firecrawl({ apiKey: 'fc-YOUR_API_KEY' });
const doc = await firecrawl.scrape('https://firecrawl.dev', {
formats: ['markdown'],
});
console.log(doc.markdown);CLI: scrape from the terminal
bash
firecrawl https://firecrawl.devReturns the page as markdown to stdout. Pipe into any downstream tool or file.
REST API
bash
curl -X POST https://api.firecrawl.dev/v1/scrape \
-H "Authorization: Bearer fc-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://firecrawl.dev", "formats": ["markdown"]}'Credit costs at a glance
| Operation | Credits consumed |
|---|---|
| Scrape (1 page) | 1 credit |
| Crawl (per page) | 1 credit |
| Map (per URL) | 1 credit |
| Search (per 10 results) | 2 credits |
| Interact (per browser minute) | 2 credits |
The free tier provides 1,000 credits per month with no rollover.