Appearance
Scrape
Core FeatureExtract clean data from any single URL in multiple formats. Handles JavaScript, proxies, rate limits, and caching automatically.
Overview
The Scrape endpoint converts any web page into clean, LLM-ready output. One credit per page, with optional add-ons for JSON extraction, enhanced proxy, and more.
Formats Available
| Format | Description | Extra Cost |
|---|---|---|
markdown | Clean LLM-ready text | Included |
html | Cleaned HTML | Included |
rawHtml | Unmodified source HTML | Included |
summary | AI-generated summary | Included |
screenshot | Visual capture (full page, quality, viewport options) | Included |
links | All page links | Included |
images | All image URLs | Included |
branding | Full brand identity/design system extraction | Included |
json | Structured LLM extraction with schema | +4 credits |
changeTracking | Detect changes vs previous scrape | See Change Tracking |
Basic Usage
python
from firecrawl import Firecrawl
firecrawl = Firecrawl(api_key="fc-YOUR-API-KEY")
# Simple scrape — returns markdown by default
result = firecrawl.scrape("https://example.com")
print(result['markdown'])javascript
import Firecrawl from '@mendable/firecrawl-js';
const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });
const doc = await firecrawl.scrape("https://example.com", {
formats: ["markdown", "html"]
});
console.log(doc.markdown);Multiple Formats
python
result = firecrawl.scrape(
"https://example.com",
formats=["markdown", "html", "screenshot", "links", "images"]
)
print(result['markdown'])
print(result['html'])
print(result['screenshot']) # screenshot URL
print(result['links']) # array of links
print(result['images']) # array of image URLsJSON Extraction (Schema-Based)
Extract structured data with a Pydantic model or JSON schema. In v2, the schema is embedded inside the format object:
python
from pydantic import BaseModel
class CompanyInfo(BaseModel):
company_mission: str
supports_sso: bool
is_open_source: bool
is_in_yc: bool
result = firecrawl.scrape(
"https://firecrawl.dev",
formats=[{"type": "json", "schema": CompanyInfo.model_json_schema()}],
only_main_content=False,
timeout=120000
)
print(result['json'])v2 Format Change
In v2, use formats: [{"type": "json", "schema": {...}}]. The old v1 jsonOptions parameter no longer exists.
Prompt-Only Extraction (No Schema)
python
result = firecrawl.scrape(
"https://firecrawl.dev",
formats=[{"type": "json", "prompt": "Extract the company mission from the page."}],
only_main_content=False
)JSON Extraction Limitation
JSON extraction works on the markdown conversion — HTML attributes (data-id, custom attributes) are stripped and cannot be extracted. Workarounds:
- Use
rawHtmlformat + parse client-side - Use
executeJavascriptaction to inject attribute values into visible text first
Branding Format
Extract a complete design system from any website:
python
result = firecrawl.scrape(
url="https://firecrawl.dev",
formats=["branding"]
)
print(result['branding'])Returns: colorScheme, logo, colors (primary/secondary/accent/background/text), fonts, typography (fontFamilies/fontSizes/fontWeights/lineHeights), spacing, components (buttonPrimary/buttonSecondary/input), icons, images, animations, layout, personality.
Page Actions (Browser Interaction)
Interact with the page before scraping:
python
result = firecrawl.scrape(
url="https://example.com/login",
formats=["markdown"],
actions=[
{"type": "write", "text": "john@example.com"},
{"type": "press", "key": "Tab"},
{"type": "write", "text": "secret"},
{"type": "click", "selector": 'button[type="submit"]'},
{"type": "wait", "milliseconds": 1500},
{"type": "screenshot", "full_page": True},
],
)Action Types
| Type | Description |
|---|---|
wait | Wait for milliseconds |
screenshot | Take screenshot (supports full_page) |
scroll | Scroll the page |
scrape | Scrape at current state |
click | Click an element by CSS selector |
write | Type text into focused element |
press | Press a keyboard key |
executeJavascript | Run custom JS on the page |
generatePDF | Generate a PDF of the page |
Caching (maxAge)
Default cache window is 2 days (172800000ms) — up to 5x faster scrapes:
python
# Use cache if less than 2 days old (default behavior)
result = firecrawl.scrape("https://example.com")
# Use cache if less than 10 minutes old
result = firecrawl.scrape("https://example.com", max_age=600000)
# Always get fresh content
result = firecrawl.scrape("https://example.com", max_age=0)
# Opt out of storing in cache
result = firecrawl.scrape("https://example.com", store_in_cache=False)Location & Language
python
result = firecrawl.scrape(
"https://example.com",
location={"country": "DE", "languages": ["de"]}
)Country defaults to US. Uses ISO 3166-1 alpha-2 codes.
Batch Scrape
Scrape multiple URLs in one operation:
python
job = firecrawl.batch_scrape(
[
"https://firecrawl.dev",
"https://docs.firecrawl.dev",
],
formats=["markdown"],
poll_interval=2,
wait_timeout=120
)Async Batch
python
job = firecrawl.start_batch_scrape(["https://example.com", "https://example.org"])
status = firecrawl.get_batch_scrape_status(job.id)Batch scrape jobs expire after 24 hours.
Batch Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /v2/batch/scrape | Start batch scrape |
| GET | /v2/batch/scrape/{id} | Get batch status |
| DELETE | /v2/batch/scrape/{id} | Cancel batch scrape |
| GET | /v2/batch/scrape/{id}/errors | Get batch errors |
Cost
| Operation | Credits |
|---|---|
| Basic scrape | 1 per page |
| JSON mode | +4 per page |
| Enhanced proxy | +4 per page |
| PDF parsing | +1 per PDF page |
| Screenshot | Included |
| Branding | Included |
Next: Search →