firecrawl 4.32.0 → 4.32.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/README.md +67 -0
- package/dist/{chunk-DBXKWZGC.js → chunk-GWKNKKE4.js} +17 -3
- package/dist/index.cjs +47 -11
- package/dist/index.d.cts +108 -15
- package/dist/index.d.ts +108 -15
- package/dist/index.js +32 -10
- package/dist/{package-L37ZVTF4.js → package-RCEGXLHV.js} +1 -1
- package/package.json +17 -3
- package/pnpm-workspace.yaml +3 -2
- package/src/v1/index.ts +3 -3
- package/src/v2/client.ts +13 -2
- package/src/v2/methods/research.ts +38 -6
- package/src/v2/types.ts +54 -4
package/README.md
CHANGED
|
@@ -166,6 +166,73 @@ const mapResult = await app.map('https://example.com');
|
|
|
166
166
|
console.log(mapResult);
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
+
### Search
|
|
170
|
+
|
|
171
|
+
Use `search` to search the web and optionally scrape the results in the same call.
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
const results = await app.search('what is retrieval augmented generation?', { limit: 5 });
|
|
175
|
+
for (const result of results.web ?? []) {
|
|
176
|
+
console.log(result.url, '-', result.title);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Scrape every result as part of the search:
|
|
180
|
+
const scraped = await app.search('firecrawl changelog', {
|
|
181
|
+
limit: 3,
|
|
182
|
+
scrapeOptions: { formats: ['markdown'] },
|
|
183
|
+
});
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Results are grouped by source: `.web`, `.news`, `.images` and `.developer`.
|
|
187
|
+
|
|
188
|
+
Use `categories` to narrow web search to a kind of site:
|
|
189
|
+
|
|
190
|
+
```js
|
|
191
|
+
const results = await app.search('nanopore basecalling accuracy', {
|
|
192
|
+
categories: ['research'],
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
> **`categories: ['research']` is a website filter, not the paper index.** It
|
|
197
|
+
> restricts ordinary web search to roughly 14 academic domains (arxiv.org,
|
|
198
|
+
> pubmed.ncbi.nlm.nih.gov, nature.com, biorxiv.org, ...) and returns web page
|
|
199
|
+
> results. To search papers themselves, use `research.searchPapers` below.
|
|
200
|
+
|
|
201
|
+
### Research / paper search
|
|
202
|
+
|
|
203
|
+
Use `app.research` to search Firecrawl's research paper index: ~43M paper
|
|
204
|
+
abstracts, roughly 90% biomedical and life sciences (PubMed, bioRxiv, medRxiv),
|
|
205
|
+
plus arXiv for physics, mathematics and computer science.
|
|
206
|
+
|
|
207
|
+
```js
|
|
208
|
+
// Search the paper index (semantic search over abstracts):
|
|
209
|
+
const papers = await app.research.searchPapers(
|
|
210
|
+
'CRISPR base editing off-target effects in primary human T cells',
|
|
211
|
+
{ k: 10 },
|
|
212
|
+
);
|
|
213
|
+
for (const paper of papers.results) {
|
|
214
|
+
console.log(paper.primaryId, '-', paper.title);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Inspect one paper's metadata (accepts pmid:, pmcid:, doi: or arxiv: ids):
|
|
218
|
+
const paper = await app.research.getPaper('pmid:<id>');
|
|
219
|
+
|
|
220
|
+
// Read the passages inside a paper that answer a specific question:
|
|
221
|
+
const read = await app.research.getPaper('pmid:<id>', {
|
|
222
|
+
query: 'what was the primary endpoint and the reported hazard ratio?',
|
|
223
|
+
k: 4,
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// Expand along the citation graph, re-ranked for your stated intent:
|
|
227
|
+
const related = await app.research.similarPapers('pmid:<id>', {
|
|
228
|
+
intent: 'replication attempts in larger cohorts',
|
|
229
|
+
k: 20,
|
|
230
|
+
});
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
A companion `app.research.searchGithub` searches indexed GitHub issue/PR history
|
|
234
|
+
and repository readmes.
|
|
235
|
+
|
|
169
236
|
### Scrape-bound interactive browsing (v2)
|
|
170
237
|
|
|
171
238
|
Use a scrape job ID to keep interacting with the replayed browser context:
|
|
@@ -12,8 +12,8 @@ var require_package = __commonJS({
|
|
|
12
12
|
"package.json"(exports, module) {
|
|
13
13
|
module.exports = {
|
|
14
14
|
name: "@mendable/firecrawl-js",
|
|
15
|
-
version: "4.32.
|
|
16
|
-
description: "JavaScript SDK for Firecrawl API",
|
|
15
|
+
version: "4.32.2",
|
|
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",
|
|
19
19
|
exports: {
|
|
@@ -69,7 +69,21 @@ var require_package = __commonJS({
|
|
|
69
69
|
"web",
|
|
70
70
|
"scraper",
|
|
71
71
|
"api",
|
|
72
|
-
"sdk"
|
|
72
|
+
"sdk",
|
|
73
|
+
"web-search",
|
|
74
|
+
"literature-search",
|
|
75
|
+
"research",
|
|
76
|
+
"scientific-papers",
|
|
77
|
+
"academic-search",
|
|
78
|
+
"biomedical",
|
|
79
|
+
"life-sciences",
|
|
80
|
+
"pubmed",
|
|
81
|
+
"biorxiv",
|
|
82
|
+
"medrxiv",
|
|
83
|
+
"arxiv",
|
|
84
|
+
"preprints",
|
|
85
|
+
"citations",
|
|
86
|
+
"bioinformatics"
|
|
73
87
|
],
|
|
74
88
|
engines: {
|
|
75
89
|
node: ">=22.0.0"
|
package/dist/index.cjs
CHANGED
|
@@ -39,8 +39,8 @@ var require_package = __commonJS({
|
|
|
39
39
|
"package.json"(exports2, module2) {
|
|
40
40
|
module2.exports = {
|
|
41
41
|
name: "@mendable/firecrawl-js",
|
|
42
|
-
version: "4.32.
|
|
43
|
-
description: "JavaScript SDK for Firecrawl API",
|
|
42
|
+
version: "4.32.2",
|
|
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",
|
|
46
46
|
exports: {
|
|
@@ -96,7 +96,21 @@ var require_package = __commonJS({
|
|
|
96
96
|
"web",
|
|
97
97
|
"scraper",
|
|
98
98
|
"api",
|
|
99
|
-
"sdk"
|
|
99
|
+
"sdk",
|
|
100
|
+
"web-search",
|
|
101
|
+
"literature-search",
|
|
102
|
+
"research",
|
|
103
|
+
"scientific-papers",
|
|
104
|
+
"academic-search",
|
|
105
|
+
"biomedical",
|
|
106
|
+
"life-sciences",
|
|
107
|
+
"pubmed",
|
|
108
|
+
"biorxiv",
|
|
109
|
+
"medrxiv",
|
|
110
|
+
"arxiv",
|
|
111
|
+
"preprints",
|
|
112
|
+
"citations",
|
|
113
|
+
"bioinformatics"
|
|
100
114
|
],
|
|
101
115
|
engines: {
|
|
102
116
|
node: ">=22.0.0"
|
|
@@ -1519,9 +1533,20 @@ var ResearchClient = class {
|
|
|
1519
1533
|
}
|
|
1520
1534
|
http;
|
|
1521
1535
|
/**
|
|
1522
|
-
* Search
|
|
1523
|
-
*
|
|
1524
|
-
*
|
|
1536
|
+
* Search the research paper index by abstract relevance.
|
|
1537
|
+
*
|
|
1538
|
+
* Queries ~43M paper abstracts: PubMed, bioRxiv and medRxiv (about 90% of the
|
|
1539
|
+
* corpus — biomedical and life sciences) plus arXiv (physics, mathematics,
|
|
1540
|
+
* computer science). Semantic search over abstracts, not keyword matching.
|
|
1541
|
+
*
|
|
1542
|
+
* This is **not** `search({ categories: ["research"] })`, which only narrows
|
|
1543
|
+
* ordinary web search to ~14 academic websites.
|
|
1544
|
+
*
|
|
1545
|
+
* @param query Natural-language search query, e.g. `"CRISPR base editing
|
|
1546
|
+
* off-target effects in primary human T cells"`.
|
|
1547
|
+
* @param options Optional filters (k, authors, categories, from, to). Note
|
|
1548
|
+
* `categories` here filters *paper* subject categories (e.g. `"q-bio.GN"`)
|
|
1549
|
+
* and is unrelated to the `categories` option of `search()`.
|
|
1525
1550
|
*/
|
|
1526
1551
|
async searchPapers(query, options = {}) {
|
|
1527
1552
|
if (!query || !query.trim()) throw new Error("query cannot be empty");
|
|
@@ -2071,8 +2096,19 @@ var FirecrawlClient = class {
|
|
|
2071
2096
|
}
|
|
2072
2097
|
// Research
|
|
2073
2098
|
/**
|
|
2074
|
-
* Access the v2 research endpoints
|
|
2075
|
-
*
|
|
2099
|
+
* Access the v2 research endpoints — Firecrawl's **research paper index**
|
|
2100
|
+
* (~43M paper abstracts) plus GitHub history/readmes.
|
|
2101
|
+
*
|
|
2102
|
+
* The paper corpus is roughly 90% biomedical and life sciences — PubMed,
|
|
2103
|
+
* bioRxiv and medRxiv — with arXiv covering physics, mathematics and
|
|
2104
|
+
* computer science.
|
|
2105
|
+
*
|
|
2106
|
+
* ⚠️ Not the same as `search({ categories: ["research"] })`, which is only a
|
|
2107
|
+
* website/domain filter over ordinary web search (~14 academic domains,
|
|
2108
|
+
* returning page snippets). Use `research.searchPapers()` for literature
|
|
2109
|
+
* search.
|
|
2110
|
+
*
|
|
2111
|
+
* Example: `firecrawl.research.searchPapers("GLP-1 receptor agonists cardiovascular outcomes")`.
|
|
2076
2112
|
*/
|
|
2077
2113
|
get research() {
|
|
2078
2114
|
if (!this._research) this._research = new ResearchClient(this.http);
|
|
@@ -3263,7 +3299,7 @@ var FirecrawlApp = class {
|
|
|
3263
3299
|
* @param onActivity - Optional callback to receive activity updates in real-time.
|
|
3264
3300
|
* @param onSource - Optional callback to receive source updates in real-time.
|
|
3265
3301
|
* @returns The final research results.
|
|
3266
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
3302
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
3267
3303
|
*/
|
|
3268
3304
|
async deepResearch(query, params, onActivity, onSource) {
|
|
3269
3305
|
try {
|
|
@@ -3320,7 +3356,7 @@ var FirecrawlApp = class {
|
|
|
3320
3356
|
* Initiates a deep research operation on a given query without polling.
|
|
3321
3357
|
* @param params - Parameters for the deep research operation.
|
|
3322
3358
|
* @returns The response containing the research job ID.
|
|
3323
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
3359
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
3324
3360
|
*/
|
|
3325
3361
|
async asyncDeepResearch(query, params) {
|
|
3326
3362
|
const headers = this.prepareHeaders();
|
|
@@ -3358,7 +3394,7 @@ var FirecrawlApp = class {
|
|
|
3358
3394
|
* Checks the status of a deep research operation.
|
|
3359
3395
|
* @param id - The ID of the deep research operation.
|
|
3360
3396
|
* @returns The current status and results of the research operation.
|
|
3361
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
3397
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
3362
3398
|
*/
|
|
3363
3399
|
async checkDeepResearchStatus(id) {
|
|
3364
3400
|
const headers = this.prepareHeaders();
|
package/dist/index.d.cts
CHANGED
|
@@ -139,6 +139,10 @@ interface ScrapeOptions {
|
|
|
139
139
|
useMock?: string;
|
|
140
140
|
blockAds?: boolean;
|
|
141
141
|
proxy?: "basic" | "stealth" | "enhanced" | "auto" | string;
|
|
142
|
+
/**
|
|
143
|
+
* Maximum age, in milliseconds, of indexed content that may be reused.
|
|
144
|
+
* Set to `0` to bypass index reuse.
|
|
145
|
+
*/
|
|
142
146
|
maxAge?: number;
|
|
143
147
|
minAge?: number;
|
|
144
148
|
storeInCache?: boolean;
|
|
@@ -215,6 +219,7 @@ interface AgentWebhookConfig {
|
|
|
215
219
|
}
|
|
216
220
|
interface BrandingProfile {
|
|
217
221
|
colorScheme?: "light" | "dark";
|
|
222
|
+
brandName?: string;
|
|
218
223
|
logo?: string | null;
|
|
219
224
|
fonts?: Array<{
|
|
220
225
|
family: string;
|
|
@@ -423,6 +428,7 @@ interface MenuProfile {
|
|
|
423
428
|
interface DocumentMetadata {
|
|
424
429
|
title?: string;
|
|
425
430
|
description?: string;
|
|
431
|
+
/** URL reported by the selected scrape engine. */
|
|
426
432
|
url?: string;
|
|
427
433
|
language?: string;
|
|
428
434
|
keywords?: string | string[];
|
|
@@ -452,7 +458,9 @@ interface DocumentMetadata {
|
|
|
452
458
|
publishedTime?: string;
|
|
453
459
|
articleTag?: string;
|
|
454
460
|
articleSection?: string;
|
|
461
|
+
/** URL requested for the scrape. */
|
|
455
462
|
sourceURL?: string;
|
|
463
|
+
/** HTTP status code reported for the scrape response. */
|
|
456
464
|
statusCode?: number;
|
|
457
465
|
scrapeId?: string;
|
|
458
466
|
numPages?: number;
|
|
@@ -534,6 +542,28 @@ interface SearchData {
|
|
|
534
542
|
images?: Array<SearchResultImages | Document>;
|
|
535
543
|
developer?: Array<SearchResultWeb | Document>;
|
|
536
544
|
}
|
|
545
|
+
/**
|
|
546
|
+
* Narrows ordinary **web search**. A category does not switch `search()` to a
|
|
547
|
+
* different index.
|
|
548
|
+
*
|
|
549
|
+
* - `github` — restrict web results to github.com (a `site:` filter).
|
|
550
|
+
* - `research` — restrict web results to a fixed list of ~14 academic
|
|
551
|
+
* *websites* (arxiv.org, pubmed.ncbi.nlm.nih.gov, nature.com, science.org,
|
|
552
|
+
* ieee.org, sciencedirect.com, biorxiv.org, medrxiv.org, ...). It returns
|
|
553
|
+
* ordinary web page results from those domains, **not** paper records.
|
|
554
|
+
* - `pdf` — restrict results to PDFs (adds `filetype:pdf`).
|
|
555
|
+
* - `developer` — add developer results (issues, pull requests, READMEs and
|
|
556
|
+
* documentation) under `.developer`.
|
|
557
|
+
*
|
|
558
|
+
* ⚠️ `categories: ["research"]` is **not** Firecrawl's research paper index.
|
|
559
|
+
* To search papers themselves — ~43M abstracts, roughly 90% biomedical
|
|
560
|
+
* (PubMed, bioRxiv, medRxiv) plus arXiv — with full abstracts, in-body passage
|
|
561
|
+
* reads and citation-graph expansion, use `firecrawl.research.searchPapers()`
|
|
562
|
+
* (plus `getPaper()` and `similarPapers()`), which call `/v2/search/research`.
|
|
563
|
+
*
|
|
564
|
+
* Rule of thumb: literature search → `research.searchPapers()`; web pages that
|
|
565
|
+
* happen to live on academic domains → `search({ categories: ["research"] })`.
|
|
566
|
+
*/
|
|
537
567
|
interface CategoryOption {
|
|
538
568
|
type: "github" | "research" | "pdf" | "developer";
|
|
539
569
|
}
|
|
@@ -542,6 +572,14 @@ interface SearchRequest {
|
|
|
542
572
|
sources?: Array<"web" | "news" | "images" | {
|
|
543
573
|
type: "web" | "news" | "images";
|
|
544
574
|
}>;
|
|
575
|
+
/**
|
|
576
|
+
* Narrow web search by category. See {@link CategoryOption}.
|
|
577
|
+
*
|
|
578
|
+
* ⚠️ `"research"` is a website/domain filter over ordinary web search (~14
|
|
579
|
+
* academic domains), **not** the research paper index. For literature search
|
|
580
|
+
* over ~43M paper abstracts (PubMed / bioRxiv / medRxiv / arXiv) use
|
|
581
|
+
* `firecrawl.research.searchPapers()` instead.
|
|
582
|
+
*/
|
|
545
583
|
categories?: Array<"github" | "research" | "pdf" | "developer" | CategoryOption>;
|
|
546
584
|
includeDomains?: string[];
|
|
547
585
|
excludeDomains?: string[];
|
|
@@ -1088,8 +1126,20 @@ interface BrowserListResponse {
|
|
|
1088
1126
|
error?: string;
|
|
1089
1127
|
}
|
|
1090
1128
|
/**
|
|
1091
|
-
* Source identifiers grouped by namespace.
|
|
1092
|
-
*
|
|
1129
|
+
* Source identifiers grouped by namespace. Each key is a namespace and each
|
|
1130
|
+
* value is an array of ids in that namespace.
|
|
1131
|
+
*
|
|
1132
|
+
* Which namespaces appear depends on the paper's source. Biomedical records
|
|
1133
|
+
* (PubMed, bioRxiv, medRxiv) typically carry `pmid`, `pmcid` and/or `doi`;
|
|
1134
|
+
* arXiv records carry `arxiv`. The set is open — treat this as a lookup by
|
|
1135
|
+
* namespace rather than a fixed schema, and prefer {@link PaperResult.primaryId}
|
|
1136
|
+
* when you just need one citable identifier.
|
|
1137
|
+
*
|
|
1138
|
+
* @example
|
|
1139
|
+
* ```ts
|
|
1140
|
+
* const doi = paper.ids?.doi?.[0];
|
|
1141
|
+
* const pmid = paper.ids?.pmid?.[0];
|
|
1142
|
+
* ```
|
|
1093
1143
|
*/
|
|
1094
1144
|
type IdMap = Record<string, string[]>;
|
|
1095
1145
|
/** Per-candidate ranking signals (present on similarity results). */
|
|
@@ -1103,7 +1153,7 @@ interface PaperSignals {
|
|
|
1103
1153
|
/** Number of distinct seeds connected to this candidate. */
|
|
1104
1154
|
seedOverlap: number;
|
|
1105
1155
|
}
|
|
1106
|
-
/** A ranked paper. `paperId` is canonical;
|
|
1156
|
+
/** A ranked paper. `paperId` is canonical; source ids (pmid, pmcid, doi, arxiv, ...) live in `ids`. */
|
|
1107
1157
|
interface PaperResult {
|
|
1108
1158
|
/** Canonical paper id — the Milvus INT64 primary key as a decimal string. */
|
|
1109
1159
|
paperId: string;
|
|
@@ -1175,7 +1225,7 @@ interface GitHubScoreBreakdown {
|
|
|
1175
1225
|
rerank?: number;
|
|
1176
1226
|
}
|
|
1177
1227
|
interface GitHubSearchItem {
|
|
1178
|
-
resultType
|
|
1228
|
+
resultType?: "github_history" | "repo_readme" | "web";
|
|
1179
1229
|
/** `owner/name`; empty for web results whose URL is not a repo page. */
|
|
1180
1230
|
repo: string;
|
|
1181
1231
|
url: string;
|
|
@@ -1326,23 +1376,55 @@ declare function listBrowsers(http: HttpClient, args?: {
|
|
|
1326
1376
|
}): Promise<BrowserListResponse>;
|
|
1327
1377
|
|
|
1328
1378
|
/**
|
|
1329
|
-
* Client for the v2 research endpoints
|
|
1379
|
+
* Client for the v2 research endpoints — Firecrawl's **research paper index**
|
|
1380
|
+
* (~43M paper abstracts) plus GitHub history/readmes.
|
|
1381
|
+
*
|
|
1382
|
+
* The paper corpus is roughly 90% biomedical and life sciences — PubMed,
|
|
1383
|
+
* bioRxiv and medRxiv — with arXiv covering physics, mathematics and computer
|
|
1384
|
+
* science. Supports abstract search, paper metadata, in-body passage reads and
|
|
1385
|
+
* citation-graph expansion.
|
|
1386
|
+
*
|
|
1387
|
+
* ⚠️ This is **not** the same as `search({ categories: ["research"] })`. That
|
|
1388
|
+
* option is a website/domain filter on ordinary web search: it narrows
|
|
1389
|
+
* Google-style results to ~14 academic domains and returns page snippets. The
|
|
1390
|
+
* methods here query the paper index itself and return ranked paper records.
|
|
1391
|
+
*
|
|
1330
1392
|
* Accessed via `firecrawl.research`.
|
|
1393
|
+
*
|
|
1394
|
+
* @example
|
|
1395
|
+
* ```ts
|
|
1396
|
+
* const res = await firecrawl.research.searchPapers(
|
|
1397
|
+
* "tau aggregation inhibitors in Alzheimer's disease",
|
|
1398
|
+
* { k: 10 },
|
|
1399
|
+
* );
|
|
1400
|
+
* ```
|
|
1331
1401
|
*/
|
|
1332
1402
|
declare class ResearchClient {
|
|
1333
1403
|
private readonly http;
|
|
1334
1404
|
constructor(http: HttpClient);
|
|
1335
1405
|
/**
|
|
1336
|
-
* Search
|
|
1337
|
-
*
|
|
1338
|
-
*
|
|
1406
|
+
* Search the research paper index by abstract relevance.
|
|
1407
|
+
*
|
|
1408
|
+
* Queries ~43M paper abstracts: PubMed, bioRxiv and medRxiv (about 90% of the
|
|
1409
|
+
* corpus — biomedical and life sciences) plus arXiv (physics, mathematics,
|
|
1410
|
+
* computer science). Semantic search over abstracts, not keyword matching.
|
|
1411
|
+
*
|
|
1412
|
+
* This is **not** `search({ categories: ["research"] })`, which only narrows
|
|
1413
|
+
* ordinary web search to ~14 academic websites.
|
|
1414
|
+
*
|
|
1415
|
+
* @param query Natural-language search query, e.g. `"CRISPR base editing
|
|
1416
|
+
* off-target effects in primary human T cells"`.
|
|
1417
|
+
* @param options Optional filters (k, authors, categories, from, to). Note
|
|
1418
|
+
* `categories` here filters *paper* subject categories (e.g. `"q-bio.GN"`)
|
|
1419
|
+
* and is unrelated to the `categories` option of `search()`.
|
|
1339
1420
|
*/
|
|
1340
1421
|
searchPapers(query: string, options?: SearchPapersOptions): Promise<SearchPapersResponse>;
|
|
1341
1422
|
/**
|
|
1342
1423
|
* Get paper metadata (detail mode), or read in-body passages (when `query` is
|
|
1343
1424
|
* supplied). `k` is only valid together with `query`.
|
|
1344
|
-
* @param id Paper reference: a canonical `
|
|
1345
|
-
*
|
|
1425
|
+
* @param id Paper reference: a canonical `paperId`, or a namespaced id key
|
|
1426
|
+
* such as `pmid:<id>`, `pmcid:<id>`, `doi:<doi>` or `arxiv:<id>`. Bare
|
|
1427
|
+
* arXiv ids and arXiv URLs are also accepted.
|
|
1346
1428
|
* @param options Optional `query` (switches to read mode) and `k`.
|
|
1347
1429
|
*/
|
|
1348
1430
|
getPaper(id: string, options?: {
|
|
@@ -1497,8 +1579,19 @@ declare class FirecrawlClient {
|
|
|
1497
1579
|
*/
|
|
1498
1580
|
searchFeedback(jobId: string, request: SearchFeedbackRequest): Promise<FeedbackResponse>;
|
|
1499
1581
|
/**
|
|
1500
|
-
* Access the v2 research endpoints
|
|
1501
|
-
*
|
|
1582
|
+
* Access the v2 research endpoints — Firecrawl's **research paper index**
|
|
1583
|
+
* (~43M paper abstracts) plus GitHub history/readmes.
|
|
1584
|
+
*
|
|
1585
|
+
* The paper corpus is roughly 90% biomedical and life sciences — PubMed,
|
|
1586
|
+
* bioRxiv and medRxiv — with arXiv covering physics, mathematics and
|
|
1587
|
+
* computer science.
|
|
1588
|
+
*
|
|
1589
|
+
* ⚠️ Not the same as `search({ categories: ["research"] })`, which is only a
|
|
1590
|
+
* website/domain filter over ordinary web search (~14 academic domains,
|
|
1591
|
+
* returning page snippets). Use `research.searchPapers()` for literature
|
|
1592
|
+
* search.
|
|
1593
|
+
*
|
|
1594
|
+
* Example: `firecrawl.research.searchPapers("GLP-1 receptor agonists cardiovascular outcomes")`.
|
|
1502
1595
|
*/
|
|
1503
1596
|
get research(): ResearchClient;
|
|
1504
1597
|
/**
|
|
@@ -2527,7 +2620,7 @@ declare class FirecrawlApp {
|
|
|
2527
2620
|
* @param onActivity - Optional callback to receive activity updates in real-time.
|
|
2528
2621
|
* @param onSource - Optional callback to receive source updates in real-time.
|
|
2529
2622
|
* @returns The final research results.
|
|
2530
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
2623
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
2531
2624
|
*/
|
|
2532
2625
|
deepResearch(query: string, params: DeepResearchParams<zt.ZodSchema>, onActivity?: (activity: {
|
|
2533
2626
|
type: string;
|
|
@@ -2545,14 +2638,14 @@ declare class FirecrawlApp {
|
|
|
2545
2638
|
* Initiates a deep research operation on a given query without polling.
|
|
2546
2639
|
* @param params - Parameters for the deep research operation.
|
|
2547
2640
|
* @returns The response containing the research job ID.
|
|
2548
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
2641
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
2549
2642
|
*/
|
|
2550
2643
|
asyncDeepResearch(query: string, params: DeepResearchParams<zt.ZodSchema>): Promise<DeepResearchResponse | ErrorResponse>;
|
|
2551
2644
|
/**
|
|
2552
2645
|
* Checks the status of a deep research operation.
|
|
2553
2646
|
* @param id - The ID of the deep research operation.
|
|
2554
2647
|
* @returns The current status and results of the research operation.
|
|
2555
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
2648
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
2556
2649
|
*/
|
|
2557
2650
|
checkDeepResearchStatus(id: string): Promise<DeepResearchStatusResponse | ErrorResponse>;
|
|
2558
2651
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -139,6 +139,10 @@ interface ScrapeOptions {
|
|
|
139
139
|
useMock?: string;
|
|
140
140
|
blockAds?: boolean;
|
|
141
141
|
proxy?: "basic" | "stealth" | "enhanced" | "auto" | string;
|
|
142
|
+
/**
|
|
143
|
+
* Maximum age, in milliseconds, of indexed content that may be reused.
|
|
144
|
+
* Set to `0` to bypass index reuse.
|
|
145
|
+
*/
|
|
142
146
|
maxAge?: number;
|
|
143
147
|
minAge?: number;
|
|
144
148
|
storeInCache?: boolean;
|
|
@@ -215,6 +219,7 @@ interface AgentWebhookConfig {
|
|
|
215
219
|
}
|
|
216
220
|
interface BrandingProfile {
|
|
217
221
|
colorScheme?: "light" | "dark";
|
|
222
|
+
brandName?: string;
|
|
218
223
|
logo?: string | null;
|
|
219
224
|
fonts?: Array<{
|
|
220
225
|
family: string;
|
|
@@ -423,6 +428,7 @@ interface MenuProfile {
|
|
|
423
428
|
interface DocumentMetadata {
|
|
424
429
|
title?: string;
|
|
425
430
|
description?: string;
|
|
431
|
+
/** URL reported by the selected scrape engine. */
|
|
426
432
|
url?: string;
|
|
427
433
|
language?: string;
|
|
428
434
|
keywords?: string | string[];
|
|
@@ -452,7 +458,9 @@ interface DocumentMetadata {
|
|
|
452
458
|
publishedTime?: string;
|
|
453
459
|
articleTag?: string;
|
|
454
460
|
articleSection?: string;
|
|
461
|
+
/** URL requested for the scrape. */
|
|
455
462
|
sourceURL?: string;
|
|
463
|
+
/** HTTP status code reported for the scrape response. */
|
|
456
464
|
statusCode?: number;
|
|
457
465
|
scrapeId?: string;
|
|
458
466
|
numPages?: number;
|
|
@@ -534,6 +542,28 @@ interface SearchData {
|
|
|
534
542
|
images?: Array<SearchResultImages | Document>;
|
|
535
543
|
developer?: Array<SearchResultWeb | Document>;
|
|
536
544
|
}
|
|
545
|
+
/**
|
|
546
|
+
* Narrows ordinary **web search**. A category does not switch `search()` to a
|
|
547
|
+
* different index.
|
|
548
|
+
*
|
|
549
|
+
* - `github` — restrict web results to github.com (a `site:` filter).
|
|
550
|
+
* - `research` — restrict web results to a fixed list of ~14 academic
|
|
551
|
+
* *websites* (arxiv.org, pubmed.ncbi.nlm.nih.gov, nature.com, science.org,
|
|
552
|
+
* ieee.org, sciencedirect.com, biorxiv.org, medrxiv.org, ...). It returns
|
|
553
|
+
* ordinary web page results from those domains, **not** paper records.
|
|
554
|
+
* - `pdf` — restrict results to PDFs (adds `filetype:pdf`).
|
|
555
|
+
* - `developer` — add developer results (issues, pull requests, READMEs and
|
|
556
|
+
* documentation) under `.developer`.
|
|
557
|
+
*
|
|
558
|
+
* ⚠️ `categories: ["research"]` is **not** Firecrawl's research paper index.
|
|
559
|
+
* To search papers themselves — ~43M abstracts, roughly 90% biomedical
|
|
560
|
+
* (PubMed, bioRxiv, medRxiv) plus arXiv — with full abstracts, in-body passage
|
|
561
|
+
* reads and citation-graph expansion, use `firecrawl.research.searchPapers()`
|
|
562
|
+
* (plus `getPaper()` and `similarPapers()`), which call `/v2/search/research`.
|
|
563
|
+
*
|
|
564
|
+
* Rule of thumb: literature search → `research.searchPapers()`; web pages that
|
|
565
|
+
* happen to live on academic domains → `search({ categories: ["research"] })`.
|
|
566
|
+
*/
|
|
537
567
|
interface CategoryOption {
|
|
538
568
|
type: "github" | "research" | "pdf" | "developer";
|
|
539
569
|
}
|
|
@@ -542,6 +572,14 @@ interface SearchRequest {
|
|
|
542
572
|
sources?: Array<"web" | "news" | "images" | {
|
|
543
573
|
type: "web" | "news" | "images";
|
|
544
574
|
}>;
|
|
575
|
+
/**
|
|
576
|
+
* Narrow web search by category. See {@link CategoryOption}.
|
|
577
|
+
*
|
|
578
|
+
* ⚠️ `"research"` is a website/domain filter over ordinary web search (~14
|
|
579
|
+
* academic domains), **not** the research paper index. For literature search
|
|
580
|
+
* over ~43M paper abstracts (PubMed / bioRxiv / medRxiv / arXiv) use
|
|
581
|
+
* `firecrawl.research.searchPapers()` instead.
|
|
582
|
+
*/
|
|
545
583
|
categories?: Array<"github" | "research" | "pdf" | "developer" | CategoryOption>;
|
|
546
584
|
includeDomains?: string[];
|
|
547
585
|
excludeDomains?: string[];
|
|
@@ -1088,8 +1126,20 @@ interface BrowserListResponse {
|
|
|
1088
1126
|
error?: string;
|
|
1089
1127
|
}
|
|
1090
1128
|
/**
|
|
1091
|
-
* Source identifiers grouped by namespace.
|
|
1092
|
-
*
|
|
1129
|
+
* Source identifiers grouped by namespace. Each key is a namespace and each
|
|
1130
|
+
* value is an array of ids in that namespace.
|
|
1131
|
+
*
|
|
1132
|
+
* Which namespaces appear depends on the paper's source. Biomedical records
|
|
1133
|
+
* (PubMed, bioRxiv, medRxiv) typically carry `pmid`, `pmcid` and/or `doi`;
|
|
1134
|
+
* arXiv records carry `arxiv`. The set is open — treat this as a lookup by
|
|
1135
|
+
* namespace rather than a fixed schema, and prefer {@link PaperResult.primaryId}
|
|
1136
|
+
* when you just need one citable identifier.
|
|
1137
|
+
*
|
|
1138
|
+
* @example
|
|
1139
|
+
* ```ts
|
|
1140
|
+
* const doi = paper.ids?.doi?.[0];
|
|
1141
|
+
* const pmid = paper.ids?.pmid?.[0];
|
|
1142
|
+
* ```
|
|
1093
1143
|
*/
|
|
1094
1144
|
type IdMap = Record<string, string[]>;
|
|
1095
1145
|
/** Per-candidate ranking signals (present on similarity results). */
|
|
@@ -1103,7 +1153,7 @@ interface PaperSignals {
|
|
|
1103
1153
|
/** Number of distinct seeds connected to this candidate. */
|
|
1104
1154
|
seedOverlap: number;
|
|
1105
1155
|
}
|
|
1106
|
-
/** A ranked paper. `paperId` is canonical;
|
|
1156
|
+
/** A ranked paper. `paperId` is canonical; source ids (pmid, pmcid, doi, arxiv, ...) live in `ids`. */
|
|
1107
1157
|
interface PaperResult {
|
|
1108
1158
|
/** Canonical paper id — the Milvus INT64 primary key as a decimal string. */
|
|
1109
1159
|
paperId: string;
|
|
@@ -1175,7 +1225,7 @@ interface GitHubScoreBreakdown {
|
|
|
1175
1225
|
rerank?: number;
|
|
1176
1226
|
}
|
|
1177
1227
|
interface GitHubSearchItem {
|
|
1178
|
-
resultType
|
|
1228
|
+
resultType?: "github_history" | "repo_readme" | "web";
|
|
1179
1229
|
/** `owner/name`; empty for web results whose URL is not a repo page. */
|
|
1180
1230
|
repo: string;
|
|
1181
1231
|
url: string;
|
|
@@ -1326,23 +1376,55 @@ declare function listBrowsers(http: HttpClient, args?: {
|
|
|
1326
1376
|
}): Promise<BrowserListResponse>;
|
|
1327
1377
|
|
|
1328
1378
|
/**
|
|
1329
|
-
* Client for the v2 research endpoints
|
|
1379
|
+
* Client for the v2 research endpoints — Firecrawl's **research paper index**
|
|
1380
|
+
* (~43M paper abstracts) plus GitHub history/readmes.
|
|
1381
|
+
*
|
|
1382
|
+
* The paper corpus is roughly 90% biomedical and life sciences — PubMed,
|
|
1383
|
+
* bioRxiv and medRxiv — with arXiv covering physics, mathematics and computer
|
|
1384
|
+
* science. Supports abstract search, paper metadata, in-body passage reads and
|
|
1385
|
+
* citation-graph expansion.
|
|
1386
|
+
*
|
|
1387
|
+
* ⚠️ This is **not** the same as `search({ categories: ["research"] })`. That
|
|
1388
|
+
* option is a website/domain filter on ordinary web search: it narrows
|
|
1389
|
+
* Google-style results to ~14 academic domains and returns page snippets. The
|
|
1390
|
+
* methods here query the paper index itself and return ranked paper records.
|
|
1391
|
+
*
|
|
1330
1392
|
* Accessed via `firecrawl.research`.
|
|
1393
|
+
*
|
|
1394
|
+
* @example
|
|
1395
|
+
* ```ts
|
|
1396
|
+
* const res = await firecrawl.research.searchPapers(
|
|
1397
|
+
* "tau aggregation inhibitors in Alzheimer's disease",
|
|
1398
|
+
* { k: 10 },
|
|
1399
|
+
* );
|
|
1400
|
+
* ```
|
|
1331
1401
|
*/
|
|
1332
1402
|
declare class ResearchClient {
|
|
1333
1403
|
private readonly http;
|
|
1334
1404
|
constructor(http: HttpClient);
|
|
1335
1405
|
/**
|
|
1336
|
-
* Search
|
|
1337
|
-
*
|
|
1338
|
-
*
|
|
1406
|
+
* Search the research paper index by abstract relevance.
|
|
1407
|
+
*
|
|
1408
|
+
* Queries ~43M paper abstracts: PubMed, bioRxiv and medRxiv (about 90% of the
|
|
1409
|
+
* corpus — biomedical and life sciences) plus arXiv (physics, mathematics,
|
|
1410
|
+
* computer science). Semantic search over abstracts, not keyword matching.
|
|
1411
|
+
*
|
|
1412
|
+
* This is **not** `search({ categories: ["research"] })`, which only narrows
|
|
1413
|
+
* ordinary web search to ~14 academic websites.
|
|
1414
|
+
*
|
|
1415
|
+
* @param query Natural-language search query, e.g. `"CRISPR base editing
|
|
1416
|
+
* off-target effects in primary human T cells"`.
|
|
1417
|
+
* @param options Optional filters (k, authors, categories, from, to). Note
|
|
1418
|
+
* `categories` here filters *paper* subject categories (e.g. `"q-bio.GN"`)
|
|
1419
|
+
* and is unrelated to the `categories` option of `search()`.
|
|
1339
1420
|
*/
|
|
1340
1421
|
searchPapers(query: string, options?: SearchPapersOptions): Promise<SearchPapersResponse>;
|
|
1341
1422
|
/**
|
|
1342
1423
|
* Get paper metadata (detail mode), or read in-body passages (when `query` is
|
|
1343
1424
|
* supplied). `k` is only valid together with `query`.
|
|
1344
|
-
* @param id Paper reference: a canonical `
|
|
1345
|
-
*
|
|
1425
|
+
* @param id Paper reference: a canonical `paperId`, or a namespaced id key
|
|
1426
|
+
* such as `pmid:<id>`, `pmcid:<id>`, `doi:<doi>` or `arxiv:<id>`. Bare
|
|
1427
|
+
* arXiv ids and arXiv URLs are also accepted.
|
|
1346
1428
|
* @param options Optional `query` (switches to read mode) and `k`.
|
|
1347
1429
|
*/
|
|
1348
1430
|
getPaper(id: string, options?: {
|
|
@@ -1497,8 +1579,19 @@ declare class FirecrawlClient {
|
|
|
1497
1579
|
*/
|
|
1498
1580
|
searchFeedback(jobId: string, request: SearchFeedbackRequest): Promise<FeedbackResponse>;
|
|
1499
1581
|
/**
|
|
1500
|
-
* Access the v2 research endpoints
|
|
1501
|
-
*
|
|
1582
|
+
* Access the v2 research endpoints — Firecrawl's **research paper index**
|
|
1583
|
+
* (~43M paper abstracts) plus GitHub history/readmes.
|
|
1584
|
+
*
|
|
1585
|
+
* The paper corpus is roughly 90% biomedical and life sciences — PubMed,
|
|
1586
|
+
* bioRxiv and medRxiv — with arXiv covering physics, mathematics and
|
|
1587
|
+
* computer science.
|
|
1588
|
+
*
|
|
1589
|
+
* ⚠️ Not the same as `search({ categories: ["research"] })`, which is only a
|
|
1590
|
+
* website/domain filter over ordinary web search (~14 academic domains,
|
|
1591
|
+
* returning page snippets). Use `research.searchPapers()` for literature
|
|
1592
|
+
* search.
|
|
1593
|
+
*
|
|
1594
|
+
* Example: `firecrawl.research.searchPapers("GLP-1 receptor agonists cardiovascular outcomes")`.
|
|
1502
1595
|
*/
|
|
1503
1596
|
get research(): ResearchClient;
|
|
1504
1597
|
/**
|
|
@@ -2527,7 +2620,7 @@ declare class FirecrawlApp {
|
|
|
2527
2620
|
* @param onActivity - Optional callback to receive activity updates in real-time.
|
|
2528
2621
|
* @param onSource - Optional callback to receive source updates in real-time.
|
|
2529
2622
|
* @returns The final research results.
|
|
2530
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
2623
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
2531
2624
|
*/
|
|
2532
2625
|
deepResearch(query: string, params: DeepResearchParams<zt.ZodSchema>, onActivity?: (activity: {
|
|
2533
2626
|
type: string;
|
|
@@ -2545,14 +2638,14 @@ declare class FirecrawlApp {
|
|
|
2545
2638
|
* Initiates a deep research operation on a given query without polling.
|
|
2546
2639
|
* @param params - Parameters for the deep research operation.
|
|
2547
2640
|
* @returns The response containing the research job ID.
|
|
2548
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
2641
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
2549
2642
|
*/
|
|
2550
2643
|
asyncDeepResearch(query: string, params: DeepResearchParams<zt.ZodSchema>): Promise<DeepResearchResponse | ErrorResponse>;
|
|
2551
2644
|
/**
|
|
2552
2645
|
* Checks the status of a deep research operation.
|
|
2553
2646
|
* @param id - The ID of the deep research operation.
|
|
2554
2647
|
* @returns The current status and results of the research operation.
|
|
2555
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
2648
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
2556
2649
|
*/
|
|
2557
2650
|
checkDeepResearchStatus(id: string): Promise<DeepResearchStatusResponse | ErrorResponse>;
|
|
2558
2651
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_package
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GWKNKKE4.js";
|
|
4
4
|
|
|
5
5
|
// src/v2/utils/httpClient.ts
|
|
6
6
|
import axios from "axios";
|
|
@@ -1402,9 +1402,20 @@ var ResearchClient = class {
|
|
|
1402
1402
|
}
|
|
1403
1403
|
http;
|
|
1404
1404
|
/**
|
|
1405
|
-
* Search
|
|
1406
|
-
*
|
|
1407
|
-
*
|
|
1405
|
+
* Search the research paper index by abstract relevance.
|
|
1406
|
+
*
|
|
1407
|
+
* Queries ~43M paper abstracts: PubMed, bioRxiv and medRxiv (about 90% of the
|
|
1408
|
+
* corpus — biomedical and life sciences) plus arXiv (physics, mathematics,
|
|
1409
|
+
* computer science). Semantic search over abstracts, not keyword matching.
|
|
1410
|
+
*
|
|
1411
|
+
* This is **not** `search({ categories: ["research"] })`, which only narrows
|
|
1412
|
+
* ordinary web search to ~14 academic websites.
|
|
1413
|
+
*
|
|
1414
|
+
* @param query Natural-language search query, e.g. `"CRISPR base editing
|
|
1415
|
+
* off-target effects in primary human T cells"`.
|
|
1416
|
+
* @param options Optional filters (k, authors, categories, from, to). Note
|
|
1417
|
+
* `categories` here filters *paper* subject categories (e.g. `"q-bio.GN"`)
|
|
1418
|
+
* and is unrelated to the `categories` option of `search()`.
|
|
1408
1419
|
*/
|
|
1409
1420
|
async searchPapers(query, options = {}) {
|
|
1410
1421
|
if (!query || !query.trim()) throw new Error("query cannot be empty");
|
|
@@ -1954,8 +1965,19 @@ var FirecrawlClient = class {
|
|
|
1954
1965
|
}
|
|
1955
1966
|
// Research
|
|
1956
1967
|
/**
|
|
1957
|
-
* Access the v2 research endpoints
|
|
1958
|
-
*
|
|
1968
|
+
* Access the v2 research endpoints — Firecrawl's **research paper index**
|
|
1969
|
+
* (~43M paper abstracts) plus GitHub history/readmes.
|
|
1970
|
+
*
|
|
1971
|
+
* The paper corpus is roughly 90% biomedical and life sciences — PubMed,
|
|
1972
|
+
* bioRxiv and medRxiv — with arXiv covering physics, mathematics and
|
|
1973
|
+
* computer science.
|
|
1974
|
+
*
|
|
1975
|
+
* ⚠️ Not the same as `search({ categories: ["research"] })`, which is only a
|
|
1976
|
+
* website/domain filter over ordinary web search (~14 academic domains,
|
|
1977
|
+
* returning page snippets). Use `research.searchPapers()` for literature
|
|
1978
|
+
* search.
|
|
1979
|
+
*
|
|
1980
|
+
* Example: `firecrawl.research.searchPapers("GLP-1 receptor agonists cardiovascular outcomes")`.
|
|
1959
1981
|
*/
|
|
1960
1982
|
get research() {
|
|
1961
1983
|
if (!this._research) this._research = new ResearchClient(this.http);
|
|
@@ -2320,7 +2342,7 @@ var FirecrawlApp = class {
|
|
|
2320
2342
|
if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
|
|
2321
2343
|
return process.env.npm_package_version;
|
|
2322
2344
|
}
|
|
2323
|
-
const packageJson = await import("./package-
|
|
2345
|
+
const packageJson = await import("./package-RCEGXLHV.js");
|
|
2324
2346
|
return packageJson.default.version;
|
|
2325
2347
|
} catch (error) {
|
|
2326
2348
|
const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
|
|
@@ -3146,7 +3168,7 @@ var FirecrawlApp = class {
|
|
|
3146
3168
|
* @param onActivity - Optional callback to receive activity updates in real-time.
|
|
3147
3169
|
* @param onSource - Optional callback to receive source updates in real-time.
|
|
3148
3170
|
* @returns The final research results.
|
|
3149
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
3171
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
3150
3172
|
*/
|
|
3151
3173
|
async deepResearch(query, params, onActivity, onSource) {
|
|
3152
3174
|
try {
|
|
@@ -3203,7 +3225,7 @@ var FirecrawlApp = class {
|
|
|
3203
3225
|
* Initiates a deep research operation on a given query without polling.
|
|
3204
3226
|
* @param params - Parameters for the deep research operation.
|
|
3205
3227
|
* @returns The response containing the research job ID.
|
|
3206
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
3228
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
3207
3229
|
*/
|
|
3208
3230
|
async asyncDeepResearch(query, params) {
|
|
3209
3231
|
const headers = this.prepareHeaders();
|
|
@@ -3241,7 +3263,7 @@ var FirecrawlApp = class {
|
|
|
3241
3263
|
* Checks the status of a deep research operation.
|
|
3242
3264
|
* @param id - The ID of the deep research operation.
|
|
3243
3265
|
* @returns The current status and results of the research operation.
|
|
3244
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
3266
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
3245
3267
|
*/
|
|
3246
3268
|
async checkDeepResearchStatus(id) {
|
|
3247
3269
|
const headers = this.prepareHeaders();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firecrawl",
|
|
3
|
-
"version": "4.32.
|
|
4
|
-
"description": "JavaScript SDK for Firecrawl API",
|
|
3
|
+
"version": "4.32.2",
|
|
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",
|
|
7
7
|
"exports": {
|
|
@@ -49,7 +49,21 @@
|
|
|
49
49
|
"web",
|
|
50
50
|
"scraper",
|
|
51
51
|
"api",
|
|
52
|
-
"sdk"
|
|
52
|
+
"sdk",
|
|
53
|
+
"web-search",
|
|
54
|
+
"literature-search",
|
|
55
|
+
"research",
|
|
56
|
+
"scientific-papers",
|
|
57
|
+
"academic-search",
|
|
58
|
+
"biomedical",
|
|
59
|
+
"life-sciences",
|
|
60
|
+
"pubmed",
|
|
61
|
+
"biorxiv",
|
|
62
|
+
"medrxiv",
|
|
63
|
+
"arxiv",
|
|
64
|
+
"preprints",
|
|
65
|
+
"citations",
|
|
66
|
+
"bioinformatics"
|
|
53
67
|
],
|
|
54
68
|
"engines": {
|
|
55
69
|
"node": ">=22.0.0"
|
package/pnpm-workspace.yaml
CHANGED
|
@@ -7,8 +7,9 @@ overrides:
|
|
|
7
7
|
"rollup@<4.59.0": ">=4.59.0"
|
|
8
8
|
"picomatch@<4.0.4": ">=4.0.4"
|
|
9
9
|
handlebars: ">=4.7.9"
|
|
10
|
-
"brace-expansion@>=5.0.0 <5.0.
|
|
11
|
-
"js-yaml@>=3.0.0 <3.15.
|
|
10
|
+
"brace-expansion@>=5.0.0 <5.0.9": "5.0.9"
|
|
11
|
+
"js-yaml@>=3.0.0 <3.15.1": "3.15.1"
|
|
12
|
+
"js-yaml@>=4.0.0 <4.3.1": "4.3.1"
|
|
12
13
|
"axios@>=1.0.0 <1.16.0": "1.16.1"
|
|
13
14
|
"follow-redirects@<1.16.0": ">=1.16.0 <2.0.0"
|
|
14
15
|
"form-data@>=4.0.0 <4.0.6": "4.0.6"
|
package/src/v1/index.ts
CHANGED
|
@@ -1642,7 +1642,7 @@ export default class FirecrawlApp {
|
|
|
1642
1642
|
* @param onActivity - Optional callback to receive activity updates in real-time.
|
|
1643
1643
|
* @param onSource - Optional callback to receive source updates in real-time.
|
|
1644
1644
|
* @returns The final research results.
|
|
1645
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
1645
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
1646
1646
|
*/
|
|
1647
1647
|
async deepResearch(
|
|
1648
1648
|
query: string,
|
|
@@ -1730,7 +1730,7 @@ export default class FirecrawlApp {
|
|
|
1730
1730
|
* Initiates a deep research operation on a given query without polling.
|
|
1731
1731
|
* @param params - Parameters for the deep research operation.
|
|
1732
1732
|
* @returns The response containing the research job ID.
|
|
1733
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
1733
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
1734
1734
|
*/
|
|
1735
1735
|
async asyncDeepResearch(query: string, params: DeepResearchParams<zt.ZodSchema>): Promise<DeepResearchResponse | ErrorResponse> {
|
|
1736
1736
|
const headers = this.prepareHeaders();
|
|
@@ -1772,7 +1772,7 @@ export default class FirecrawlApp {
|
|
|
1772
1772
|
* Checks the status of a deep research operation.
|
|
1773
1773
|
* @param id - The ID of the deep research operation.
|
|
1774
1774
|
* @returns The current status and results of the research operation.
|
|
1775
|
-
* @deprecated /v1/deep-research is deprecated. Use /v2/search
|
|
1775
|
+
* @deprecated /v1/deep-research is deprecated. Use /v2/search for web research, or research.searchPapers() for scientific literature.
|
|
1776
1776
|
*/
|
|
1777
1777
|
async checkDeepResearchStatus(id: string): Promise<DeepResearchStatusResponse | ErrorResponse> {
|
|
1778
1778
|
const headers = this.prepareHeaders();
|
package/src/v2/client.ts
CHANGED
|
@@ -261,8 +261,19 @@ export class FirecrawlClient {
|
|
|
261
261
|
|
|
262
262
|
// Research
|
|
263
263
|
/**
|
|
264
|
-
* Access the v2 research endpoints
|
|
265
|
-
*
|
|
264
|
+
* Access the v2 research endpoints — Firecrawl's **research paper index**
|
|
265
|
+
* (~43M paper abstracts) plus GitHub history/readmes.
|
|
266
|
+
*
|
|
267
|
+
* The paper corpus is roughly 90% biomedical and life sciences — PubMed,
|
|
268
|
+
* bioRxiv and medRxiv — with arXiv covering physics, mathematics and
|
|
269
|
+
* computer science.
|
|
270
|
+
*
|
|
271
|
+
* ⚠️ Not the same as `search({ categories: ["research"] })`, which is only a
|
|
272
|
+
* website/domain filter over ordinary web search (~14 academic domains,
|
|
273
|
+
* returning page snippets). Use `research.searchPapers()` for literature
|
|
274
|
+
* search.
|
|
275
|
+
*
|
|
276
|
+
* Example: `firecrawl.research.searchPapers("GLP-1 receptor agonists cardiovascular outcomes")`.
|
|
266
277
|
*/
|
|
267
278
|
get research(): ResearchClient {
|
|
268
279
|
if (!this._research) this._research = new ResearchClient(this.http);
|
|
@@ -63,16 +63,47 @@ function normalizeResearchError(err: any, action: string): never {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
* Client for the v2 research endpoints
|
|
66
|
+
* Client for the v2 research endpoints — Firecrawl's **research paper index**
|
|
67
|
+
* (~43M paper abstracts) plus GitHub history/readmes.
|
|
68
|
+
*
|
|
69
|
+
* The paper corpus is roughly 90% biomedical and life sciences — PubMed,
|
|
70
|
+
* bioRxiv and medRxiv — with arXiv covering physics, mathematics and computer
|
|
71
|
+
* science. Supports abstract search, paper metadata, in-body passage reads and
|
|
72
|
+
* citation-graph expansion.
|
|
73
|
+
*
|
|
74
|
+
* ⚠️ This is **not** the same as `search({ categories: ["research"] })`. That
|
|
75
|
+
* option is a website/domain filter on ordinary web search: it narrows
|
|
76
|
+
* Google-style results to ~14 academic domains and returns page snippets. The
|
|
77
|
+
* methods here query the paper index itself and return ranked paper records.
|
|
78
|
+
*
|
|
67
79
|
* Accessed via `firecrawl.research`.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const res = await firecrawl.research.searchPapers(
|
|
84
|
+
* "tau aggregation inhibitors in Alzheimer's disease",
|
|
85
|
+
* { k: 10 },
|
|
86
|
+
* );
|
|
87
|
+
* ```
|
|
68
88
|
*/
|
|
69
89
|
export class ResearchClient {
|
|
70
90
|
constructor(private readonly http: HttpClient) {}
|
|
71
91
|
|
|
72
92
|
/**
|
|
73
|
-
* Search
|
|
74
|
-
*
|
|
75
|
-
*
|
|
93
|
+
* Search the research paper index by abstract relevance.
|
|
94
|
+
*
|
|
95
|
+
* Queries ~43M paper abstracts: PubMed, bioRxiv and medRxiv (about 90% of the
|
|
96
|
+
* corpus — biomedical and life sciences) plus arXiv (physics, mathematics,
|
|
97
|
+
* computer science). Semantic search over abstracts, not keyword matching.
|
|
98
|
+
*
|
|
99
|
+
* This is **not** `search({ categories: ["research"] })`, which only narrows
|
|
100
|
+
* ordinary web search to ~14 academic websites.
|
|
101
|
+
*
|
|
102
|
+
* @param query Natural-language search query, e.g. `"CRISPR base editing
|
|
103
|
+
* off-target effects in primary human T cells"`.
|
|
104
|
+
* @param options Optional filters (k, authors, categories, from, to). Note
|
|
105
|
+
* `categories` here filters *paper* subject categories (e.g. `"q-bio.GN"`)
|
|
106
|
+
* and is unrelated to the `categories` option of `search()`.
|
|
76
107
|
*/
|
|
77
108
|
async searchPapers(
|
|
78
109
|
query: string,
|
|
@@ -102,8 +133,9 @@ export class ResearchClient {
|
|
|
102
133
|
/**
|
|
103
134
|
* Get paper metadata (detail mode), or read in-body passages (when `query` is
|
|
104
135
|
* supplied). `k` is only valid together with `query`.
|
|
105
|
-
* @param id Paper reference: a canonical `
|
|
106
|
-
*
|
|
136
|
+
* @param id Paper reference: a canonical `paperId`, or a namespaced id key
|
|
137
|
+
* such as `pmid:<id>`, `pmcid:<id>`, `doi:<doi>` or `arxiv:<id>`. Bare
|
|
138
|
+
* arXiv ids and arXiv URLs are also accepted.
|
|
107
139
|
* @param options Optional `query` (switches to read mode) and `k`.
|
|
108
140
|
*/
|
|
109
141
|
async getPaper(
|
package/src/v2/types.ts
CHANGED
|
@@ -207,6 +207,10 @@ export interface ScrapeOptions {
|
|
|
207
207
|
useMock?: string;
|
|
208
208
|
blockAds?: boolean;
|
|
209
209
|
proxy?: "basic" | "stealth" | "enhanced" | "auto" | string;
|
|
210
|
+
/**
|
|
211
|
+
* Maximum age, in milliseconds, of indexed content that may be reused.
|
|
212
|
+
* Set to `0` to bypass index reuse.
|
|
213
|
+
*/
|
|
210
214
|
maxAge?: number;
|
|
211
215
|
minAge?: number;
|
|
212
216
|
storeInCache?: boolean;
|
|
@@ -324,6 +328,7 @@ export interface AgentWebhookConfig {
|
|
|
324
328
|
|
|
325
329
|
export interface BrandingProfile {
|
|
326
330
|
colorScheme?: "light" | "dark";
|
|
331
|
+
brandName?: string;
|
|
327
332
|
logo?: string | null;
|
|
328
333
|
fonts?: Array<{
|
|
329
334
|
family: string;
|
|
@@ -558,6 +563,7 @@ export interface DocumentMetadata {
|
|
|
558
563
|
// Common metadata fields
|
|
559
564
|
title?: string;
|
|
560
565
|
description?: string;
|
|
566
|
+
/** URL reported by the selected scrape engine. */
|
|
561
567
|
url?: string;
|
|
562
568
|
language?: string;
|
|
563
569
|
keywords?: string | string[];
|
|
@@ -594,7 +600,9 @@ export interface DocumentMetadata {
|
|
|
594
600
|
articleSection?: string;
|
|
595
601
|
|
|
596
602
|
// Response-level metadata
|
|
603
|
+
/** URL requested for the scrape. */
|
|
597
604
|
sourceURL?: string;
|
|
605
|
+
/** HTTP status code reported for the scrape response. */
|
|
598
606
|
statusCode?: number;
|
|
599
607
|
scrapeId?: string;
|
|
600
608
|
numPages?: number;
|
|
@@ -687,6 +695,28 @@ export interface SearchData {
|
|
|
687
695
|
developer?: Array<SearchResultWeb | Document>;
|
|
688
696
|
}
|
|
689
697
|
|
|
698
|
+
/**
|
|
699
|
+
* Narrows ordinary **web search**. A category does not switch `search()` to a
|
|
700
|
+
* different index.
|
|
701
|
+
*
|
|
702
|
+
* - `github` — restrict web results to github.com (a `site:` filter).
|
|
703
|
+
* - `research` — restrict web results to a fixed list of ~14 academic
|
|
704
|
+
* *websites* (arxiv.org, pubmed.ncbi.nlm.nih.gov, nature.com, science.org,
|
|
705
|
+
* ieee.org, sciencedirect.com, biorxiv.org, medrxiv.org, ...). It returns
|
|
706
|
+
* ordinary web page results from those domains, **not** paper records.
|
|
707
|
+
* - `pdf` — restrict results to PDFs (adds `filetype:pdf`).
|
|
708
|
+
* - `developer` — add developer results (issues, pull requests, READMEs and
|
|
709
|
+
* documentation) under `.developer`.
|
|
710
|
+
*
|
|
711
|
+
* ⚠️ `categories: ["research"]` is **not** Firecrawl's research paper index.
|
|
712
|
+
* To search papers themselves — ~43M abstracts, roughly 90% biomedical
|
|
713
|
+
* (PubMed, bioRxiv, medRxiv) plus arXiv — with full abstracts, in-body passage
|
|
714
|
+
* reads and citation-graph expansion, use `firecrawl.research.searchPapers()`
|
|
715
|
+
* (plus `getPaper()` and `similarPapers()`), which call `/v2/search/research`.
|
|
716
|
+
*
|
|
717
|
+
* Rule of thumb: literature search → `research.searchPapers()`; web pages that
|
|
718
|
+
* happen to live on academic domains → `search({ categories: ["research"] })`.
|
|
719
|
+
*/
|
|
690
720
|
export interface CategoryOption {
|
|
691
721
|
type: "github" | "research" | "pdf" | "developer";
|
|
692
722
|
}
|
|
@@ -696,6 +726,14 @@ export interface SearchRequest {
|
|
|
696
726
|
sources?: Array<
|
|
697
727
|
"web" | "news" | "images" | { type: "web" | "news" | "images" }
|
|
698
728
|
>;
|
|
729
|
+
/**
|
|
730
|
+
* Narrow web search by category. See {@link CategoryOption}.
|
|
731
|
+
*
|
|
732
|
+
* ⚠️ `"research"` is a website/domain filter over ordinary web search (~14
|
|
733
|
+
* academic domains), **not** the research paper index. For literature search
|
|
734
|
+
* over ~43M paper abstracts (PubMed / bioRxiv / medRxiv / arXiv) use
|
|
735
|
+
* `firecrawl.research.searchPapers()` instead.
|
|
736
|
+
*/
|
|
699
737
|
categories?: Array<
|
|
700
738
|
"github" | "research" | "pdf" | "developer" | CategoryOption
|
|
701
739
|
>;
|
|
@@ -1355,8 +1393,20 @@ export interface BrowserListResponse {
|
|
|
1355
1393
|
// ---------- Research (v2) ----------
|
|
1356
1394
|
|
|
1357
1395
|
/**
|
|
1358
|
-
* Source identifiers grouped by namespace.
|
|
1359
|
-
*
|
|
1396
|
+
* Source identifiers grouped by namespace. Each key is a namespace and each
|
|
1397
|
+
* value is an array of ids in that namespace.
|
|
1398
|
+
*
|
|
1399
|
+
* Which namespaces appear depends on the paper's source. Biomedical records
|
|
1400
|
+
* (PubMed, bioRxiv, medRxiv) typically carry `pmid`, `pmcid` and/or `doi`;
|
|
1401
|
+
* arXiv records carry `arxiv`. The set is open — treat this as a lookup by
|
|
1402
|
+
* namespace rather than a fixed schema, and prefer {@link PaperResult.primaryId}
|
|
1403
|
+
* when you just need one citable identifier.
|
|
1404
|
+
*
|
|
1405
|
+
* @example
|
|
1406
|
+
* ```ts
|
|
1407
|
+
* const doi = paper.ids?.doi?.[0];
|
|
1408
|
+
* const pmid = paper.ids?.pmid?.[0];
|
|
1409
|
+
* ```
|
|
1360
1410
|
*/
|
|
1361
1411
|
export type IdMap = Record<string, string[]>;
|
|
1362
1412
|
|
|
@@ -1372,7 +1422,7 @@ export interface PaperSignals {
|
|
|
1372
1422
|
seedOverlap: number;
|
|
1373
1423
|
}
|
|
1374
1424
|
|
|
1375
|
-
/** A ranked paper. `paperId` is canonical;
|
|
1425
|
+
/** A ranked paper. `paperId` is canonical; source ids (pmid, pmcid, doi, arxiv, ...) live in `ids`. */
|
|
1376
1426
|
export interface PaperResult {
|
|
1377
1427
|
/** Canonical paper id — the Milvus INT64 primary key as a decimal string. */
|
|
1378
1428
|
paperId: string;
|
|
@@ -1452,7 +1502,7 @@ export interface GitHubScoreBreakdown {
|
|
|
1452
1502
|
}
|
|
1453
1503
|
|
|
1454
1504
|
export interface GitHubSearchItem {
|
|
1455
|
-
resultType
|
|
1505
|
+
resultType?: "github_history" | "repo_readme" | "web";
|
|
1456
1506
|
/** `owner/name`; empty for web results whose URL is not a repo page. */
|
|
1457
1507
|
repo: string;
|
|
1458
1508
|
url: string;
|