@youdotcom-oss/n8n-nodes-youdotcom 0.2.6 → 0.2.7
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
CHANGED
|
@@ -1,109 +1,90 @@
|
|
|
1
|
-
# n8n-nodes-youdotcom
|
|
1
|
+
# @youdotcom-oss/n8n-nodes-youdotcom
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Add real time web search, page content extraction, and AI powered deep research to your n8n workflows with the [You.com](https://you.com) API.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
5
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
npm install @youdotcom-oss/n8n-nodes-youdotcom
|
|
11
|
-
```
|
|
7
|
+
[Installation](#installation) | [Operations](#operations) | [Credentials](#credentials) | [Usage](#usage) | [Resources](#resources)
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
## Installation
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
2. Select **Install**
|
|
17
|
-
3. Enter `@youdotcom-oss/n8n-nodes-youdotcom`
|
|
18
|
-
4. Agree to the risks and select **Install**
|
|
11
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
19
12
|
|
|
20
13
|
## Operations
|
|
21
14
|
|
|
22
15
|
### Search
|
|
23
16
|
|
|
24
|
-
Search the web and news
|
|
25
|
-
|
|
26
|
-
| Parameter | Required | Description |
|
|
27
|
-
| ---------------- | -------- | ------------------------------------------------------- |
|
|
28
|
-
| Query | Yes | The search query (supports search operators, see below) |
|
|
29
|
-
| Count | No | Maximum number of results per section (1-100) |
|
|
30
|
-
| Country | No | Country code for geographical focus (e.g., US, GB, DE) |
|
|
31
|
-
| Freshness | No | Filter by recency: day, week, month, or year |
|
|
32
|
-
| Language | No | Language of results (BCP 47 format) |
|
|
33
|
-
| Livecrawl | No | Fetch full page content for web, news, or all results |
|
|
34
|
-
| Livecrawl Format | No | Format for livecrawled content (HTML or Markdown) |
|
|
35
|
-
| Offset | No | Pagination offset (0-9) |
|
|
36
|
-
| Safe Search | No | Content moderation: off, moderate, or strict |
|
|
17
|
+
Search the web and news with up to date results. Supports advanced query operators (`site:`, `filetype:`, `+`, `-`, `AND`, `OR`, `NOT`) and geographic/language filtering.
|
|
37
18
|
|
|
38
|
-
|
|
19
|
+
Great for monitoring mentions, pulling recent news, or feeding live data into AI agent workflows.
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
52
|
-
**Example:** `machine learning (Python OR PyTorch) -TensorFlow filetype:pdf` searches for ML content about Python or PyTorch, excluding TensorFlow, in PDF format.
|
|
21
|
+
| Parameter | Description |
|
|
22
|
+
|-----------|-------------|
|
|
23
|
+
| Query | The search query (required) |
|
|
24
|
+
| Count | Max results per section, 1-100 (default: 10) |
|
|
25
|
+
| Country | Two-letter country code to focus results geographically |
|
|
26
|
+
| Freshness | Filter by recency: day, week, month, or year |
|
|
27
|
+
| Language | BCP 47 language code for results (default: EN) |
|
|
28
|
+
| Livecrawl | Fetch full page content for web, news, or all results |
|
|
29
|
+
| Livecrawl Format | Format for livecrawled content: markdown or HTML |
|
|
30
|
+
| Offset | Pagination offset, 0-9 |
|
|
31
|
+
| Safe Search | Content filter: off, moderate, or strict |
|
|
53
32
|
|
|
54
33
|
### Get Contents
|
|
55
34
|
|
|
56
|
-
Extract content from one or more
|
|
35
|
+
Extract clean, structured content from one or more web pages. Returns page text as markdown or HTML, plus metadata like JSON-LD, OpenGraph, and Twitter Cards.
|
|
57
36
|
|
|
58
|
-
|
|
59
|
-
| ------------- | -------- | -------------------------------------------------------- |
|
|
60
|
-
| URLs | Yes | Comma-separated list of URLs to extract content from |
|
|
61
|
-
| Formats | No | Output formats: Markdown, HTML, and/or Metadata |
|
|
62
|
-
| Crawl Timeout | No | Timeout in seconds for page crawling (1-60) |
|
|
37
|
+
Useful for scraping product pages, pulling article text, or extracting structured data from any URL.
|
|
63
38
|
|
|
64
|
-
|
|
39
|
+
| Parameter | Description |
|
|
40
|
+
|-----------|-------------|
|
|
41
|
+
| URLs | Comma-separated list of URLs to extract (required) |
|
|
42
|
+
| Formats | Output formats: markdown, HTML, and/or metadata (JSON-LD, OpenGraph, Twitter Cards) |
|
|
43
|
+
| Crawl Timeout | Timeout in seconds for page crawling, 1-60 (default: 30) |
|
|
65
44
|
|
|
66
|
-
|
|
67
|
-
- **HTML** - Full HTML with layout preserved
|
|
68
|
-
- **Metadata** - Structured data (JSON-LD, OpenGraph, Twitter Cards)
|
|
45
|
+
### Research
|
|
69
46
|
|
|
70
|
-
|
|
47
|
+
Get a comprehensive, cited answer to a complex question. The Research API searches the web, reads multiple sources, and synthesizes a detailed markdown response with inline numbered citations.
|
|
71
48
|
|
|
72
|
-
|
|
73
|
-
2. In n8n, go to **Credentials > New Credential**
|
|
74
|
-
3. Search for "You.com API"
|
|
75
|
-
4. Enter your API key and save
|
|
49
|
+
Perfect for competitive analysis, market research, technical due diligence, or any question that needs more than a simple search result.
|
|
76
50
|
|
|
77
|
-
|
|
51
|
+
| Parameter | Description |
|
|
52
|
+
|-----------|-------------|
|
|
53
|
+
| Input | The research question (required) |
|
|
54
|
+
| Research Effort | Controls depth and speed (see below, default: standard) |
|
|
78
55
|
|
|
79
|
-
|
|
80
|
-
- **Content aggregation**: Monitor news across topics with customizable filters
|
|
81
|
-
- **Data enrichment**: Extract metadata from URLs in your workflows
|
|
56
|
+
**Research Effort levels:**
|
|
82
57
|
|
|
83
|
-
|
|
58
|
+
| Level | Description |
|
|
59
|
+
|-------|-------------|
|
|
60
|
+
| Lite | Quick answers for straightforward questions |
|
|
61
|
+
| Standard | Balanced speed and depth (default) |
|
|
62
|
+
| Deep | More time researching and cross-referencing sources |
|
|
63
|
+
| Exhaustive | Most thorough option for complex research tasks |
|
|
64
|
+
|
|
65
|
+
## Credentials
|
|
84
66
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
67
|
+
1. Go to [you.com/platform/api-keys](https://you.com/platform/api-keys) to get an API key
|
|
68
|
+
2. In n8n, go to Credentials and create a new "You.com API" credential
|
|
69
|
+
3. Paste your API key and save
|
|
88
70
|
|
|
89
|
-
|
|
90
|
-
bun run build
|
|
71
|
+
## Usage
|
|
91
72
|
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
1. Add the "You.com" node to your workflow
|
|
74
|
+
2. Select an operation (Search, Get Contents, or Research)
|
|
75
|
+
3. Configure the parameters for your chosen operation
|
|
76
|
+
4. Run the workflow
|
|
94
77
|
|
|
95
|
-
|
|
96
|
-
bun run check
|
|
97
|
-
```
|
|
78
|
+
This node also works as a tool for [AI agents in n8n](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/). Connect it to an agent node and let the agent decide when to search the web, extract page content, or run deep research.
|
|
98
79
|
|
|
99
80
|
## Resources
|
|
100
81
|
|
|
101
|
-
- [You.com API
|
|
102
|
-
- [Search API
|
|
103
|
-
- [
|
|
104
|
-
- [
|
|
105
|
-
- [n8n
|
|
82
|
+
- [You.com API docs](https://docs.you.com/)
|
|
83
|
+
- [Search API reference](https://docs.you.com/api-reference/search)
|
|
84
|
+
- [Contents API reference](https://docs.you.com/api-reference/contents)
|
|
85
|
+
- [Research API reference](https://docs.you.com/api-reference/research)
|
|
86
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
106
87
|
|
|
107
88
|
## License
|
|
108
89
|
|
|
109
|
-
MIT
|
|
90
|
+
[MIT](LICENSE)
|
|
@@ -2,27 +2,37 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
|
|
5
|
+
function __accessProp(key) {
|
|
6
|
+
return this[key];
|
|
7
|
+
}
|
|
6
8
|
var __toCommonJS = (from) => {
|
|
7
|
-
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
8
10
|
if (entry)
|
|
9
11
|
return entry;
|
|
10
12
|
entry = __defProp({}, "__esModule", { value: true });
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (var key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(entry, key))
|
|
16
|
+
__defProp(entry, key, {
|
|
17
|
+
get: __accessProp.bind(from, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
16
21
|
__moduleCache.set(from, entry);
|
|
17
22
|
return entry;
|
|
18
23
|
};
|
|
24
|
+
var __moduleCache;
|
|
25
|
+
var __returnValue = (v) => v;
|
|
26
|
+
function __exportSetter(name, newValue) {
|
|
27
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
28
|
+
}
|
|
19
29
|
var __export = (target, all) => {
|
|
20
30
|
for (var name in all)
|
|
21
31
|
__defProp(target, name, {
|
|
22
32
|
get: all[name],
|
|
23
33
|
enumerable: true,
|
|
24
34
|
configurable: true,
|
|
25
|
-
set: (
|
|
35
|
+
set: __exportSetter.bind(all, name)
|
|
26
36
|
});
|
|
27
37
|
};
|
|
28
38
|
|
|
@@ -2,27 +2,37 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
|
|
5
|
+
function __accessProp(key) {
|
|
6
|
+
return this[key];
|
|
7
|
+
}
|
|
6
8
|
var __toCommonJS = (from) => {
|
|
7
|
-
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
8
10
|
if (entry)
|
|
9
11
|
return entry;
|
|
10
12
|
entry = __defProp({}, "__esModule", { value: true });
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (var key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(entry, key))
|
|
16
|
+
__defProp(entry, key, {
|
|
17
|
+
get: __accessProp.bind(from, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
16
21
|
__moduleCache.set(from, entry);
|
|
17
22
|
return entry;
|
|
18
23
|
};
|
|
24
|
+
var __moduleCache;
|
|
25
|
+
var __returnValue = (v) => v;
|
|
26
|
+
function __exportSetter(name, newValue) {
|
|
27
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
28
|
+
}
|
|
19
29
|
var __export = (target, all) => {
|
|
20
30
|
for (var name in all)
|
|
21
31
|
__defProp(target, name, {
|
|
22
32
|
get: all[name],
|
|
23
33
|
enumerable: true,
|
|
24
34
|
configurable: true,
|
|
25
|
-
set: (
|
|
35
|
+
set: __exportSetter.bind(all, name)
|
|
26
36
|
});
|
|
27
37
|
};
|
|
28
38
|
|
|
@@ -33,58 +43,7 @@ __export(exports_YouDotCom_node, {
|
|
|
33
43
|
});
|
|
34
44
|
module.exports = __toCommonJS(exports_YouDotCom_node);
|
|
35
45
|
var import_n8n_workflow = require("n8n-workflow");
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
// nodes/YouDotCom/YouDotCom.schemas.ts
|
|
39
|
-
var import_zod = require("zod");
|
|
40
|
-
var SearchOptionsSchema = import_zod.z.object({
|
|
41
|
-
count: import_zod.z.number().int().min(1).max(100).optional().describe("Number of search results to return (1-100)"),
|
|
42
|
-
country: import_zod.z.string().optional().describe("Two-letter country code to filter results (e.g., US, GB)"),
|
|
43
|
-
freshness: import_zod.z.enum(["day", "week", "month", "year"]).optional().describe("Filter results by recency"),
|
|
44
|
-
language: import_zod.z.string().optional().describe("BCP 47 language code to filter results (e.g., en, es, fr)"),
|
|
45
|
-
livecrawl: import_zod.z.enum(["web", "news", "all"]).optional().describe("Type of content to crawl in real-time"),
|
|
46
|
-
livecrawl_formats: import_zod.z.enum(["html", "markdown"]).optional().describe("Format for live-crawled content"),
|
|
47
|
-
offset: import_zod.z.number().int().min(0).max(9).optional().describe("Pagination offset for search results (0-9)"),
|
|
48
|
-
safesearch: import_zod.z.enum(["off", "moderate", "strict"]).optional().describe("Safe search filtering level")
|
|
49
|
-
});
|
|
50
|
-
var WebResultSchema = import_zod.z.object({
|
|
51
|
-
url: import_zod.z.string().describe("URL of the search result"),
|
|
52
|
-
title: import_zod.z.string().describe("Title of the search result"),
|
|
53
|
-
description: import_zod.z.string().describe("Description snippet of the search result"),
|
|
54
|
-
snippets: import_zod.z.array(import_zod.z.string()).optional().describe("Content snippets"),
|
|
55
|
-
page_age: import_zod.z.string().optional().describe("Publication timestamp")
|
|
56
|
-
}).passthrough();
|
|
57
|
-
var NewsResultSchema = import_zod.z.object({
|
|
58
|
-
url: import_zod.z.string().describe("URL of the news article"),
|
|
59
|
-
title: import_zod.z.string().describe("Title of the news article"),
|
|
60
|
-
description: import_zod.z.string().describe("Description snippet of the news article"),
|
|
61
|
-
page_age: import_zod.z.string().optional().describe("Publication timestamp")
|
|
62
|
-
}).passthrough();
|
|
63
|
-
var MetadataSchema = import_zod.z.object({
|
|
64
|
-
search_uuid: import_zod.z.string().optional().describe("Unique search request ID"),
|
|
65
|
-
query: import_zod.z.string().optional().describe("Query that was searched"),
|
|
66
|
-
latency: import_zod.z.number().optional().describe("Latency in seconds")
|
|
67
|
-
}).passthrough();
|
|
68
|
-
var SearchResponseSchema = import_zod.z.object({
|
|
69
|
-
results: import_zod.z.object({
|
|
70
|
-
web: import_zod.z.array(WebResultSchema).optional().describe("Web search results"),
|
|
71
|
-
news: import_zod.z.array(NewsResultSchema).optional().describe("News search results")
|
|
72
|
-
}).passthrough(),
|
|
73
|
-
metadata: MetadataSchema.optional()
|
|
74
|
-
}).passthrough();
|
|
75
|
-
var ContentsOptionsSchema = import_zod.z.object({
|
|
76
|
-
formats: import_zod.z.array(import_zod.z.enum(["markdown", "html", "metadata"])).optional().describe("Output formats for extracted content"),
|
|
77
|
-
crawl_timeout: import_zod.z.number().int().min(1).max(60).optional().describe("Timeout in seconds for content crawling (1-60)")
|
|
78
|
-
});
|
|
79
|
-
var ContentsResponseSchema = import_zod.z.array(import_zod.z.object({
|
|
80
|
-
url: import_zod.z.string().url().describe("URL of the extracted content"),
|
|
81
|
-
markdown: import_zod.z.string().optional().describe("Content in Markdown format"),
|
|
82
|
-
html: import_zod.z.string().optional().describe("Content in HTML format"),
|
|
83
|
-
metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Metadata extracted from the page")
|
|
84
|
-
}).passthrough());
|
|
85
|
-
|
|
86
|
-
// nodes/YouDotCom/YouDotCom.node.ts
|
|
87
|
-
var PACKAGE_VERSION = "0.2.6";
|
|
46
|
+
var PACKAGE_VERSION = "0.2.7";
|
|
88
47
|
var USER_AGENT = `n8n-nodes-youdotcom/${PACKAGE_VERSION} (https://github.com/youdotcom-oss/n8n-nodes-youdotcom)`;
|
|
89
48
|
|
|
90
49
|
class YouDotCom {
|
|
@@ -96,7 +55,7 @@ class YouDotCom {
|
|
|
96
55
|
version: 1,
|
|
97
56
|
usableAsTool: true,
|
|
98
57
|
subtitle: '={{$parameter["operation"]}}',
|
|
99
|
-
description: "Search the web
|
|
58
|
+
description: "Search the web, extract content from URLs, and run multi-step research using You.com APIs",
|
|
100
59
|
defaults: {
|
|
101
60
|
name: "You.com"
|
|
102
61
|
},
|
|
@@ -134,6 +93,12 @@ class YouDotCom {
|
|
|
134
93
|
value: "contents",
|
|
135
94
|
description: "Extract content from one or more URLs",
|
|
136
95
|
action: "Extract content from web pages"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "Research",
|
|
99
|
+
value: "research",
|
|
100
|
+
description: "Get a comprehensive, cited answer to a complex question",
|
|
101
|
+
action: "Research a complex question"
|
|
137
102
|
}
|
|
138
103
|
],
|
|
139
104
|
default: "search"
|
|
@@ -410,6 +375,57 @@ class YouDotCom {
|
|
|
410
375
|
description: "Timeout in seconds for page crawling (1-60)"
|
|
411
376
|
}
|
|
412
377
|
]
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
displayName: "Input",
|
|
381
|
+
name: "input",
|
|
382
|
+
type: "string",
|
|
383
|
+
required: true,
|
|
384
|
+
typeOptions: {
|
|
385
|
+
rows: 4
|
|
386
|
+
},
|
|
387
|
+
displayOptions: {
|
|
388
|
+
show: {
|
|
389
|
+
operation: ["research"]
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
default: "",
|
|
393
|
+
placeholder: "e.g., Which global cities improved air quality the most over the past 10 years?",
|
|
394
|
+
description: "The research question or complex query requiring in-depth investigation"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
displayName: "Research Effort",
|
|
398
|
+
name: "researchEffort",
|
|
399
|
+
type: "options",
|
|
400
|
+
displayOptions: {
|
|
401
|
+
show: {
|
|
402
|
+
operation: ["research"]
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
default: "standard",
|
|
406
|
+
description: "Controls the depth and time spent on research",
|
|
407
|
+
options: [
|
|
408
|
+
{
|
|
409
|
+
name: "Lite",
|
|
410
|
+
value: "lite",
|
|
411
|
+
description: "Quick answers for straightforward questions"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: "Standard",
|
|
415
|
+
value: "standard",
|
|
416
|
+
description: "Balanced speed and depth for most questions"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: "Deep",
|
|
420
|
+
value: "deep",
|
|
421
|
+
description: "More time researching and cross-referencing sources"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
name: "Exhaustive",
|
|
425
|
+
value: "exhaustive",
|
|
426
|
+
description: "Most thorough option for complex research tasks"
|
|
427
|
+
}
|
|
428
|
+
]
|
|
413
429
|
}
|
|
414
430
|
]
|
|
415
431
|
};
|
|
@@ -431,31 +447,14 @@ class YouDotCom {
|
|
|
431
447
|
itemData: { item: i }
|
|
432
448
|
});
|
|
433
449
|
returnData.push(...executionData);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
${error.issues.map((e, i2) => ` ${i2 + 1}. ${e.path.join(".") || "root"}: ${e.message}`).join(`
|
|
439
|
-
`)}`;
|
|
440
|
-
const serializedIssues = error.issues.map((issue) => ({
|
|
441
|
-
path: issue.path.join("."),
|
|
442
|
-
message: issue.message,
|
|
443
|
-
code: issue.code
|
|
444
|
-
}));
|
|
445
|
-
if (this.continueOnFail()) {
|
|
446
|
-
returnData.push({
|
|
447
|
-
json: {
|
|
448
|
-
error: errorMessage,
|
|
449
|
-
validationErrors: serializedIssues
|
|
450
|
-
},
|
|
451
|
-
pairedItem: { item: i }
|
|
452
|
-
});
|
|
453
|
-
continue;
|
|
454
|
-
}
|
|
455
|
-
throw new import_n8n_workflow.NodeApiError(this.getNode(), { message: errorMessage, issues: serializedIssues }, {
|
|
456
|
-
itemIndex: i
|
|
450
|
+
} else if (operation === "research") {
|
|
451
|
+
const response = await YouDotCom.#executeResearch(this, i);
|
|
452
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response), {
|
|
453
|
+
itemData: { item: i }
|
|
457
454
|
});
|
|
455
|
+
returnData.push(...executionData);
|
|
458
456
|
}
|
|
457
|
+
} catch (error) {
|
|
459
458
|
if (this.continueOnFail()) {
|
|
460
459
|
returnData.push({
|
|
461
460
|
json: {
|
|
@@ -474,8 +473,7 @@ ${error.issues.map((e, i2) => ` ${i2 + 1}. ${e.path.join(".") || "root"}: ${e.m
|
|
|
474
473
|
}
|
|
475
474
|
static async#executeSearch(context, itemIndex) {
|
|
476
475
|
const query = context.getNodeParameter("query", itemIndex);
|
|
477
|
-
const
|
|
478
|
-
const options = SearchOptionsSchema.parse(rawOptions);
|
|
476
|
+
const options = context.getNodeParameter("searchOptions", itemIndex);
|
|
479
477
|
const qs = { query };
|
|
480
478
|
if (options.count)
|
|
481
479
|
qs.count = options.count;
|
|
@@ -502,20 +500,19 @@ ${error.issues.map((e, i2) => ` ${i2 + 1}. ${e.path.join(".") || "root"}: ${e.m
|
|
|
502
500
|
qs,
|
|
503
501
|
json: true
|
|
504
502
|
});
|
|
505
|
-
|
|
506
|
-
return response;
|
|
503
|
+
return rawResponse;
|
|
507
504
|
}
|
|
508
505
|
static async#executeContents(context, itemIndex) {
|
|
509
506
|
const urlsString = context.getNodeParameter("urls", itemIndex);
|
|
510
|
-
const
|
|
511
|
-
const options = ContentsOptionsSchema.parse(rawOptions);
|
|
507
|
+
const options = context.getNodeParameter("contentsOptions", itemIndex);
|
|
512
508
|
const urls = urlsString.split(",").map((url) => url.trim()).filter((url) => url.length > 0);
|
|
513
509
|
if (urls.length === 0) {
|
|
514
510
|
throw new import_n8n_workflow.NodeOperationError(context.getNode(), "At least one URL is required", { itemIndex });
|
|
515
511
|
}
|
|
516
512
|
const body = { urls };
|
|
517
|
-
|
|
518
|
-
|
|
513
|
+
const formats = options.formats;
|
|
514
|
+
if (formats && formats.length > 0) {
|
|
515
|
+
body.formats = formats;
|
|
519
516
|
}
|
|
520
517
|
if (options.crawl_timeout) {
|
|
521
518
|
body.crawl_timeout = options.crawl_timeout;
|
|
@@ -529,7 +526,24 @@ ${error.issues.map((e, i2) => ` ${i2 + 1}. ${e.path.join(".") || "root"}: ${e.m
|
|
|
529
526
|
body,
|
|
530
527
|
json: true
|
|
531
528
|
});
|
|
532
|
-
|
|
533
|
-
|
|
529
|
+
return rawResponse;
|
|
530
|
+
}
|
|
531
|
+
static async#executeResearch(context, itemIndex) {
|
|
532
|
+
const input = context.getNodeParameter("input", itemIndex);
|
|
533
|
+
const researchEffort = context.getNodeParameter("researchEffort", itemIndex);
|
|
534
|
+
const body = { input };
|
|
535
|
+
if (researchEffort) {
|
|
536
|
+
body.research_effort = researchEffort;
|
|
537
|
+
}
|
|
538
|
+
const rawResponse = await context.helpers.httpRequestWithAuthentication.call(context, "youDotComApi", {
|
|
539
|
+
method: "POST",
|
|
540
|
+
url: "https://api.you.com/v1/research",
|
|
541
|
+
headers: {
|
|
542
|
+
"User-Agent": USER_AGENT
|
|
543
|
+
},
|
|
544
|
+
body,
|
|
545
|
+
json: true
|
|
546
|
+
});
|
|
547
|
+
return rawResponse;
|
|
534
548
|
}
|
|
535
549
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"resources": {
|
|
7
7
|
"credentialDocumentation": [
|
|
8
8
|
{
|
|
9
|
-
"url": "https://docs.you.com/
|
|
9
|
+
"url": "https://docs.you.com/quickstart"
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"primaryDocumentation": [
|
|
@@ -14,11 +14,27 @@
|
|
|
14
14
|
"url": "https://docs.you.com/api-reference/search"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"url": "https://docs.you.com/api-reference/
|
|
17
|
+
"url": "https://docs.you.com/api-reference/contents"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"url": "https://docs.you.com/api-reference/research"
|
|
18
21
|
}
|
|
19
22
|
]
|
|
20
23
|
},
|
|
21
|
-
"alias": [
|
|
24
|
+
"alias": [
|
|
25
|
+
"search",
|
|
26
|
+
"web search",
|
|
27
|
+
"you",
|
|
28
|
+
"youdotcom",
|
|
29
|
+
"news",
|
|
30
|
+
"ai search",
|
|
31
|
+
"contents",
|
|
32
|
+
"extract",
|
|
33
|
+
"scrape",
|
|
34
|
+
"crawl",
|
|
35
|
+
"research",
|
|
36
|
+
"deep research"
|
|
37
|
+
],
|
|
22
38
|
"subcategories": {
|
|
23
39
|
"Utility": ["Data Transformation"]
|
|
24
40
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youdotcom-oss/n8n-nodes-youdotcom",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "n8n community node for You.com APIs - Search
|
|
3
|
+
"version": "0.2.7",
|
|
4
|
+
"description": "n8n community node for You.com APIs - Search, Contents extraction, and Research",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18"
|
|
@@ -58,8 +58,7 @@
|
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"n8n-workflow": "^2.6.0"
|
|
62
|
-
"zod": "^3.25.67"
|
|
61
|
+
"n8n-workflow": "^2.6.0"
|
|
63
62
|
},
|
|
64
63
|
"devDependencies": {
|
|
65
64
|
"@biomejs/biome": "^2.3.8",
|
|
@@ -67,7 +66,6 @@
|
|
|
67
66
|
"@types/bun": "^1.3.9",
|
|
68
67
|
"eslint": "9.32.0",
|
|
69
68
|
"n8n-workflow": "^2.6.0",
|
|
70
|
-
"typescript": "^5.9.3"
|
|
71
|
-
"zod": "^3.25.67"
|
|
69
|
+
"typescript": "^5.9.3"
|
|
72
70
|
}
|
|
73
71
|
}
|