Agent Stack · Tool/System
Firecrawl Document Parsing
Firecrawl provides automated document parsing capabilities that convert various file formats (PDFs, Excel spreadsheets, Word documents) into clean, structured markdown. The service detects file types automatically from URLs and processes them without requiring separate upload steps. This is particularly useful for extracting structured data from business documents, reports, and spreadsheets as part of automated scrap…
wiki/wiki/julius/firecrawl-document-parsing.mdAnswer
Firecrawl provides automated document parsing capabilities that convert various file formats (PDFs, Excel spreadsheets, Word documents) into clean, structured markdown. The service detects file types automatically from URLs and processes them without requiring separate upload steps. This is particularly useful for extracting structured data from business documents, reports, and spreadsheets as part of automated scrap…
Auto-generated neutral summary from the source page — needs human review before trusted use.
Evidence & Source Cards
https://docs.firecrawl.dev/features/document-parsingexternal/unverifiedhttps://firecrawl.dev/pricingexternal/unverifiedhttps://docs.firecrawl.dev/api-reference/v2-introductionexternal/unverifiedhttps://github.com/firecrawl/firecrawlexternal/unverifiedSource Excerpt
Overview
Firecrawl provides automated document parsing capabilities that convert various file formats (PDFs, Excel spreadsheets, Word documents) into clean, structured markdown. The service detects file types automatically from URLs and processes them without requiring separate upload steps. This is particularly useful for extracting structured data from business documents, reports, and spreadsheets as part of automated scraping workflows.
Why it matters: Instead of building custom parsers for each document format, agents can use Firecrawl's unified API to extract markdown from any supported file type, enabling consistent downstream processing by Large Language Models.
Technical Specifications
Supported Document Formats
Verified: Firecrawl supports three major document categories:
| Format | Extensions | Output Structure | Notes |
|---|---|---|---|
| Excel Spreadsheets | .xlsx, .xls | Each worksheet → HTML table, separated by H2 headings with sheet name | Preserves cell formatting and data types |
| Word Documents | .docx, .doc, .odt, .rtf | Extracts text with document structure (headings, paragraphs, lists, tables) | Maintains basic formatting and styling |
| PDF Documents | Text content with layout information, sections, paragraphs | Supports both text-based and scanned PDFs via OCR |
PDF Parsing Modes
Verified: Three parsing strategies available for PDFs:
| Mode | Description | Speed | Best For | Credit Cost |
|---|---|---|---|---|
auto (default) | Attempts fast text extraction first, falls back to OCR if needed | Fast | Most documents; handles mixed content | 1 credit/page |
fast | Text-only extraction from embedded text layer | Fastest | Born-digital PDFs with selectable text | 1 credit/page |
ocr | Forces OCR on every page | Slowest | Scanned documents, image-heavy PDFs, when auto misclassifies | 1 credit/page |
Configuration syntax:
// Object syntax with explicit mode
parsers: [{ type: "pdf", mode: "ocr", maxPages: 20 }]
// Default (auto mode)
parsers: [{ type: "pdf" }]
Pricing
Verified: Document parsing is priced at 1 credit per page for PDFs. Excel and Word document pricing follows standard scraping credits (verify current rates in Firecrawl pricing documentation).
Implementation
Method 1: Basic Document Scraping
Prerequisites:
- Firecrawl API key
@mendable/firecrawl-jspackage installed (npm install @mendable/firecrawl-js)- Public URL pointing to supported document format
Procedure:
- Initialize Firecrawl client
import Firecrawl from '@mendable/firecrawl-js';
const firecrawl = new Firecrawl({
apiKey: "fc-YOUR-API-KEY"
});
- Scrape document (auto-detects format)
// Excel file
const excelDoc = await firecrawl.scrape('https://example.com/data.xlsx');
console.log(excelDoc.markdown);
// Word document
const wordDoc = await firecrawl.scrape('https://example.com/report.docx');
console.log(wordDoc.markdown);
// PDF (default auto mode)
const pdfDoc = await firecrawl.scrape('https://example.com/report.pdf');
console.log(pdfDoc.markdown);
- Process markdown output
- Output is clean, structured markdown ready for Large Language Model consumption
- Excel files: worksheets separated by
## SheetNameheadings with HTML tables - Word docs: preserved heading hierarchy, paragraphs, lists, tables
- PDFs: text with layout structure
Verification: Check that doc.markdown contains expected content structure. For multi-sheet Excel files, verify each sheet appears as separate section.
Method 2: PDF with Custom Parsing Mode
Prerequisites: Same as Method 1
Procedure:
import Firecrawl from '@mendable/firecrawl-js';
const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });
// Force OCR for scanned document
const ocrResult = await firecrawl.scrape(
'https://example.com/scanned-report.pdf',
{
parsers: [{ type: "pdf", mode: "ocr", maxPages: 20 }]
}
);
// Fast mode for born-digital PDF (skip OCR entirely)
const fastResult = await firecrawl.scrape(
'https://example.com/digital-report.pdf',
{
parsers: [{ type: "pdf", mode: "fast" }]
}
);
// Auto mode with page limit
const autoResult = await firecrawl.scrape(
'https://example.com/long-report.pdf',
{
parsers: [{ type: "pdf", maxPages: 50 }]
}
);
Verification: Compare output quality between modes. OCR mode should extract text from scanned pages where fast mode returns empty or garbled content.
Method 3: Batch Document Processing
Prerequisites: Firecrawl API key, list of document URLs
Procedure:
import Firecrawl from '@mendable/firecrawl-js';
const firecrawl = new Firecrawl({ apiKey: "fc-YOUR-API-KEY" });
const documentUrls = [
'https://example.com/q1-report.pdf',
'https://example.com/q2-report.xlsx',
'https://example.com/contract.docx'
];
// Process multiple documents in parallel
const results = await Promise.all(
documentUrls.map(url => firecrawl.scrape(url))
);
results.forEach((doc, index) => {
console.log(`Document ${index + 1}:`);
console.log(doc.markdown);
});
Verification: All documents should be processed and returned in order. Check for any failed requests in the results array.
Example Output Formats
Excel Spreadsheet (.xlsx):
## Sheet1 | Name | Value | |--------|-------| | Item 1 | 100 | | Item 2 | 200 | ## Sheet2 | Date | Description | |------------|----------------| | 2023-01-01 | First quarter | | 2023-04-01 | Second quarter |
Word Document (.docx):
# Annual Report 2025 ## Executive Summary This document contains the annual financial summary... ### Key Metrics - Revenue: $1.2M - Growth: 15% - Customers: 450 ## Financial Details | Quarter | Revenue | Expenses | |---------|---------|----------| | Q1 | $300K | $250K | | Q2 | $320K | $260K |
PDF Document:
# Technical Specification v2.1 ## 1. Introduction This specification defines the requirements for... ### 1.1 Scope The system shall support the following features: 1. Feature A 2. Feature B 3. Feature C ## 2. Technical Requirements [Content continues with preserved structure]
Source excerpt truncated at 220 of 310 lines. Open the canonical wiki path above for the full page.
Relationships
Outbound links
Referenced by
- Firecrawl Web Search Evaluationbacklink
- EML Operator - Single Binary Operator for All Elementary Functionsbacklink