Skip to content

Commit a035f4d

Browse files
authored
Firecrawl - search action (#17013)
* new search action * pnpm-lock.yaml * versions * update
1 parent 8160f2b commit a035f4d

File tree

9 files changed

+128
-10
lines changed

9 files changed

+128
-10
lines changed

components/firecrawl/actions/crawl-url/crawl-url.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "firecrawl-crawl-url",
66
name: "Crawl URL",
77
description: "Crawls a given URL and returns the contents of sub-pages. [See the documentation](https://docs.firecrawl.dev/api-reference/endpoint/crawl-post)",
8-
version: "1.0.2",
8+
version: "1.0.3",
99
type: "action",
1010
props: {
1111
firecrawl,

components/firecrawl/actions/extract-data/extract-data.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "firecrawl-extract-data",
77
name: "Extract Data",
88
description: "Extract structured data from one or multiple URLs. [See the documentation](https://docs.firecrawl.dev/api-reference/endpoint/extract)",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "action",
1111
props: {
1212
firecrawl,

components/firecrawl/actions/get-crawl-status/get-crawl-status.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "firecrawl-get-crawl-status",
55
name: "Get Crawl Data",
66
description: "Obtains the status and data from a previous crawl operation. [See the documentation](https://docs.firecrawl.dev/api-reference/endpoint/crawl-get)",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
firecrawl,

components/firecrawl/actions/get-extract-status/get-extract-status.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "firecrawl-get-extract-status",
55
name: "Get Extract Data",
66
description: "Obtains the status and data from a previous extract operation. [See the documentation](https://docs.firecrawl.dev/api-reference/endpoint/extract-get)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
firecrawl,

components/firecrawl/actions/scrape-page/scrape-page.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "Scrape Page",
88
description:
99
"Scrapes a URL and returns content from that page. [See the documentation](https://docs.firecrawl.dev/api-reference/endpoint/scrape)",
10-
version: "1.0.1",
10+
version: "1.0.2",
1111
type: "action",
1212
props: {
1313
firecrawl,
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
import firecrawl from "../../firecrawl.app.mjs";
2+
3+
export default {
4+
key: "firecrawl-search",
5+
name: "Search",
6+
description: "Search the web and get full content from results. [See the documentation](https://docs.firecrawl.dev/features/search)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
firecrawl,
11+
query: {
12+
type: "string",
13+
label: "Query",
14+
description: "The query to search for",
15+
},
16+
scrapeOptionFormats: {
17+
type: "string[]",
18+
label: "Scrape Option Formats",
19+
description: "Search with content scraping. You can specify multiple output formats.",
20+
options: [
21+
{
22+
label: "Clean, formatted markdown content",
23+
value: "markdown",
24+
},
25+
{
26+
label: "Processed HTML content",
27+
value: "html",
28+
},
29+
{
30+
label: "Unmodified HTML content",
31+
value: "rawHtml",
32+
},
33+
{
34+
label: "List of links found on the page",
35+
value: "links",
36+
},
37+
{
38+
label: "Screenshot of the page",
39+
value: "screenshot",
40+
},
41+
{
42+
label: "Full-page screenshot",
43+
value: "screenshot@fullPage",
44+
},
45+
{
46+
label: "Structured data extraction",
47+
value: "extract",
48+
},
49+
],
50+
optional: true,
51+
},
52+
timeBasedSearch: {
53+
type: "string",
54+
label: "Time Based Search",
55+
description: "Filter the results by time",
56+
options: [
57+
{
58+
label: "Past hour",
59+
value: "qdr:h",
60+
},
61+
{
62+
label: "Past 24 hours",
63+
value: "qdr:d",
64+
},
65+
{
66+
label: "Past week",
67+
value: "qdr:w",
68+
},
69+
{
70+
label: "Past month",
71+
value: "qdr:m",
72+
},
73+
{
74+
label: "Past year",
75+
value: "qdr:y",
76+
},
77+
],
78+
optional: true,
79+
},
80+
customTimeout: {
81+
type: "integer",
82+
label: "Custom Timeout",
83+
description: "Set a custom timeout for search operations. E.g. `30000`",
84+
optional: true,
85+
},
86+
maxResults: {
87+
type: "integer",
88+
label: "Max Results",
89+
description: "The maximum number of results to return",
90+
default: 10,
91+
optional: true,
92+
},
93+
},
94+
async run({ $ }) {
95+
const results = await this.firecrawl.search({
96+
$,
97+
data: {
98+
query: this.query,
99+
limit: this.maxResults,
100+
scrapeOptions: this.scrapeOptionFormats
101+
? {
102+
formats: this.scrapeOptionFormats,
103+
}
104+
: undefined,
105+
tbs: this.timeBasedSearch,
106+
timeout: this.customTimeout,
107+
},
108+
});
109+
$.export("$summary", `Successfully searched for ${this.query}`);
110+
return results;
111+
},
112+
};

components/firecrawl/firecrawl.app.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,12 @@ export default {
7777
...opts,
7878
});
7979
},
80+
search(opts = {}) {
81+
return this._makeRequest({
82+
method: "POST",
83+
path: "/search",
84+
...opts,
85+
});
86+
},
8087
},
8188
};

components/firecrawl/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/firecrawl",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Pipedream FireCrawl Components",
55
"main": "firecrawl.app.mjs",
66
"keywords": [
@@ -13,7 +13,6 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^3.0.0"
16+
"@pipedream/platform": "^3.1.0"
1717
}
1818
}
19-

pnpm-lock.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)