Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/commands/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
*
* Uploads a local file to the Firecrawl /v2/parse endpoint and returns the
* parsed document in the requested format(s). Supported file types:
* .html, .htm, .pdf, .docx, .doc, .odt, .rtf, .xlsx, .xls
* .html, .htm, .pdf, .docx, .doc, .odt, .rtf, .xlsx, .xls, and raster
* images (.png, .jpg, .jpeg, .jp2, .tif, .tiff, .gif, .bmp, .webp, .avif),
* which the API OCRs as one-page documents.
*/

import * as fs from 'fs';
Expand All @@ -28,6 +30,17 @@ const SUPPORTED_EXTENSIONS = new Set([
'.rtf',
'.xlsx',
'.xls',
// Raster images, OCR'd by the API as one-page documents.
'.png',
Comment thread
abimaelmartell marked this conversation as resolved.
'.jpg',
'.jpeg',
'.jp2',
'.tif',
'.tiff',
'.gif',
'.bmp',
'.webp',
'.avif',
]);

/**
Expand All @@ -45,6 +58,16 @@ const CONTENT_TYPE_BY_EXT: Record<string, string> = {
'.rtf': 'application/rtf',
'.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'.xls': 'application/vnd.ms-excel',
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.jp2': 'image/jp2',
'.tif': 'image/tiff',
'.tiff': 'image/tiff',
'.gif': 'image/gif',
'.bmp': 'image/bmp',
'.webp': 'image/webp',
'.avif': 'image/avif',
};

function outputTiming(
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,9 @@ Examples:
$ firecrawl parse ./report.pdf -Q "What is the total revenue?"
$ firecrawl parse ./report.pdf --json --pretty -o report.json

Supported file types: .html, .htm, .pdf, .docx, .doc, .odt, .rtf, .xlsx, .xls
Supported file types: .html, .htm, .pdf, .docx, .doc, .odt, .rtf, .xlsx, .xls,
and raster images (.png, .jpg, .jpeg, .jp2, .tif, .tiff, .gif, .bmp, .webp, .avif)
which are OCR'd as one-page documents
Max upload size: 50 MB
`
)
Expand Down
Loading