Appearance
Parse (Local Files)
NewUpload 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-KEYSupported File Types
| Extension | Format | Max Size |
|---|---|---|
.pdf | PDF document | 50 MB |
.docx, .doc | Microsoft Word | 50 MB |
.odt | OpenDocument Text | 50 MB |
.rtf | Rich Text Format | 50 MB |
.xlsx, .xls | Microsoft Excel | 50 MB |
.html, .htm | HTML document | 50 MB |
Request Fields
Required
| Field | Type | Description |
|---|---|---|
file | binary | The file to parse. Sent as a form-data field. |
Optional options Object (JSON)
Pass as a JSON-encoded string in the options form field.
| Option | Type | Default | Description |
|---|---|---|---|
formats | array | [{type: "markdown"}] | Output types: markdown, summary, html, rawHtml, links, images, json |
onlyMainContent | boolean | true | Exclude headers, navbars, and footers |
includeTags | array | — | Only include these HTML tags in output |
excludeTags | array | — | Strip these HTML tags from output |
timeout | integer | 30000 | Timeout in milliseconds (max: 300000) |
parsers | array | [{type: "pdf"}] | PDF parser config — see PDF Modes |
removeBase64Images | boolean | true | Strip base64-encoded images from output |
blockAds | boolean | true | Block ads and popups |
skipTlsVerification | boolean | true | Skip TLS certificate verification |
proxy | string | — | "basic" or "auto" |
zeroDataRetention | boolean | false | Do not store file or output data after response |
PDF Modes
Configure the parsers option to control how PDFs are processed:
| Mode | Description | Use When |
|---|---|---|
auto | Fast extraction first, falls back to OCR if needed | Default — works for most PDFs |
fast | Text-only extraction, skips scanned pages | Digital-native PDFs with selectable text |
ocr | Forces full OCR on every page | Scanned 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
| Code | Meaning |
|---|---|
| 400 | Bad request — invalid file type, missing file field, or malformed options |
| 402 | Payment required — insufficient credits |
| 429 | Rate limited |
| 500 | Server error |
Key Capabilities
- 5x faster — Rust-based parsing engine vs standard document scraping
- Up to 50 MB per file
- Zero data retention — set
zeroDataRetention: trueto 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
| Scenario | Use |
|---|---|
| Document is a public URL | Scrape |
| Document is a local file | Parse (/v2/parse) |
| Document requires login to access | Parse (download first, then upload) |
| Need to parse many documents at once | Parse in a loop (one request per file) |
Next: Document Parsing →