n8n-nodes-agentsearch 0.0.0-stage → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AgentSearch / Angel Mendez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,45 @@
1
- # Temporary Holding Version
1
+ # n8n-nodes-agentsearch
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ n8n community node for [AgentSearch](https://agentsearchhq.com/?utm_source=n8n-nodes-agentsearch&utm_medium=package): live web search for workflows and AI agents.
4
+
5
+ - **Free Search** operation: up to 5 results per call, 25 searches per day per user, **no credentials**.
6
+ - `usableAsTool`: works as a tool for the n8n AI Agent node.
7
+
8
+ ## Install
9
+
10
+ In n8n: **Settings → Community Nodes → Install** and enter `n8n-nodes-agentsearch`.
11
+
12
+ Self-hosted via CLI:
13
+
14
+ ```bash
15
+ cd ~/.n8n/nodes && npm install n8n-nodes-agentsearch
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ Add the **AgentSearch** node, set **Query** (expressions work, e.g. `{{ $json.question }}`) and **Max Results** (1-5). Turn on **Split Results Into Items** to get one item per result (`title`, `url`, `content`).
21
+
22
+ Output (default):
23
+
24
+ ```json
25
+ { "query": "...", "result_count": 5, "retrieved_at": "...", "results": [{ "title": "...", "url": "...", "content": "..." }] }
26
+ ```
27
+
28
+ If the daily free limit is reached (HTTP 429) the node fails with an explanation; enable *Continue On Fail* to keep the workflow running.
29
+
30
+ ## Workflow template (no install needed)
31
+
32
+ `templates/agentsearch-free-search.workflow.json` does the same with the built-in **HTTP Request** node. Import it via **Workflows → Import from File** (or paste the JSON onto the canvas).
33
+
34
+ ## Paid API
35
+
36
+ Unlimited search plus page extract and JS render are $0.005 per call in USDC on Base via x402. See https://agentsearchhq.com/agents.md?utm_source=n8n-nodes-agentsearch&utm_medium=package
37
+
38
+ ## Development
39
+
40
+ ```bash
41
+ npm install && npm test # mocked tests
42
+ AGENTSEARCH_LIVE=1 npm test # + one real free search
43
+ ```
44
+
45
+ MIT
@@ -0,0 +1,8 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare const FREE_RELAY_URL = "https://relay.agentsearchhq.com/v1/search";
3
+ export declare const CLIENT_TAG = "n8n-nodes-agentsearch/0.2.0";
4
+ export declare const LIMIT_MESSAGE = "Free AgentSearch limit reached (25 searches per day per user; resets daily). For unlimited search plus extract (static pages) and render (JavaScript-heavy pages, or when extract returns thin content), use the paid API ($0.005 per call in USDC on Base via x402). Docs: https://agentsearchhq.com/?utm_source=n8n-nodes-agentsearch&utm_medium=package";
5
+ export declare class AgentSearch implements INodeType {
6
+ description: INodeTypeDescription;
7
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
8
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentSearch = exports.LIMIT_MESSAGE = exports.CLIENT_TAG = exports.FREE_RELAY_URL = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ exports.FREE_RELAY_URL = 'https://relay.agentsearchhq.com/v1/search';
6
+ exports.CLIENT_TAG = 'n8n-nodes-agentsearch/0.2.0';
7
+ const DOCS = 'https://agentsearchhq.com/?utm_source=n8n-nodes-agentsearch&utm_medium=package';
8
+ exports.LIMIT_MESSAGE = `Free AgentSearch limit reached (25 searches per day per user; resets daily). For unlimited search plus extract (static pages) and render (JavaScript-heavy pages, or when extract returns thin content), use the paid API ($0.005 per call in USDC on Base via x402). Docs: ${DOCS}`;
9
+ class AgentSearch {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'AgentSearch',
13
+ name: 'agentSearch',
14
+ icon: 'file:agentsearch.svg',
15
+ group: ['transform'],
16
+ version: 1,
17
+ subtitle: '={{$parameter["operation"]}}',
18
+ description: 'Free live web search for AI agents (no credentials, 25 searches/day)',
19
+ defaults: { name: 'AgentSearch' },
20
+ inputs: ['main'],
21
+ outputs: ['main'],
22
+ usableAsTool: true,
23
+ credentials: [],
24
+ properties: [
25
+ {
26
+ displayName: 'Operation',
27
+ name: 'operation',
28
+ type: 'options',
29
+ noDataExpression: true,
30
+ options: [{ name: 'Free Search', value: 'freeSearch', action: 'Search the web for free', description: 'Up to 5 results, 25 searches per day, no key' }],
31
+ default: 'freeSearch',
32
+ },
33
+ { displayName: 'Query', name: 'query', type: 'string', default: '', required: true, placeholder: 'latest n8n release' },
34
+ { displayName: 'Max Results', name: 'maxResults', type: 'number', typeOptions: { minValue: 1, maxValue: 5 }, default: 5 },
35
+ {
36
+ displayName: 'Split Results Into Items',
37
+ name: 'split',
38
+ type: 'boolean',
39
+ default: false,
40
+ description: 'Whether to output one item per result instead of one item with a results array',
41
+ },
42
+ ],
43
+ };
44
+ }
45
+ async execute() {
46
+ var _a, _b, _c, _d;
47
+ const items = this.getInputData();
48
+ const out = [];
49
+ for (let i = 0; i < items.length; i++) {
50
+ try {
51
+ const query = this.getNodeParameter('query', i).trim();
52
+ if (!query)
53
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Query is empty', { itemIndex: i });
54
+ const maxResults = this.getNodeParameter('maxResults', i, 5);
55
+ const split = this.getNodeParameter('split', i, false);
56
+ let res;
57
+ try {
58
+ res = await this.helpers.httpRequest({
59
+ method: 'POST',
60
+ url: exports.FREE_RELAY_URL,
61
+ body: { query, max_results: maxResults },
62
+ headers: { 'X-Agent-Client': exports.CLIENT_TAG },
63
+ json: true,
64
+ timeout: 30000,
65
+ });
66
+ }
67
+ catch (e) {
68
+ const status = (_c = (_a = e === null || e === void 0 ? void 0 : e.httpCode) !== null && _a !== void 0 ? _a : (_b = e === null || e === void 0 ? void 0 : e.response) === null || _b === void 0 ? void 0 : _b.status) !== null && _c !== void 0 ? _c : e === null || e === void 0 ? void 0 : e.statusCode;
69
+ if (String(status) === '429')
70
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), exports.LIMIT_MESSAGE, { itemIndex: i });
71
+ throw e;
72
+ }
73
+ if (res && typeof res === 'object')
74
+ delete res.provider;
75
+ if (split) {
76
+ for (const r of (_d = res === null || res === void 0 ? void 0 : res.results) !== null && _d !== void 0 ? _d : [])
77
+ out.push({ json: { query, ...r }, pairedItem: { item: i } });
78
+ }
79
+ else {
80
+ out.push({ json: res, pairedItem: { item: i } });
81
+ }
82
+ }
83
+ catch (e) {
84
+ if (this.continueOnFail()) {
85
+ out.push({ json: { error: e.message }, pairedItem: { item: i } });
86
+ continue;
87
+ }
88
+ throw e;
89
+ }
90
+ }
91
+ return [out];
92
+ }
93
+ }
94
+ exports.AgentSearch = AgentSearch;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="12" fill="#111827"/><circle cx="28" cy="28" r="14" fill="none" stroke="#38bdf8" stroke-width="6"/><path d="M38 38l14 14" stroke="#38bdf8" stroke-width="7" stroke-linecap="round"/></svg>
package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = {};
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "n8n-nodes-agentsearch",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "n8n community node for AgentSearch: free live web search for AI agents and workflows (no credentials)",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "n8n",
8
+ "agentsearch",
9
+ "web-search",
10
+ "search",
11
+ "ai-agent"
12
+ ],
13
+ "license": "MIT",
14
+ "homepage": "https://agentsearchhq.com/?utm_source=n8n-nodes-agentsearch&utm_medium=package",
15
+ "main": "index.js",
16
+ "scripts": {
17
+ "build": "tsc && cp nodes/AgentSearch/*.svg dist/nodes/AgentSearch/",
18
+ "prepublishOnly": "npm run build",
19
+ "test": "npm run build && node --test test/*.test.mjs"
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "templates",
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "n8n": {
28
+ "n8nNodesApiVersion": 1,
29
+ "credentials": [],
30
+ "nodes": [
31
+ "dist/nodes/AgentSearch/AgentSearch.node.js"
32
+ ]
33
+ },
34
+ "engines": {
35
+ "node": ">=20"
36
+ },
37
+ "peerDependencies": {
38
+ "n8n-workflow": "*"
39
+ },
40
+ "devDependencies": {
41
+ "n8n-workflow": "^1.82.0",
42
+ "typescript": "^5.7.0",
43
+ "@types/node": "^22.10.0"
44
+ }
45
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "AgentSearch free web search (HTTP Request)",
3
+ "nodes": [
4
+ { "parameters": {}, "id": "a1b2c3d4-0000-4000-8000-000000000001", "name": "When clicking 'Test workflow'", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [0, 0] },
5
+ { "parameters": { "assignments": { "assignments": [ { "id": "q1", "name": "query", "value": "latest n8n release", "type": "string" } ] }, "options": {} }, "id": "a1b2c3d4-0000-4000-8000-000000000002", "name": "Set Query", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [220, 0] },
6
+ { "parameters": { "method": "POST", "url": "https://relay.agentsearchhq.com/v1/search", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ query: $json.query, max_results: 5 }) }}", "options": {} }, "id": "a1b2c3d4-0000-4000-8000-000000000003", "name": "AgentSearch (free)", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [440, 0], "notes": "Free: 25 searches/day per user, up to 5 results, no key. HTTP 429 = daily limit reached. Docs: https://agentsearchhq.com/agents.md?utm_source=n8n-nodes-agentsearch&utm_medium=package" },
7
+ { "parameters": { "fieldToSplitOut": "results", "options": {} }, "id": "a1b2c3d4-0000-4000-8000-000000000004", "name": "One Item per Result", "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [660, 0] }
8
+ ],
9
+ "connections": {
10
+ "When clicking 'Test workflow'": { "main": [[{ "node": "Set Query", "type": "main", "index": 0 }]] },
11
+ "Set Query": { "main": [[{ "node": "AgentSearch (free)", "type": "main", "index": 0 }]] },
12
+ "AgentSearch (free)": { "main": [[{ "node": "One Item per Result", "type": "main", "index": 0 }]] }
13
+ },
14
+ "settings": { "executionOrder": "v1" },
15
+ "pinData": {}
16
+ }