You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Domain must be a valid hostname without protocol or path'
63
+
);
64
+
65
+
functionbuildSearchQueryWithDomains(
66
+
query: string,
67
+
includeDomains?: string[],
68
+
excludeDomains?: string[]
69
+
): string{
70
+
if(includeDomains?.length){
71
+
return`${query} (${includeDomains
72
+
.map((domain)=>`site:${domain}`)
73
+
.join(' OR ')})`;
74
+
}
75
+
76
+
if(excludeDomains?.length){
77
+
return`${query}${excludeDomains
78
+
.map((domain)=>`-site:${domain}`)
79
+
.join(' ')}`;
80
+
}
81
+
82
+
return query;
83
+
}
84
+
56
85
classConsoleLoggerimplementsLogger{
57
86
privateshouldLog=
58
87
process.env.CLOUD_SERVICE==='true'||
@@ -576,6 +605,7 @@ The query also supports search operators, that you can use if needed to refine t
576
605
**Common mistakes:** Using crawl or map for open-ended questions (use search instead).
577
606
**Prompt Example:** "Find the latest research papers on AI published in 2023."
578
607
**Sources:** web, images, news, default to web unless needed images or news.
608
+
**Domain filters:** Use includeDomains to restrict results to specific domains, or excludeDomains to remove domains. Do not use both in the same request. Domains must be hostnames only, without protocol or path.
579
609
**Scrape Options:** Only use scrapeOptions when you think it is absolutely necessary. When you do so default to a lower limit to avoid timeouts, 5 or lower.
580
610
**Optimal Workflow:** Search first using firecrawl_search without formats, then after fetching the results, use the scrape tool to get the content of the relevantpage(s) that you want to scrape
581
611
@@ -586,6 +616,7 @@ The query also supports search operators, that you can use if needed to refine t
586
616
"arguments": {
587
617
"query": "top AI companies",
588
618
"limit": 5,
619
+
"includeDomains": ["example.com"],
589
620
"sources": [
590
621
{ "type": "web" }
591
622
]
@@ -615,18 +646,28 @@ The query also supports search operators, that you can use if needed to refine t
615
646
\`\`\`
616
647
**Returns:** Array of search results (with optional scraped content).
Copy file name to clipboardExpand all lines: src/legacy/index.md
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -499,6 +499,7 @@ Search the web and optionally extract content from search results. This is the m
499
499
**Common mistakes:** Using crawl or map for open-ended questions (use search instead).
500
500
**Prompt Example:** "Find the latest research papers on AI published in 2023."
501
501
**Sources:** web, images, news, default to web unless needed images or news.
502
+
**Domain filters:** Use includeDomains to restrict results to specific domains, or excludeDomains to remove domains. Do not use both in the same request. Domains must be hostnames only, without protocol or path.
502
503
**Usage Example:**
503
504
\`\`\`json
504
505
{
@@ -508,6 +509,7 @@ Search the web and optionally extract content from search results. This is the m
508
509
"limit": 5,
509
510
"lang": "en",
510
511
"country": "us",
512
+
"excludeDomains": ["example.com"],
511
513
"sources": [
512
514
"web",
513
515
"images",
@@ -545,6 +547,22 @@ Search the web and optionally extract content from search results. This is the m
545
547
type: 'string',
546
548
description: 'Location parameter for search results',
547
549
},
550
+
includeDomains: {
551
+
type: 'array',
552
+
description:
553
+
'Domains to include in search results. Cannot be used with excludeDomains. Domains must be hostnames only, without protocol or path.',
554
+
items: {
555
+
type: 'string',
556
+
},
557
+
},
558
+
excludeDomains: {
559
+
type: 'array',
560
+
description:
561
+
'Domains to exclude from search results. Cannot be used with includeDomains. Domains must be hostnames only, without protocol or path.',
0 commit comments