Skip to content

Scrape

Core Feature

Extract 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

FormatDescriptionExtra Cost
markdownClean LLM-ready textIncluded
htmlCleaned HTMLIncluded
rawHtmlUnmodified source HTMLIncluded
summaryAI-generated summaryIncluded
screenshotVisual capture (full page, quality, viewport options)Included
linksAll page linksIncluded
imagesAll image URLsIncluded
brandingFull brand identity/design system extractionIncluded
jsonStructured LLM extraction with schema+4 credits
changeTrackingDetect changes vs previous scrapeSee 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 URLs

JSON 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 rawHtml format + parse client-side
  • Use executeJavascript action 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

TypeDescription
waitWait for milliseconds
screenshotTake screenshot (supports full_page)
scrollScroll the page
scrapeScrape at current state
clickClick an element by CSS selector
writeType text into focused element
pressPress a keyboard key
executeJavascriptRun custom JS on the page
generatePDFGenerate 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

MethodPathDescription
POST/v2/batch/scrapeStart batch scrape
GET/v2/batch/scrape/{id}Get batch status
DELETE/v2/batch/scrape/{id}Cancel batch scrape
GET/v2/batch/scrape/{id}/errorsGet batch errors

Cost

OperationCredits
Basic scrape1 per page
JSON mode+4 per page
Enhanced proxy+4 per page
PDF parsing+1 per PDF page
ScreenshotIncluded
BrandingIncluded

Next: Search →