@mendable/firecrawl-js 4.32.1 → 4.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ var require_package = __commonJS({
12
12
  "package.json"(exports, module) {
13
13
  module.exports = {
14
14
  name: "@mendable/firecrawl-js",
15
- version: "4.32.1",
15
+ version: "4.33.0",
16
16
  description: "JavaScript SDK for the Firecrawl API: web scraping, crawling, web search, and scientific literature search over a research paper index of PubMed, bioRxiv, medRxiv and arXiv abstracts",
17
17
  main: "dist/index.js",
18
18
  types: "dist/index.d.ts",
package/dist/index.cjs CHANGED
@@ -39,7 +39,7 @@ var require_package = __commonJS({
39
39
  "package.json"(exports2, module2) {
40
40
  module2.exports = {
41
41
  name: "@mendable/firecrawl-js",
42
- version: "4.32.1",
42
+ version: "4.33.0",
43
43
  description: "JavaScript SDK for the Firecrawl API: web scraping, crawling, web search, and scientific literature search over a research paper index of PubMed, bioRxiv, medRxiv and arXiv abstracts",
44
44
  main: "dist/index.js",
45
45
  types: "dist/index.d.ts",
package/dist/index.d.cts CHANGED
@@ -117,6 +117,37 @@ type ActionOption = WaitAction | ScreenshotAction | ClickAction | WriteAction |
117
117
  interface AuditMetadata$1 {
118
118
  username: string;
119
119
  }
120
+ type PDFParser = {
121
+ type: "pdf";
122
+ mode?: "fast" | "auto" | "ocr";
123
+ maxPages?: number;
124
+ /** Include physical per-page markdown alongside document markdown. */
125
+ pageMarkdown?: boolean;
126
+ /** Include per-page typed layout blocks (bounding boxes, block types, reading order). */
127
+ blocks?: boolean;
128
+ };
129
+ interface PdfBlockConfidence {
130
+ layout: number | null;
131
+ ocr: number | null;
132
+ }
133
+ interface PdfBlockItem {
134
+ id: string;
135
+ type: string;
136
+ label: string | null;
137
+ bbox: [number, number, number, number] | null;
138
+ content: string;
139
+ markdownSpan: [number, number] | null;
140
+ readingOrder: number;
141
+ source: string | null;
142
+ confidence: PdfBlockConfidence;
143
+ }
144
+ interface PdfPageBlocks {
145
+ pageNumber: number;
146
+ width: number | null;
147
+ height: number | null;
148
+ status: string;
149
+ items: PdfBlockItem[];
150
+ }
120
151
  interface ScrapeOptions {
121
152
  formats?: FormatOption[];
122
153
  headers?: Record<string, string>;
@@ -126,11 +157,7 @@ interface ScrapeOptions {
126
157
  timeout?: number;
127
158
  waitFor?: number;
128
159
  mobile?: boolean;
129
- parsers?: Array<string | {
130
- type: "pdf";
131
- mode?: "fast" | "auto" | "ocr";
132
- maxPages?: number;
133
- }>;
160
+ parsers?: Array<string | PDFParser>;
134
161
  actions?: ActionOption[];
135
162
  location?: LocationConfig$1;
136
163
  skipTlsVerification?: boolean;
@@ -219,6 +246,7 @@ interface AgentWebhookConfig {
219
246
  }
220
247
  interface BrandingProfile {
221
248
  colorScheme?: "light" | "dark";
249
+ brandName?: string;
222
250
  logo?: string | null;
223
251
  fonts?: Array<{
224
252
  family: string;
@@ -500,6 +528,8 @@ interface Document {
500
528
  branding?: BrandingProfile;
501
529
  product?: ProductProfile;
502
530
  menu?: MenuProfile;
531
+ /** Typed PDF layout blocks, present only when `parsers[].blocks` is true. */
532
+ blocks?: PdfPageBlocks[];
503
533
  }
504
534
  interface PaginationConfig {
505
535
  /** When true (default), automatically follow `next` links and aggregate all documents. */
@@ -2761,4 +2791,4 @@ declare class Firecrawl extends FirecrawlClient {
2761
2791
  get v1(): FirecrawlApp;
2762
2792
  }
2763
2793
 
2764
- export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type AuditMetadata$1 as AuditMetadata, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
2794
+ export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type AuditMetadata$1 as AuditMetadata, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PDFParser, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PdfBlockConfidence, type PdfBlockItem, type PdfPageBlocks, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
package/dist/index.d.ts CHANGED
@@ -117,6 +117,37 @@ type ActionOption = WaitAction | ScreenshotAction | ClickAction | WriteAction |
117
117
  interface AuditMetadata$1 {
118
118
  username: string;
119
119
  }
120
+ type PDFParser = {
121
+ type: "pdf";
122
+ mode?: "fast" | "auto" | "ocr";
123
+ maxPages?: number;
124
+ /** Include physical per-page markdown alongside document markdown. */
125
+ pageMarkdown?: boolean;
126
+ /** Include per-page typed layout blocks (bounding boxes, block types, reading order). */
127
+ blocks?: boolean;
128
+ };
129
+ interface PdfBlockConfidence {
130
+ layout: number | null;
131
+ ocr: number | null;
132
+ }
133
+ interface PdfBlockItem {
134
+ id: string;
135
+ type: string;
136
+ label: string | null;
137
+ bbox: [number, number, number, number] | null;
138
+ content: string;
139
+ markdownSpan: [number, number] | null;
140
+ readingOrder: number;
141
+ source: string | null;
142
+ confidence: PdfBlockConfidence;
143
+ }
144
+ interface PdfPageBlocks {
145
+ pageNumber: number;
146
+ width: number | null;
147
+ height: number | null;
148
+ status: string;
149
+ items: PdfBlockItem[];
150
+ }
120
151
  interface ScrapeOptions {
121
152
  formats?: FormatOption[];
122
153
  headers?: Record<string, string>;
@@ -126,11 +157,7 @@ interface ScrapeOptions {
126
157
  timeout?: number;
127
158
  waitFor?: number;
128
159
  mobile?: boolean;
129
- parsers?: Array<string | {
130
- type: "pdf";
131
- mode?: "fast" | "auto" | "ocr";
132
- maxPages?: number;
133
- }>;
160
+ parsers?: Array<string | PDFParser>;
134
161
  actions?: ActionOption[];
135
162
  location?: LocationConfig$1;
136
163
  skipTlsVerification?: boolean;
@@ -219,6 +246,7 @@ interface AgentWebhookConfig {
219
246
  }
220
247
  interface BrandingProfile {
221
248
  colorScheme?: "light" | "dark";
249
+ brandName?: string;
222
250
  logo?: string | null;
223
251
  fonts?: Array<{
224
252
  family: string;
@@ -500,6 +528,8 @@ interface Document {
500
528
  branding?: BrandingProfile;
501
529
  product?: ProductProfile;
502
530
  menu?: MenuProfile;
531
+ /** Typed PDF layout blocks, present only when `parsers[].blocks` is true. */
532
+ blocks?: PdfPageBlocks[];
503
533
  }
504
534
  interface PaginationConfig {
505
535
  /** When true (default), automatically follow `next` links and aggregate all documents. */
@@ -2761,4 +2791,4 @@ declare class Firecrawl extends FirecrawlClient {
2761
2791
  get v1(): FirecrawlApp;
2762
2792
  }
2763
2793
 
2764
- export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type AuditMetadata$1 as AuditMetadata, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
2794
+ export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type AuditMetadata$1 as AuditMetadata, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PDFParser, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PdfBlockConfidence, type PdfBlockItem, type PdfPageBlocks, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-S7CQ7Q2W.js";
3
+ } from "./chunk-NMQZNWRC.js";
4
4
 
5
5
  // src/v2/utils/httpClient.ts
6
6
  import axios from "axios";
@@ -2342,7 +2342,7 @@ var FirecrawlApp = class {
2342
2342
  if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
2343
2343
  return process.env.npm_package_version;
2344
2344
  }
2345
- const packageJson = await import("./package-KQCMZM5L.js");
2345
+ const packageJson = await import("./package-GTMZIRAE.js");
2346
2346
  return packageJson.default.version;
2347
2347
  } catch (error) {
2348
2348
  const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
@@ -1,4 +1,4 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-S7CQ7Q2W.js";
3
+ } from "./chunk-NMQZNWRC.js";
4
4
  export default require_package();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mendable/firecrawl-js",
3
- "version": "4.32.1",
3
+ "version": "4.33.0",
4
4
  "description": "JavaScript SDK for the Firecrawl API: web scraping, crawling, web search, and scientific literature search over a research paper index of PubMed, bioRxiv, medRxiv and arXiv abstracts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -89,6 +89,19 @@ describe("v2 utils: validation", () => {
89
89
  expect(options.parsers).toEqual(before);
90
90
  });
91
91
 
92
+ test("ensureValidScrapeOptions: leaves PDF parser blocks option untouched", () => {
93
+ const options = {
94
+ parsers: [{ type: "pdf", mode: "auto", blocks: true, pageMarkdown: true }],
95
+ } as any;
96
+ expect(() => ensureValidScrapeOptions(options)).not.toThrow();
97
+ expect(options.parsers[0]).toEqual({
98
+ type: "pdf",
99
+ mode: "auto",
100
+ blocks: true,
101
+ pageMarkdown: true,
102
+ });
103
+ });
104
+
92
105
  test("ensureValidFormats: detects mistaken use of zod schema.shape", () => {
93
106
  const schema = z.object({ title: z.string(), count: z.number() });
94
107
  // User mistakenly passes schema.shape instead of schema
package/src/v2/types.ts CHANGED
@@ -187,6 +187,41 @@ export interface AuditMetadata {
187
187
  username: string;
188
188
  }
189
189
 
190
+ export type PDFParser = {
191
+ type: "pdf";
192
+ mode?: "fast" | "auto" | "ocr";
193
+ maxPages?: number;
194
+ /** Include physical per-page markdown alongside document markdown. */
195
+ pageMarkdown?: boolean;
196
+ /** Include per-page typed layout blocks (bounding boxes, block types, reading order). */
197
+ blocks?: boolean;
198
+ };
199
+
200
+ export interface PdfBlockConfidence {
201
+ layout: number | null;
202
+ ocr: number | null;
203
+ }
204
+
205
+ export interface PdfBlockItem {
206
+ id: string;
207
+ type: string;
208
+ label: string | null;
209
+ bbox: [number, number, number, number] | null;
210
+ content: string;
211
+ markdownSpan: [number, number] | null;
212
+ readingOrder: number;
213
+ source: string | null;
214
+ confidence: PdfBlockConfidence;
215
+ }
216
+
217
+ export interface PdfPageBlocks {
218
+ pageNumber: number;
219
+ width: number | null;
220
+ height: number | null;
221
+ status: string;
222
+ items: PdfBlockItem[];
223
+ }
224
+
190
225
  export interface ScrapeOptions {
191
226
  formats?: FormatOption[];
192
227
  headers?: Record<string, string>;
@@ -196,9 +231,7 @@ export interface ScrapeOptions {
196
231
  timeout?: number;
197
232
  waitFor?: number;
198
233
  mobile?: boolean;
199
- parsers?: Array<
200
- string | { type: "pdf"; mode?: "fast" | "auto" | "ocr"; maxPages?: number }
201
- >;
234
+ parsers?: Array<string | PDFParser>;
202
235
  actions?: ActionOption[];
203
236
  location?: LocationConfig;
204
237
  skipTlsVerification?: boolean;
@@ -328,6 +361,7 @@ export interface AgentWebhookConfig {
328
361
 
329
362
  export interface BrandingProfile {
330
363
  colorScheme?: "light" | "dark";
364
+ brandName?: string;
331
365
  logo?: string | null;
332
366
  fonts?: Array<{
333
367
  family: string;
@@ -646,6 +680,8 @@ export interface Document {
646
680
  branding?: BrandingProfile;
647
681
  product?: ProductProfile;
648
682
  menu?: MenuProfile;
683
+ /** Typed PDF layout blocks, present only when `parsers[].blocks` is true. */
684
+ blocks?: PdfPageBlocks[];
649
685
  }
650
686
 
651
687
  // Pagination configuration for auto-fetching pages from v2 endpoints that return a `next` URL