Skip to content

Parse (Local Files)

New

Upload local files directly and parse them into clean markdown. Use when the source document is a local file or not publicly accessible by URL. For documents available via a public URL, use the Scrape endpoint instead.

Overview

The /v2/parse endpoint accepts file uploads via multipart/form-data and processes them through Firecrawl's Rust-based parsing engine — up to 5x faster than URL-based document scraping. Supports PDF, DOCX, HTML, Excel, and more, with optional OCR, tag filtering, and zero data retention.

Endpoint

POST /v2/parse
Content-Type: multipart/form-data
Authorization: Bearer fc-YOUR-API-KEY

Supported File Types

ExtensionFormatMax Size
.pdfPDF document50 MB
.docx, .docMicrosoft Word50 MB
.odtOpenDocument Text50 MB
.rtfRich Text Format50 MB
.xlsx, .xlsMicrosoft Excel50 MB
.html, .htmHTML document50 MB

Request Fields

Required

FieldTypeDescription
filebinaryThe file to parse. Sent as a form-data field.

Optional options Object (JSON)

Pass as a JSON-encoded string in the options form field.

OptionTypeDefaultDescription
formatsarray[{type: "markdown"}]Output types: markdown, summary, html, rawHtml, links, images, json
onlyMainContentbooleantrueExclude headers, navbars, and footers
includeTagsarrayOnly include these HTML tags in output
excludeTagsarrayStrip these HTML tags from output
timeoutinteger30000Timeout in milliseconds (max: 300000)
parsersarray[{type: "pdf"}]PDF parser config — see PDF Modes
removeBase64ImagesbooleantrueStrip base64-encoded images from output
blockAdsbooleantrueBlock ads and popups
skipTlsVerificationbooleantrueSkip TLS certificate verification
proxystring"basic" or "auto"
zeroDataRetentionbooleanfalseDo not store file or output data after response

PDF Modes

Configure the parsers option to control how PDFs are processed:

ModeDescriptionUse When
autoFast extraction first, falls back to OCR if neededDefault — works for most PDFs
fastText-only extraction, skips scanned pagesDigital-native PDFs with selectable text
ocrForces full OCR on every pageScanned documents, image-heavy PDFs
json
"parsers": [{ "type": "pdf", "mode": "ocr", "maxPages": 20 }]

maxPages accepts 1–10000. Omit to process the entire document.

Examples

cURL

bash
# Basic parse — returns markdown
curl -X POST 'https://api.firecrawl.dev/v2/parse' \
  -H 'Authorization: Bearer fc-YOUR-API-KEY' \
  -F 'file=@/path/to/document.pdf'
bash
# With options — OCR mode, zero data retention
curl -X POST 'https://api.firecrawl.dev/v2/parse' \
  -H 'Authorization: Bearer fc-YOUR-API-KEY' \
  -F 'file=@/path/to/scanned-contract.pdf' \
  -F 'options={"parsers":[{"type":"pdf","mode":"ocr","maxPages":50}],"zeroDataRetention":true}'
bash
# Request summary output as well
curl -X POST 'https://api.firecrawl.dev/v2/parse' \
  -H 'Authorization: Bearer fc-YOUR-API-KEY' \
  -F 'file=@/path/to/report.docx' \
  -F 'options={"formats":[{"type":"markdown"},{"type":"summary"}]}'

Python

python
import requests

api_key = "fc-YOUR-API-KEY"
url = "https://api.firecrawl.dev/v2/parse"

# Basic parse
with open("/path/to/document.pdf", "rb") as f:
    response = requests.post(
        url,
        headers={"Authorization": f"Bearer {api_key}"},
        files={"file": f}
    )

data = response.json()
print(data["data"]["markdown"])
python
import requests
import json

api_key = "fc-YOUR-API-KEY"
url = "https://api.firecrawl.dev/v2/parse"

options = {
    "parsers": [{"type": "pdf", "mode": "ocr", "maxPages": 100}],
    "formats": [{"type": "markdown"}, {"type": "summary"}],
    "zeroDataRetention": True
}

with open("/path/to/scanned-invoice.pdf", "rb") as f:
    response = requests.post(
        url,
        headers={"Authorization": f"Bearer {api_key}"},
        files={"file": f},
        data={"options": json.dumps(options)}
    )

result = response.json()
print(result["data"]["markdown"])
print(result["data"]["summary"])

Node.js

javascript
import fs from 'fs';
import FormData from 'form-data';
import fetch from 'node-fetch';

const apiKey = 'fc-YOUR-API-KEY';

// Basic parse
const form = new FormData();
form.append('file', fs.createReadStream('/path/to/document.pdf'));

const response = await fetch('https://api.firecrawl.dev/v2/parse', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    ...form.getHeaders()
  },
  body: form
});

const data = await response.json();
console.log(data.data.markdown);
javascript
import fs from 'fs';
import FormData from 'form-data';
import fetch from 'node-fetch';

const apiKey = 'fc-YOUR-API-KEY';

// With OCR options
const options = {
  parsers: [{ type: 'pdf', mode: 'ocr', maxPages: 50 }],
  zeroDataRetention: true
};

const form = new FormData();
form.append('file', fs.createReadStream('/path/to/scanned-doc.pdf'));
form.append('options', JSON.stringify(options));

const response = await fetch('https://api.firecrawl.dev/v2/parse', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    ...form.getHeaders()
  },
  body: form
});

const data = await response.json();
console.log(data.data.markdown);

Response

200 Success

json
{
  "success": true,
  "data": {
    "markdown": "string",
    "summary": "string (if requested)",
    "html": "string (if requested)",
    "rawHtml": "string (if requested)",
    "links": ["string array (if requested)"],
    "metadata": {
      "title": "string or array",
      "description": "string or array",
      "language": "string or array",
      "sourceURL": "uri",
      "url": "uri",
      "keywords": "string or array",
      "statusCode": 200,
      "contentType": "string",
      "error": null
    }
  }
}

Error Codes

CodeMeaning
400Bad request — invalid file type, missing file field, or malformed options
402Payment required — insufficient credits
429Rate limited
500Server error

Key Capabilities

  • 5x faster — Rust-based parsing engine vs standard document scraping
  • Up to 50 MB per file
  • Zero data retention — set zeroDataRetention: true to prevent any storage of uploaded content or output
  • OCR support — full optical character recognition for scanned documents
  • Works offline — does not require the document to be publicly accessible

When to Use Parse vs Scrape

ScenarioUse
Document is a public URLScrape
Document is a local fileParse (/v2/parse)
Document requires login to accessParse (download first, then upload)
Need to parse many documents at onceParse in a loop (one request per file)

Next: Document Parsing →