firecrawl 1.18.0 → 1.18.2
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.
- package/dist/index.cjs +383 -22
- package/dist/index.d.cts +209 -5
- package/dist/index.d.ts +209 -5
- package/dist/index.js +383 -22
- package/dump.rdb +0 -0
- package/package.json +1 -1
- package/src/index.ts +155 -1
package/dist/index.d.cts
CHANGED
|
@@ -61,6 +61,7 @@ interface FirecrawlDocument<T = any, ActionsSchema extends (ActionsResult | neve
|
|
|
61
61
|
rawHtml?: string;
|
|
62
62
|
links?: string[];
|
|
63
63
|
extract?: T;
|
|
64
|
+
json?: T;
|
|
64
65
|
screenshot?: string;
|
|
65
66
|
metadata?: FirecrawlDocumentMetadata;
|
|
66
67
|
actions: ActionsSchema;
|
|
@@ -72,7 +73,7 @@ interface FirecrawlDocument<T = any, ActionsSchema extends (ActionsResult | neve
|
|
|
72
73
|
* Defines the options and configurations available for scraping web content.
|
|
73
74
|
*/
|
|
74
75
|
interface CrawlScrapeOptions {
|
|
75
|
-
formats
|
|
76
|
+
formats?: ("markdown" | "html" | "rawHtml" | "content" | "links" | "screenshot" | "screenshot@fullPage" | "extract" | "json")[];
|
|
76
77
|
headers?: Record<string, string>;
|
|
77
78
|
includeTags?: string[];
|
|
78
79
|
excludeTags?: string[];
|
|
@@ -86,6 +87,8 @@ interface CrawlScrapeOptions {
|
|
|
86
87
|
mobile?: boolean;
|
|
87
88
|
skipTlsVerification?: boolean;
|
|
88
89
|
removeBase64Images?: boolean;
|
|
90
|
+
blockAds?: boolean;
|
|
91
|
+
proxy?: "basic" | "stealth";
|
|
89
92
|
}
|
|
90
93
|
type Action = {
|
|
91
94
|
type: "wait";
|
|
@@ -119,6 +122,11 @@ interface ScrapeParams<LLMSchema extends zt.ZodSchema = any, ActionsSchema exten
|
|
|
119
122
|
schema?: LLMSchema;
|
|
120
123
|
systemPrompt?: string;
|
|
121
124
|
};
|
|
125
|
+
jsonOptions?: {
|
|
126
|
+
prompt?: string;
|
|
127
|
+
schema?: LLMSchema;
|
|
128
|
+
systemPrompt?: string;
|
|
129
|
+
};
|
|
122
130
|
actions?: ActionsSchema;
|
|
123
131
|
}
|
|
124
132
|
interface ActionsResult {
|
|
@@ -150,6 +158,7 @@ interface CrawlParams {
|
|
|
150
158
|
url: string;
|
|
151
159
|
headers?: Record<string, string>;
|
|
152
160
|
metadata?: Record<string, string>;
|
|
161
|
+
events?: ["completed", "failed", "page", "started"][number][];
|
|
153
162
|
};
|
|
154
163
|
deduplicateSimilarURLs?: boolean;
|
|
155
164
|
ignoreQueryParameters?: boolean;
|
|
@@ -213,6 +222,7 @@ interface MapParams {
|
|
|
213
222
|
includeSubdomains?: boolean;
|
|
214
223
|
sitemapOnly?: boolean;
|
|
215
224
|
limit?: number;
|
|
225
|
+
timeout?: number;
|
|
216
226
|
}
|
|
217
227
|
/**
|
|
218
228
|
* Response interface for mapping operations.
|
|
@@ -232,7 +242,11 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
|
|
|
232
242
|
schema?: LLMSchema | object;
|
|
233
243
|
systemPrompt?: string;
|
|
234
244
|
allowExternalLinks?: boolean;
|
|
245
|
+
enableWebSearch?: boolean;
|
|
235
246
|
includeSubdomains?: boolean;
|
|
247
|
+
origin?: string;
|
|
248
|
+
showSources?: boolean;
|
|
249
|
+
scrapeOptions?: CrawlScrapeOptions;
|
|
236
250
|
}
|
|
237
251
|
/**
|
|
238
252
|
* Response interface for extracting information from URLs.
|
|
@@ -243,6 +257,7 @@ interface ExtractResponse<LLMSchema extends zt.ZodSchema = any> {
|
|
|
243
257
|
data: LLMSchema;
|
|
244
258
|
error?: string;
|
|
245
259
|
warning?: string;
|
|
260
|
+
sources?: string[];
|
|
246
261
|
}
|
|
247
262
|
/**
|
|
248
263
|
* Error response interface.
|
|
@@ -258,7 +273,8 @@ interface ErrorResponse {
|
|
|
258
273
|
*/
|
|
259
274
|
declare class FirecrawlError extends Error {
|
|
260
275
|
statusCode: number;
|
|
261
|
-
|
|
276
|
+
details?: any;
|
|
277
|
+
constructor(message: string, statusCode: number, details?: any);
|
|
262
278
|
}
|
|
263
279
|
/**
|
|
264
280
|
* Parameters for search operations.
|
|
@@ -285,6 +301,124 @@ interface SearchResponse {
|
|
|
285
301
|
warning?: string;
|
|
286
302
|
error?: string;
|
|
287
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Response interface for crawl/batch scrape error monitoring.
|
|
306
|
+
*/
|
|
307
|
+
interface CrawlErrorsResponse {
|
|
308
|
+
/**
|
|
309
|
+
* Scrapes that errored out + error details
|
|
310
|
+
*/
|
|
311
|
+
errors: {
|
|
312
|
+
id: string;
|
|
313
|
+
timestamp?: string;
|
|
314
|
+
url: string;
|
|
315
|
+
error: string;
|
|
316
|
+
}[];
|
|
317
|
+
/**
|
|
318
|
+
* URLs blocked by robots.txt
|
|
319
|
+
*/
|
|
320
|
+
robotsBlocked: string[];
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Parameters for deep research operations.
|
|
324
|
+
* Defines options for conducting deep research on a topic.
|
|
325
|
+
*/
|
|
326
|
+
interface DeepResearchParams {
|
|
327
|
+
/**
|
|
328
|
+
* Maximum depth of research iterations (1-10)
|
|
329
|
+
* @default 7
|
|
330
|
+
*/
|
|
331
|
+
maxDepth?: number;
|
|
332
|
+
/**
|
|
333
|
+
* Time limit in seconds (30-300)
|
|
334
|
+
* @default 270
|
|
335
|
+
*/
|
|
336
|
+
timeLimit?: number;
|
|
337
|
+
/**
|
|
338
|
+
* Experimental flag for streaming steps
|
|
339
|
+
*/
|
|
340
|
+
__experimental_streamSteps?: boolean;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Response interface for deep research operations.
|
|
344
|
+
*/
|
|
345
|
+
interface DeepResearchResponse {
|
|
346
|
+
success: boolean;
|
|
347
|
+
id: string;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Status response interface for deep research operations.
|
|
351
|
+
*/
|
|
352
|
+
interface DeepResearchStatusResponse {
|
|
353
|
+
success: boolean;
|
|
354
|
+
data: {
|
|
355
|
+
findings: Array<{
|
|
356
|
+
text: string;
|
|
357
|
+
source: string;
|
|
358
|
+
}>;
|
|
359
|
+
finalAnalysis: string;
|
|
360
|
+
analysis: string;
|
|
361
|
+
completedSteps: number;
|
|
362
|
+
totalSteps: number;
|
|
363
|
+
};
|
|
364
|
+
status: "processing" | "completed" | "failed";
|
|
365
|
+
error?: string;
|
|
366
|
+
expiresAt: string;
|
|
367
|
+
currentDepth: number;
|
|
368
|
+
maxDepth: number;
|
|
369
|
+
activities: Array<{
|
|
370
|
+
type: string;
|
|
371
|
+
status: string;
|
|
372
|
+
message: string;
|
|
373
|
+
timestamp: string;
|
|
374
|
+
depth: number;
|
|
375
|
+
}>;
|
|
376
|
+
sources: Array<{
|
|
377
|
+
url: string;
|
|
378
|
+
title: string;
|
|
379
|
+
description: string;
|
|
380
|
+
}>;
|
|
381
|
+
summaries: string[];
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Parameters for LLMs.txt generation operations.
|
|
385
|
+
*/
|
|
386
|
+
interface GenerateLLMsTextParams {
|
|
387
|
+
/**
|
|
388
|
+
* Maximum number of URLs to process (1-100)
|
|
389
|
+
* @default 10
|
|
390
|
+
*/
|
|
391
|
+
maxUrls?: number;
|
|
392
|
+
/**
|
|
393
|
+
* Whether to show the full LLMs-full.txt in the response
|
|
394
|
+
* @default false
|
|
395
|
+
*/
|
|
396
|
+
showFullText?: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Experimental flag for streaming
|
|
399
|
+
*/
|
|
400
|
+
__experimental_stream?: boolean;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Response interface for LLMs.txt generation operations.
|
|
404
|
+
*/
|
|
405
|
+
interface GenerateLLMsTextResponse {
|
|
406
|
+
success: boolean;
|
|
407
|
+
id: string;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Status response interface for LLMs.txt generation operations.
|
|
411
|
+
*/
|
|
412
|
+
interface GenerateLLMsTextStatusResponse {
|
|
413
|
+
success: boolean;
|
|
414
|
+
data: {
|
|
415
|
+
llmstxt: string;
|
|
416
|
+
llmsfulltxt?: string;
|
|
417
|
+
};
|
|
418
|
+
status: "processing" | "completed" | "failed";
|
|
419
|
+
error?: string;
|
|
420
|
+
expiresAt: string;
|
|
421
|
+
}
|
|
288
422
|
/**
|
|
289
423
|
* Main class for interacting with the Firecrawl API.
|
|
290
424
|
* Provides methods for scraping, searching, crawling, and mapping web content.
|
|
@@ -326,9 +460,18 @@ declare class FirecrawlApp {
|
|
|
326
460
|
* Checks the status of a crawl job using the Firecrawl API.
|
|
327
461
|
* @param id - The ID of the crawl operation.
|
|
328
462
|
* @param getAllData - Paginate through all the pages of documents, returning the full list of all documents. (default: `false`)
|
|
463
|
+
* @param nextURL - The `next` URL from the previous crawl status. Only required if you're not manually increasing `skip`. Only used when `getAllData = false`.
|
|
464
|
+
* @param skip - How many entries to skip to paginate. Only required if you're not providing `nextURL`. Only used when `getAllData = false`.
|
|
465
|
+
* @param limit - How many entries to return. Only used when `getAllData = false`.
|
|
329
466
|
* @returns The response containing the job status.
|
|
330
467
|
*/
|
|
331
|
-
checkCrawlStatus(id?: string, getAllData?: boolean): Promise<CrawlStatusResponse | ErrorResponse>;
|
|
468
|
+
checkCrawlStatus(id?: string, getAllData?: boolean, nextURL?: string, skip?: number, limit?: number): Promise<CrawlStatusResponse | ErrorResponse>;
|
|
469
|
+
/**
|
|
470
|
+
* Returns information about crawl errors.
|
|
471
|
+
* @param id - The ID of the crawl operation.
|
|
472
|
+
* @returns Information about crawl errors.
|
|
473
|
+
*/
|
|
474
|
+
checkCrawlErrors(id: string): Promise<CrawlErrorsResponse | ErrorResponse>;
|
|
332
475
|
/**
|
|
333
476
|
* Cancels a crawl job using the Firecrawl API.
|
|
334
477
|
* @param id - The ID of the crawl operation.
|
|
@@ -373,9 +516,18 @@ declare class FirecrawlApp {
|
|
|
373
516
|
* Checks the status of a batch scrape job using the Firecrawl API.
|
|
374
517
|
* @param id - The ID of the batch scrape operation.
|
|
375
518
|
* @param getAllData - Paginate through all the pages of documents, returning the full list of all documents. (default: `false`)
|
|
519
|
+
* @param nextURL - The `next` URL from the previous batch scrape status. Only required if you're not manually increasing `skip`. Only used when `getAllData = false`.
|
|
520
|
+
* @param skip - How many entries to skip to paginate. Only used when `getAllData = false`.
|
|
521
|
+
* @param limit - How many entries to return. Only used when `getAllData = false`.
|
|
376
522
|
* @returns The response containing the job status.
|
|
377
523
|
*/
|
|
378
|
-
checkBatchScrapeStatus(id?: string, getAllData?: boolean): Promise<BatchScrapeStatusResponse | ErrorResponse>;
|
|
524
|
+
checkBatchScrapeStatus(id?: string, getAllData?: boolean, nextURL?: string, skip?: number, limit?: number): Promise<BatchScrapeStatusResponse | ErrorResponse>;
|
|
525
|
+
/**
|
|
526
|
+
* Returns information about batch scrape errors.
|
|
527
|
+
* @param id - The ID of the batch scrape operation.
|
|
528
|
+
* @returns Information about batch scrape errors.
|
|
529
|
+
*/
|
|
530
|
+
checkBatchScrapeErrors(id: string): Promise<CrawlErrorsResponse | ErrorResponse>;
|
|
379
531
|
/**
|
|
380
532
|
* Extracts information from URLs using the Firecrawl API.
|
|
381
533
|
* Currently in Beta. Expect breaking changes on future minor versions.
|
|
@@ -384,6 +536,20 @@ declare class FirecrawlApp {
|
|
|
384
536
|
* @returns The response from the extract operation.
|
|
385
537
|
*/
|
|
386
538
|
extract<T extends zt.ZodSchema = any>(urls: string[], params?: ExtractParams<T>): Promise<ExtractResponse<zt.infer<T>> | ErrorResponse>;
|
|
539
|
+
/**
|
|
540
|
+
* Initiates an asynchronous extract job for a URL using the Firecrawl API.
|
|
541
|
+
* @param url - The URL to extract data from.
|
|
542
|
+
* @param params - Additional parameters for the extract request.
|
|
543
|
+
* @param idempotencyKey - Optional idempotency key for the request.
|
|
544
|
+
* @returns The response from the extract operation.
|
|
545
|
+
*/
|
|
546
|
+
asyncExtract(urls: string[], params?: ExtractParams, idempotencyKey?: string): Promise<ExtractResponse | ErrorResponse>;
|
|
547
|
+
/**
|
|
548
|
+
* Retrieves the status of an extract job.
|
|
549
|
+
* @param jobId - The ID of the extract job.
|
|
550
|
+
* @returns The status of the extract job.
|
|
551
|
+
*/
|
|
552
|
+
getExtractStatus(jobId: string): Promise<any>;
|
|
387
553
|
/**
|
|
388
554
|
* Prepares the headers for an API request.
|
|
389
555
|
* @param idempotencyKey - Optional key to ensure idempotency.
|
|
@@ -427,6 +593,44 @@ declare class FirecrawlApp {
|
|
|
427
593
|
* @param {string} action - The action being performed when the error occurred.
|
|
428
594
|
*/
|
|
429
595
|
handleError(response: AxiosResponse, action: string): void;
|
|
596
|
+
/**
|
|
597
|
+
* Initiates a deep research operation on a given topic and polls until completion.
|
|
598
|
+
* @param params - Parameters for the deep research operation.
|
|
599
|
+
* @returns The final research results.
|
|
600
|
+
*/
|
|
601
|
+
__deepResearch(topic: string, params: DeepResearchParams): Promise<DeepResearchStatusResponse | ErrorResponse>;
|
|
602
|
+
/**
|
|
603
|
+
* Initiates a deep research operation on a given topic without polling.
|
|
604
|
+
* @param params - Parameters for the deep research operation.
|
|
605
|
+
* @returns The response containing the research job ID.
|
|
606
|
+
*/
|
|
607
|
+
__asyncDeepResearch(topic: string, params: DeepResearchParams): Promise<DeepResearchResponse | ErrorResponse>;
|
|
608
|
+
/**
|
|
609
|
+
* Checks the status of a deep research operation.
|
|
610
|
+
* @param id - The ID of the deep research operation.
|
|
611
|
+
* @returns The current status and results of the research operation.
|
|
612
|
+
*/
|
|
613
|
+
__checkDeepResearchStatus(id: string): Promise<DeepResearchStatusResponse | ErrorResponse>;
|
|
614
|
+
/**
|
|
615
|
+
* Generates LLMs.txt for a given URL and polls until completion.
|
|
616
|
+
* @param url - The URL to generate LLMs.txt from.
|
|
617
|
+
* @param params - Parameters for the LLMs.txt generation operation.
|
|
618
|
+
* @returns The final generation results.
|
|
619
|
+
*/
|
|
620
|
+
generateLLMsText(url: string, params?: GenerateLLMsTextParams): Promise<GenerateLLMsTextStatusResponse | ErrorResponse>;
|
|
621
|
+
/**
|
|
622
|
+
* Initiates a LLMs.txt generation operation without polling.
|
|
623
|
+
* @param url - The URL to generate LLMs.txt from.
|
|
624
|
+
* @param params - Parameters for the LLMs.txt generation operation.
|
|
625
|
+
* @returns The response containing the generation job ID.
|
|
626
|
+
*/
|
|
627
|
+
asyncGenerateLLMsText(url: string, params?: GenerateLLMsTextParams): Promise<GenerateLLMsTextResponse | ErrorResponse>;
|
|
628
|
+
/**
|
|
629
|
+
* Checks the status of a LLMs.txt generation operation.
|
|
630
|
+
* @param id - The ID of the LLMs.txt generation operation.
|
|
631
|
+
* @returns The current status and results of the generation operation.
|
|
632
|
+
*/
|
|
633
|
+
checkGenerateLLMsTextStatus(id: string): Promise<GenerateLLMsTextStatusResponse | ErrorResponse>;
|
|
430
634
|
}
|
|
431
635
|
interface CrawlWatcherEvents {
|
|
432
636
|
document: CustomEvent<FirecrawlDocument<undefined>>;
|
|
@@ -449,4 +653,4 @@ declare class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
|
|
|
449
653
|
close(): void;
|
|
450
654
|
}
|
|
451
655
|
|
|
452
|
-
export { type Action, type ActionsResult, type BatchScrapeResponse, type BatchScrapeStatusResponse, type CrawlParams, type CrawlResponse, type CrawlScrapeOptions, type CrawlStatusResponse, CrawlWatcher, type ErrorResponse, type ExtractParams, type ExtractResponse, type FirecrawlAppConfig, type FirecrawlDocument, type FirecrawlDocumentMetadata, FirecrawlError, type MapParams, type MapResponse, type ScrapeParams, type ScrapeResponse, type SearchParams, type SearchResponse, FirecrawlApp as default };
|
|
656
|
+
export { type Action, type ActionsResult, type BatchScrapeResponse, type BatchScrapeStatusResponse, type CrawlErrorsResponse, type CrawlParams, type CrawlResponse, type CrawlScrapeOptions, type CrawlStatusResponse, CrawlWatcher, type DeepResearchParams, type DeepResearchResponse, type DeepResearchStatusResponse, type ErrorResponse, type ExtractParams, type ExtractResponse, type FirecrawlAppConfig, type FirecrawlDocument, type FirecrawlDocumentMetadata, FirecrawlError, type GenerateLLMsTextParams, type GenerateLLMsTextResponse, type GenerateLLMsTextStatusResponse, type MapParams, type MapResponse, type ScrapeParams, type ScrapeResponse, type SearchParams, type SearchResponse, FirecrawlApp as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ interface FirecrawlDocument<T = any, ActionsSchema extends (ActionsResult | neve
|
|
|
61
61
|
rawHtml?: string;
|
|
62
62
|
links?: string[];
|
|
63
63
|
extract?: T;
|
|
64
|
+
json?: T;
|
|
64
65
|
screenshot?: string;
|
|
65
66
|
metadata?: FirecrawlDocumentMetadata;
|
|
66
67
|
actions: ActionsSchema;
|
|
@@ -72,7 +73,7 @@ interface FirecrawlDocument<T = any, ActionsSchema extends (ActionsResult | neve
|
|
|
72
73
|
* Defines the options and configurations available for scraping web content.
|
|
73
74
|
*/
|
|
74
75
|
interface CrawlScrapeOptions {
|
|
75
|
-
formats
|
|
76
|
+
formats?: ("markdown" | "html" | "rawHtml" | "content" | "links" | "screenshot" | "screenshot@fullPage" | "extract" | "json")[];
|
|
76
77
|
headers?: Record<string, string>;
|
|
77
78
|
includeTags?: string[];
|
|
78
79
|
excludeTags?: string[];
|
|
@@ -86,6 +87,8 @@ interface CrawlScrapeOptions {
|
|
|
86
87
|
mobile?: boolean;
|
|
87
88
|
skipTlsVerification?: boolean;
|
|
88
89
|
removeBase64Images?: boolean;
|
|
90
|
+
blockAds?: boolean;
|
|
91
|
+
proxy?: "basic" | "stealth";
|
|
89
92
|
}
|
|
90
93
|
type Action = {
|
|
91
94
|
type: "wait";
|
|
@@ -119,6 +122,11 @@ interface ScrapeParams<LLMSchema extends zt.ZodSchema = any, ActionsSchema exten
|
|
|
119
122
|
schema?: LLMSchema;
|
|
120
123
|
systemPrompt?: string;
|
|
121
124
|
};
|
|
125
|
+
jsonOptions?: {
|
|
126
|
+
prompt?: string;
|
|
127
|
+
schema?: LLMSchema;
|
|
128
|
+
systemPrompt?: string;
|
|
129
|
+
};
|
|
122
130
|
actions?: ActionsSchema;
|
|
123
131
|
}
|
|
124
132
|
interface ActionsResult {
|
|
@@ -150,6 +158,7 @@ interface CrawlParams {
|
|
|
150
158
|
url: string;
|
|
151
159
|
headers?: Record<string, string>;
|
|
152
160
|
metadata?: Record<string, string>;
|
|
161
|
+
events?: ["completed", "failed", "page", "started"][number][];
|
|
153
162
|
};
|
|
154
163
|
deduplicateSimilarURLs?: boolean;
|
|
155
164
|
ignoreQueryParameters?: boolean;
|
|
@@ -213,6 +222,7 @@ interface MapParams {
|
|
|
213
222
|
includeSubdomains?: boolean;
|
|
214
223
|
sitemapOnly?: boolean;
|
|
215
224
|
limit?: number;
|
|
225
|
+
timeout?: number;
|
|
216
226
|
}
|
|
217
227
|
/**
|
|
218
228
|
* Response interface for mapping operations.
|
|
@@ -232,7 +242,11 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
|
|
|
232
242
|
schema?: LLMSchema | object;
|
|
233
243
|
systemPrompt?: string;
|
|
234
244
|
allowExternalLinks?: boolean;
|
|
245
|
+
enableWebSearch?: boolean;
|
|
235
246
|
includeSubdomains?: boolean;
|
|
247
|
+
origin?: string;
|
|
248
|
+
showSources?: boolean;
|
|
249
|
+
scrapeOptions?: CrawlScrapeOptions;
|
|
236
250
|
}
|
|
237
251
|
/**
|
|
238
252
|
* Response interface for extracting information from URLs.
|
|
@@ -243,6 +257,7 @@ interface ExtractResponse<LLMSchema extends zt.ZodSchema = any> {
|
|
|
243
257
|
data: LLMSchema;
|
|
244
258
|
error?: string;
|
|
245
259
|
warning?: string;
|
|
260
|
+
sources?: string[];
|
|
246
261
|
}
|
|
247
262
|
/**
|
|
248
263
|
* Error response interface.
|
|
@@ -258,7 +273,8 @@ interface ErrorResponse {
|
|
|
258
273
|
*/
|
|
259
274
|
declare class FirecrawlError extends Error {
|
|
260
275
|
statusCode: number;
|
|
261
|
-
|
|
276
|
+
details?: any;
|
|
277
|
+
constructor(message: string, statusCode: number, details?: any);
|
|
262
278
|
}
|
|
263
279
|
/**
|
|
264
280
|
* Parameters for search operations.
|
|
@@ -285,6 +301,124 @@ interface SearchResponse {
|
|
|
285
301
|
warning?: string;
|
|
286
302
|
error?: string;
|
|
287
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Response interface for crawl/batch scrape error monitoring.
|
|
306
|
+
*/
|
|
307
|
+
interface CrawlErrorsResponse {
|
|
308
|
+
/**
|
|
309
|
+
* Scrapes that errored out + error details
|
|
310
|
+
*/
|
|
311
|
+
errors: {
|
|
312
|
+
id: string;
|
|
313
|
+
timestamp?: string;
|
|
314
|
+
url: string;
|
|
315
|
+
error: string;
|
|
316
|
+
}[];
|
|
317
|
+
/**
|
|
318
|
+
* URLs blocked by robots.txt
|
|
319
|
+
*/
|
|
320
|
+
robotsBlocked: string[];
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Parameters for deep research operations.
|
|
324
|
+
* Defines options for conducting deep research on a topic.
|
|
325
|
+
*/
|
|
326
|
+
interface DeepResearchParams {
|
|
327
|
+
/**
|
|
328
|
+
* Maximum depth of research iterations (1-10)
|
|
329
|
+
* @default 7
|
|
330
|
+
*/
|
|
331
|
+
maxDepth?: number;
|
|
332
|
+
/**
|
|
333
|
+
* Time limit in seconds (30-300)
|
|
334
|
+
* @default 270
|
|
335
|
+
*/
|
|
336
|
+
timeLimit?: number;
|
|
337
|
+
/**
|
|
338
|
+
* Experimental flag for streaming steps
|
|
339
|
+
*/
|
|
340
|
+
__experimental_streamSteps?: boolean;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Response interface for deep research operations.
|
|
344
|
+
*/
|
|
345
|
+
interface DeepResearchResponse {
|
|
346
|
+
success: boolean;
|
|
347
|
+
id: string;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Status response interface for deep research operations.
|
|
351
|
+
*/
|
|
352
|
+
interface DeepResearchStatusResponse {
|
|
353
|
+
success: boolean;
|
|
354
|
+
data: {
|
|
355
|
+
findings: Array<{
|
|
356
|
+
text: string;
|
|
357
|
+
source: string;
|
|
358
|
+
}>;
|
|
359
|
+
finalAnalysis: string;
|
|
360
|
+
analysis: string;
|
|
361
|
+
completedSteps: number;
|
|
362
|
+
totalSteps: number;
|
|
363
|
+
};
|
|
364
|
+
status: "processing" | "completed" | "failed";
|
|
365
|
+
error?: string;
|
|
366
|
+
expiresAt: string;
|
|
367
|
+
currentDepth: number;
|
|
368
|
+
maxDepth: number;
|
|
369
|
+
activities: Array<{
|
|
370
|
+
type: string;
|
|
371
|
+
status: string;
|
|
372
|
+
message: string;
|
|
373
|
+
timestamp: string;
|
|
374
|
+
depth: number;
|
|
375
|
+
}>;
|
|
376
|
+
sources: Array<{
|
|
377
|
+
url: string;
|
|
378
|
+
title: string;
|
|
379
|
+
description: string;
|
|
380
|
+
}>;
|
|
381
|
+
summaries: string[];
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Parameters for LLMs.txt generation operations.
|
|
385
|
+
*/
|
|
386
|
+
interface GenerateLLMsTextParams {
|
|
387
|
+
/**
|
|
388
|
+
* Maximum number of URLs to process (1-100)
|
|
389
|
+
* @default 10
|
|
390
|
+
*/
|
|
391
|
+
maxUrls?: number;
|
|
392
|
+
/**
|
|
393
|
+
* Whether to show the full LLMs-full.txt in the response
|
|
394
|
+
* @default false
|
|
395
|
+
*/
|
|
396
|
+
showFullText?: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Experimental flag for streaming
|
|
399
|
+
*/
|
|
400
|
+
__experimental_stream?: boolean;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Response interface for LLMs.txt generation operations.
|
|
404
|
+
*/
|
|
405
|
+
interface GenerateLLMsTextResponse {
|
|
406
|
+
success: boolean;
|
|
407
|
+
id: string;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Status response interface for LLMs.txt generation operations.
|
|
411
|
+
*/
|
|
412
|
+
interface GenerateLLMsTextStatusResponse {
|
|
413
|
+
success: boolean;
|
|
414
|
+
data: {
|
|
415
|
+
llmstxt: string;
|
|
416
|
+
llmsfulltxt?: string;
|
|
417
|
+
};
|
|
418
|
+
status: "processing" | "completed" | "failed";
|
|
419
|
+
error?: string;
|
|
420
|
+
expiresAt: string;
|
|
421
|
+
}
|
|
288
422
|
/**
|
|
289
423
|
* Main class for interacting with the Firecrawl API.
|
|
290
424
|
* Provides methods for scraping, searching, crawling, and mapping web content.
|
|
@@ -326,9 +460,18 @@ declare class FirecrawlApp {
|
|
|
326
460
|
* Checks the status of a crawl job using the Firecrawl API.
|
|
327
461
|
* @param id - The ID of the crawl operation.
|
|
328
462
|
* @param getAllData - Paginate through all the pages of documents, returning the full list of all documents. (default: `false`)
|
|
463
|
+
* @param nextURL - The `next` URL from the previous crawl status. Only required if you're not manually increasing `skip`. Only used when `getAllData = false`.
|
|
464
|
+
* @param skip - How many entries to skip to paginate. Only required if you're not providing `nextURL`. Only used when `getAllData = false`.
|
|
465
|
+
* @param limit - How many entries to return. Only used when `getAllData = false`.
|
|
329
466
|
* @returns The response containing the job status.
|
|
330
467
|
*/
|
|
331
|
-
checkCrawlStatus(id?: string, getAllData?: boolean): Promise<CrawlStatusResponse | ErrorResponse>;
|
|
468
|
+
checkCrawlStatus(id?: string, getAllData?: boolean, nextURL?: string, skip?: number, limit?: number): Promise<CrawlStatusResponse | ErrorResponse>;
|
|
469
|
+
/**
|
|
470
|
+
* Returns information about crawl errors.
|
|
471
|
+
* @param id - The ID of the crawl operation.
|
|
472
|
+
* @returns Information about crawl errors.
|
|
473
|
+
*/
|
|
474
|
+
checkCrawlErrors(id: string): Promise<CrawlErrorsResponse | ErrorResponse>;
|
|
332
475
|
/**
|
|
333
476
|
* Cancels a crawl job using the Firecrawl API.
|
|
334
477
|
* @param id - The ID of the crawl operation.
|
|
@@ -373,9 +516,18 @@ declare class FirecrawlApp {
|
|
|
373
516
|
* Checks the status of a batch scrape job using the Firecrawl API.
|
|
374
517
|
* @param id - The ID of the batch scrape operation.
|
|
375
518
|
* @param getAllData - Paginate through all the pages of documents, returning the full list of all documents. (default: `false`)
|
|
519
|
+
* @param nextURL - The `next` URL from the previous batch scrape status. Only required if you're not manually increasing `skip`. Only used when `getAllData = false`.
|
|
520
|
+
* @param skip - How many entries to skip to paginate. Only used when `getAllData = false`.
|
|
521
|
+
* @param limit - How many entries to return. Only used when `getAllData = false`.
|
|
376
522
|
* @returns The response containing the job status.
|
|
377
523
|
*/
|
|
378
|
-
checkBatchScrapeStatus(id?: string, getAllData?: boolean): Promise<BatchScrapeStatusResponse | ErrorResponse>;
|
|
524
|
+
checkBatchScrapeStatus(id?: string, getAllData?: boolean, nextURL?: string, skip?: number, limit?: number): Promise<BatchScrapeStatusResponse | ErrorResponse>;
|
|
525
|
+
/**
|
|
526
|
+
* Returns information about batch scrape errors.
|
|
527
|
+
* @param id - The ID of the batch scrape operation.
|
|
528
|
+
* @returns Information about batch scrape errors.
|
|
529
|
+
*/
|
|
530
|
+
checkBatchScrapeErrors(id: string): Promise<CrawlErrorsResponse | ErrorResponse>;
|
|
379
531
|
/**
|
|
380
532
|
* Extracts information from URLs using the Firecrawl API.
|
|
381
533
|
* Currently in Beta. Expect breaking changes on future minor versions.
|
|
@@ -384,6 +536,20 @@ declare class FirecrawlApp {
|
|
|
384
536
|
* @returns The response from the extract operation.
|
|
385
537
|
*/
|
|
386
538
|
extract<T extends zt.ZodSchema = any>(urls: string[], params?: ExtractParams<T>): Promise<ExtractResponse<zt.infer<T>> | ErrorResponse>;
|
|
539
|
+
/**
|
|
540
|
+
* Initiates an asynchronous extract job for a URL using the Firecrawl API.
|
|
541
|
+
* @param url - The URL to extract data from.
|
|
542
|
+
* @param params - Additional parameters for the extract request.
|
|
543
|
+
* @param idempotencyKey - Optional idempotency key for the request.
|
|
544
|
+
* @returns The response from the extract operation.
|
|
545
|
+
*/
|
|
546
|
+
asyncExtract(urls: string[], params?: ExtractParams, idempotencyKey?: string): Promise<ExtractResponse | ErrorResponse>;
|
|
547
|
+
/**
|
|
548
|
+
* Retrieves the status of an extract job.
|
|
549
|
+
* @param jobId - The ID of the extract job.
|
|
550
|
+
* @returns The status of the extract job.
|
|
551
|
+
*/
|
|
552
|
+
getExtractStatus(jobId: string): Promise<any>;
|
|
387
553
|
/**
|
|
388
554
|
* Prepares the headers for an API request.
|
|
389
555
|
* @param idempotencyKey - Optional key to ensure idempotency.
|
|
@@ -427,6 +593,44 @@ declare class FirecrawlApp {
|
|
|
427
593
|
* @param {string} action - The action being performed when the error occurred.
|
|
428
594
|
*/
|
|
429
595
|
handleError(response: AxiosResponse, action: string): void;
|
|
596
|
+
/**
|
|
597
|
+
* Initiates a deep research operation on a given topic and polls until completion.
|
|
598
|
+
* @param params - Parameters for the deep research operation.
|
|
599
|
+
* @returns The final research results.
|
|
600
|
+
*/
|
|
601
|
+
__deepResearch(topic: string, params: DeepResearchParams): Promise<DeepResearchStatusResponse | ErrorResponse>;
|
|
602
|
+
/**
|
|
603
|
+
* Initiates a deep research operation on a given topic without polling.
|
|
604
|
+
* @param params - Parameters for the deep research operation.
|
|
605
|
+
* @returns The response containing the research job ID.
|
|
606
|
+
*/
|
|
607
|
+
__asyncDeepResearch(topic: string, params: DeepResearchParams): Promise<DeepResearchResponse | ErrorResponse>;
|
|
608
|
+
/**
|
|
609
|
+
* Checks the status of a deep research operation.
|
|
610
|
+
* @param id - The ID of the deep research operation.
|
|
611
|
+
* @returns The current status and results of the research operation.
|
|
612
|
+
*/
|
|
613
|
+
__checkDeepResearchStatus(id: string): Promise<DeepResearchStatusResponse | ErrorResponse>;
|
|
614
|
+
/**
|
|
615
|
+
* Generates LLMs.txt for a given URL and polls until completion.
|
|
616
|
+
* @param url - The URL to generate LLMs.txt from.
|
|
617
|
+
* @param params - Parameters for the LLMs.txt generation operation.
|
|
618
|
+
* @returns The final generation results.
|
|
619
|
+
*/
|
|
620
|
+
generateLLMsText(url: string, params?: GenerateLLMsTextParams): Promise<GenerateLLMsTextStatusResponse | ErrorResponse>;
|
|
621
|
+
/**
|
|
622
|
+
* Initiates a LLMs.txt generation operation without polling.
|
|
623
|
+
* @param url - The URL to generate LLMs.txt from.
|
|
624
|
+
* @param params - Parameters for the LLMs.txt generation operation.
|
|
625
|
+
* @returns The response containing the generation job ID.
|
|
626
|
+
*/
|
|
627
|
+
asyncGenerateLLMsText(url: string, params?: GenerateLLMsTextParams): Promise<GenerateLLMsTextResponse | ErrorResponse>;
|
|
628
|
+
/**
|
|
629
|
+
* Checks the status of a LLMs.txt generation operation.
|
|
630
|
+
* @param id - The ID of the LLMs.txt generation operation.
|
|
631
|
+
* @returns The current status and results of the generation operation.
|
|
632
|
+
*/
|
|
633
|
+
checkGenerateLLMsTextStatus(id: string): Promise<GenerateLLMsTextStatusResponse | ErrorResponse>;
|
|
430
634
|
}
|
|
431
635
|
interface CrawlWatcherEvents {
|
|
432
636
|
document: CustomEvent<FirecrawlDocument<undefined>>;
|
|
@@ -449,4 +653,4 @@ declare class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
|
|
|
449
653
|
close(): void;
|
|
450
654
|
}
|
|
451
655
|
|
|
452
|
-
export { type Action, type ActionsResult, type BatchScrapeResponse, type BatchScrapeStatusResponse, type CrawlParams, type CrawlResponse, type CrawlScrapeOptions, type CrawlStatusResponse, CrawlWatcher, type ErrorResponse, type ExtractParams, type ExtractResponse, type FirecrawlAppConfig, type FirecrawlDocument, type FirecrawlDocumentMetadata, FirecrawlError, type MapParams, type MapResponse, type ScrapeParams, type ScrapeResponse, type SearchParams, type SearchResponse, FirecrawlApp as default };
|
|
656
|
+
export { type Action, type ActionsResult, type BatchScrapeResponse, type BatchScrapeStatusResponse, type CrawlErrorsResponse, type CrawlParams, type CrawlResponse, type CrawlScrapeOptions, type CrawlStatusResponse, CrawlWatcher, type DeepResearchParams, type DeepResearchResponse, type DeepResearchStatusResponse, type ErrorResponse, type ExtractParams, type ExtractResponse, type FirecrawlAppConfig, type FirecrawlDocument, type FirecrawlDocumentMetadata, FirecrawlError, type GenerateLLMsTextParams, type GenerateLLMsTextResponse, type GenerateLLMsTextStatusResponse, type MapParams, type MapResponse, type ScrapeParams, type ScrapeResponse, type SearchParams, type SearchResponse, FirecrawlApp as default };
|