n8n-nodes-agentsearch 0.7.1 → 0.7.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
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
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
4
|
|
|
5
5
|
- **Free Search**: up to 5 results per call, 25 searches per day per IP, **no credentials**.
|
|
6
|
-
- **Extract Page** (new in 0.3.0): read a page as clean markdown or text. $0.
|
|
7
|
-
- **Render Page** (new in 0.3.0): load a JavaScript-heavy page in a headless browser, then read it (markdown, text, HTML, links, optional screenshot). $0.
|
|
6
|
+
- **Extract Page** (new in 0.3.0): read a page as clean markdown or text. $0.002 per call (x402, USDC on Base).
|
|
7
|
+
- **Render Page** (new in 0.3.0): load a JavaScript-heavy page in a headless browser, then read it (markdown, text, HTML, links, optional screenshot). $0.005 per call.
|
|
8
8
|
- `usableAsTool`: all three work as tools for the n8n AI Agent node (search, then read the best page).
|
|
9
9
|
- No runtime dependencies.
|
|
10
10
|
|
|
@@ -30,13 +30,13 @@ Output (default):
|
|
|
30
30
|
|
|
31
31
|
If the daily free limit is reached (HTTP 429) the node fails with an explanation; enable *Continue On Fail* to keep the workflow running.
|
|
32
32
|
|
|
33
|
-
**Hit the 429?** Extract (full page text) and Render (JS pages) are in this node at $0.
|
|
33
|
+
**Hit the 429?** Extract (full page text) and Render (JS pages) are in this node at $0.002 / $0.005 per call: see below.
|
|
34
34
|
|
|
35
35
|
## Extract and Render (read full pages)
|
|
36
36
|
|
|
37
37
|
Search results are snippets. To read the page itself, set **Operation** to **Extract Page** (static pages, faster) or **Render Page** (JavaScript apps, or when Extract returns thin content) and give it a **URL**, e.g. `{{ $json.url }}` from a search result. On an AI Agent, add the node twice as tools: one Free Search, one Extract Page.
|
|
38
38
|
|
|
39
|
-
Extract and Render are paid per call over [x402](https://x402.org) in USDC on Base, straight to **AgentSearch's own x402 API** (`https://api.agentsearchhq.com`): **Extract $0.
|
|
39
|
+
Extract and Render are paid per call over [x402](https://x402.org) in USDC on Base, straight to **AgentSearch's own x402 API** (`https://api.agentsearchhq.com`): **Extract $0.002, Render $0.005**, charged only when a usable answer comes back. No account or API key:
|
|
40
40
|
|
|
41
41
|
1. Make a **new wallet used only for this** and send it a little USDC on Base (for example $1 = about 100-250 calls). No ETH needed; the facilitator pays gas.
|
|
42
42
|
2. In n8n, add an **AgentSearch Wallet API** credential with that wallet's private key. **Max Spend per Run** (default $1.00) caps what one run of the node can sign; each direct call is hard-capped at $0.020 (Pocket route $0.005).
|
|
@@ -46,15 +46,15 @@ The node only signs a payment in USDC on Base to AgentSearch's payee `0xC49B1578
|
|
|
46
46
|
|
|
47
47
|
**New in 0.7.0: News Search and Screenshot, plus search filters.**
|
|
48
48
|
|
|
49
|
-
- **News Search** ($0.
|
|
50
|
-
- **Screenshot** ($0.
|
|
49
|
+
- **News Search** ($0.005 per call, not charged when there are no results): recent news articles with headline, URL, snippet, source and publish date, 1-10 per call.
|
|
50
|
+
- **Screenshot** ($0.004 per call, failed captures not charged): capture a page in a real headless browser as PNG or JPEG. The image is written to a binary property (default `data`) so you can pass it to an AI vision node, Slack, email or storage; the JSON keeps the metadata (final URL, title, size) without the base64.
|
|
51
51
|
- **Filters** on News Search and Search and Read: Freshness (past day/week/month/year) or a Date From/To range, Country, Language, and Include/Exclude Domains (comma-separated, up to 5).
|
|
52
52
|
|
|
53
|
-
All three are direct x402 only (AgentSearch's own API on Base; not on Pocket, not on the free relay). Prices are unchanged elsewhere: Extract $0.
|
|
53
|
+
All three are direct x402 only (AgentSearch's own API on Base; not on Pocket, not on the free relay). Prices are unchanged elsewhere: Extract $0.002, Render $0.005, Search and Read $0.005.
|
|
54
54
|
|
|
55
|
-
**New in 0.6.0: Search and Read** — one paid operation that searches the live web and returns the top pages' text for **$0.
|
|
55
|
+
**New in 0.6.0: Search and Read** — one paid operation that searches the live web and returns the top pages' text for **$0.005** (charged only when at least one page returns text; default 3 results, max 5). That is less than a $0.003 search plus three $0.002 extracts ($0.009), and one payment instead of four. Direct x402 only (not on Pocket, not on the free relay). The direct per-call ceiling is now $0.020.
|
|
56
56
|
|
|
57
|
-
**Changed in 0.5.0: direct is the default Payment Route.** Credentials that don't pick a route now pay the direct prices (a little
|
|
57
|
+
**Changed in 0.5.0: direct is the default Payment Route.** Credentials that don't pick a route now pay the direct prices (search $0.003, render $0.005, extract $0.002, screenshot $0.004; extract is a little under Pocket's $0.005). **Pocket route (optional):** set **Payment Route** to **Pocket Portal** to pay $0.005 per call through the Pocket Network Agentic Portal instead (hard cap $0.005, portal payee only, full Render options).
|
|
58
58
|
|
|
59
59
|
Without a credential, Extract and Render try the AgentSearch free relay; if it has no free allowance for you, the node stops with setup instructions and nothing is paid. Free Search never uses the credential.
|
|
60
60
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgentSearchWalletApi = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Wallet used to pay per call for Extract ($0.
|
|
5
|
+
* Wallet used to pay per call for Extract ($0.002) and Render ($0.005) in USDC on Base over x402,
|
|
6
6
|
* by default to AgentSearch's own x402 API (Pocket portal route optional). Free Search never uses it.
|
|
7
7
|
*/
|
|
8
8
|
class AgentSearchWalletApi {
|
|
@@ -26,7 +26,7 @@ class AgentSearchWalletApi {
|
|
|
26
26
|
name: 'paymentRoute',
|
|
27
27
|
type: 'options',
|
|
28
28
|
options: [
|
|
29
|
-
{ name: 'AgentSearch Direct x402 (Extract $0.
|
|
29
|
+
{ name: 'AgentSearch Direct x402 (Extract $0.002, Render $0.005)', value: 'direct', description: "Pay AgentSearch's own x402 API on Base (api.agentsearchhq.com) (default)" },
|
|
30
30
|
{ name: 'Pocket Portal ($0.005 per Call)', value: 'pocket', description: 'Pay through the Pocket Network Agentic Portal instead' },
|
|
31
31
|
],
|
|
32
32
|
default: 'direct',
|
|
@@ -38,7 +38,7 @@ class AgentSearchWalletApi {
|
|
|
38
38
|
type: 'number',
|
|
39
39
|
typeOptions: { minValue: 0.005, numberPrecision: 3 },
|
|
40
40
|
default: 1,
|
|
41
|
-
description: 'Stop signing payments in one run of the node (one batch of items or one AI tool call) once this much USDC has been signed (default $1.00). Each call is capped at $0.005 on the Pocket route and $0.
|
|
41
|
+
description: 'Stop signing payments in one run of the node (one batch of items or one AI tool call) once this much USDC has been signed (default $1.00). Each call is capped at $0.005 on the Pocket route and $0.020 on the direct route.',
|
|
42
42
|
},
|
|
43
43
|
];
|
|
44
44
|
}
|
|
@@ -12,20 +12,20 @@ exports.PORTAL_URL = 'https://agent.pocket.network';
|
|
|
12
12
|
exports.CLIENT_TAG = 'n8n-nodes-agentsearch/0.7.0';
|
|
13
13
|
const DOCS = 'https://agentsearchhq.com/?utm_source=n8n-nodes-agentsearch&utm_medium=package';
|
|
14
14
|
const GUIDE = 'https://agentsearchhq.com/blog/n8n-ai-agent-read-web-pages?utm_source=n8n-nodes-agentsearch&utm_medium=package';
|
|
15
|
-
exports.LIMIT_MESSAGE = `Free AgentSearch limit reached (25 searches per day per IP; resets daily). For unlimited search plus extract (static pages) and render (JavaScript-heavy pages, or when extract returns thin content), use the paid API (AgentSearch's own x402 API on Base: Extract $0.
|
|
15
|
+
exports.LIMIT_MESSAGE = `Free AgentSearch limit reached (25 searches per day per IP; resets daily). For unlimited search plus extract (static pages) and render (JavaScript-heavy pages, or when extract returns thin content), use the paid API (AgentSearch's own x402 API on Base: Extract $0.002, Render $0.005 per call in USDC; Pocket route $0.005 optional). Docs: ${DOCS}`;
|
|
16
16
|
exports.MIN_QUERY_CHARS = 2;
|
|
17
17
|
exports.QUERY_TOO_SHORT_MESSAGE = 'Query must be at least 2 characters. Nothing was sent or charged.';
|
|
18
18
|
exports.PORTAL_SERVICES = {
|
|
19
19
|
extract: { serviceId: 'agentsearch-web-extract-v1', path: '/v1/extract' },
|
|
20
20
|
render: { serviceId: 'agentsearch-web-render-v1', path: '/v1/render' },
|
|
21
21
|
};
|
|
22
|
-
exports.WALLET_SETUP = 'Add an "AgentSearch Wallet API" credential to this node: the private key of a NEW wallet made only for this, funded with a little USDC on Base (for example $1 = about 100-250 calls; no ETH needed). Each call is paid over x402 to AgentSearch\'s own API on Base (Extract $0.
|
|
22
|
+
exports.WALLET_SETUP = 'Add an "AgentSearch Wallet API" credential to this node: the private key of a NEW wallet made only for this, funded with a little USDC on Base (for example $1 = about 100-250 calls; no ETH needed). Each call is paid over x402 to AgentSearch\'s own API on Base (Extract $0.002, Render $0.005; failed calls are not charged), or $0.005 through the Pocket Network Agentic Portal if you pick that Payment Route. Free Search stays free and needs no credential. Guide: ' +
|
|
23
23
|
GUIDE;
|
|
24
24
|
function paidOnlyMessage(op) {
|
|
25
|
-
return `${op === 'extract' ? 'Extract' : 'Render'} is a paid operation (${op === 'extract' ? '$0.
|
|
25
|
+
return `${op === 'extract' ? 'Extract' : 'Render'} is a paid operation (${op === 'extract' ? '$0.002' : '$0.005'} per call in USDC on Base via x402) and no wallet credential is set, so nothing was paid. ${exports.WALLET_SETUP}`;
|
|
26
26
|
}
|
|
27
27
|
function trialLimitMessage(op) {
|
|
28
|
-
return `Free ${op} allowance for today is used up. Continue at ${op === 'extract' ? '$0.
|
|
28
|
+
return `Free ${op} allowance for today is used up. Continue at ${op === 'extract' ? '$0.002' : '$0.005'} per call (x402, USDC on Base): ${exports.WALLET_SETUP}`;
|
|
29
29
|
}
|
|
30
30
|
const headerOf = (headers, name) => {
|
|
31
31
|
const h = (headers ?? {});
|
|
@@ -55,7 +55,7 @@ class AgentSearch {
|
|
|
55
55
|
group: ['transform'],
|
|
56
56
|
version: 1,
|
|
57
57
|
subtitle: '={{$parameter["operation"]}}',
|
|
58
|
-
description: 'Free live web search for AI agents, plus News Search ($0.
|
|
58
|
+
description: 'Free live web search for AI agents, plus News Search ($0.003), page Extract ($0.002), JavaScript Render ($0.005), Screenshot ($0.004), and Search + Read ($0.005) per call via x402',
|
|
59
59
|
defaults: { name: 'AgentSearch' },
|
|
60
60
|
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
61
61
|
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
@@ -80,31 +80,31 @@ class AgentSearch {
|
|
|
80
80
|
name: 'Extract Page',
|
|
81
81
|
value: 'extract',
|
|
82
82
|
action: 'Extract a page as markdown',
|
|
83
|
-
description: 'Read a page as clean markdown or text ($0.
|
|
83
|
+
description: 'Read a page as clean markdown or text ($0.002 per call, wallet credential)',
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
name: 'Render Page',
|
|
87
87
|
value: 'render',
|
|
88
88
|
action: 'Render a dynamic page',
|
|
89
|
-
description: 'Load a JavaScript-heavy page in a headless browser and read it ($0.
|
|
89
|
+
description: 'Load a JavaScript-heavy page in a headless browser and read it ($0.005 per call, wallet credential)',
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
name: 'News Search',
|
|
93
93
|
value: 'news',
|
|
94
94
|
action: 'Search recent news',
|
|
95
|
-
description: 'Recent news articles with date, source and snippet ($0.
|
|
95
|
+
description: 'Recent news articles with date, source and snippet ($0.003 per call, not charged when no results; wallet credential; direct x402 only)',
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
name: 'Screenshot',
|
|
99
99
|
value: 'screenshot',
|
|
100
100
|
action: 'Take a screenshot of a page',
|
|
101
|
-
description: 'Capture a page in a real headless browser as a PNG or JPEG binary ($0.
|
|
101
|
+
description: 'Capture a page in a real headless browser as a PNG or JPEG binary ($0.004 per call, failed captures not charged; wallet credential; direct x402 only)',
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
name: 'Search and Read',
|
|
105
105
|
value: 'searchAndRead',
|
|
106
106
|
action: 'Search and read top pages',
|
|
107
|
-
description: 'Search the live web and return the top pages\' text in one paid call ($0.
|
|
107
|
+
description: 'Search the live web and return the top pages\' text in one paid call ($0.005, charged only when at least one page returns text; wallet credential; direct x402 only)',
|
|
108
108
|
},
|
|
109
109
|
],
|
|
110
110
|
default: 'freeSearch',
|
|
@@ -211,7 +211,7 @@ class AgentSearch {
|
|
|
211
211
|
name: 'renderFallback',
|
|
212
212
|
type: 'boolean',
|
|
213
213
|
default: false,
|
|
214
|
-
description: 'Whether to render at most one thin page in the same $0.
|
|
214
|
+
description: 'Whether to render at most one thin page in the same $0.005 call if extract returns little text',
|
|
215
215
|
displayOptions: { show: { operation: ['searchAndRead'] } },
|
|
216
216
|
},
|
|
217
217
|
{
|
|
@@ -351,7 +351,7 @@ class AgentSearch {
|
|
|
351
351
|
return { status: 'Error', message: 'Max Spend per Run must be a positive number of USD.' };
|
|
352
352
|
return {
|
|
353
353
|
status: 'OK',
|
|
354
|
-
message: `Valid key for wallet ${address}. Fund it with USDC on Base (no ETH needed); each Extract ($0.
|
|
354
|
+
message: `Valid key for wallet ${address}. Fund it with USDC on Base (no ETH needed); each Extract ($0.002) or Render ($0.005) call pays AgentSearch's x402 API ($0.005 on the Pocket route).`,
|
|
355
355
|
};
|
|
356
356
|
},
|
|
357
357
|
},
|
|
@@ -587,9 +587,9 @@ async function readPage(op, i, signedBefore) {
|
|
|
587
587
|
return { json: { ...data, payment, portal: direct ? null : envelope.portal ?? null }, signedAtomic };
|
|
588
588
|
}
|
|
589
589
|
exports.DIRECT_OPS = {
|
|
590
|
-
searchAndRead: { path: 'search_and_read', label: 'Search and Read', price: '$0.
|
|
591
|
-
news: { path: 'news', label: 'News Search', price: '$0.
|
|
592
|
-
screenshot: { path: 'screenshot', label: 'Screenshot', price: '$0.
|
|
590
|
+
searchAndRead: { path: 'search_and_read', label: 'Search and Read', price: '$0.005', when: 'charged only when at least one page returns text' },
|
|
591
|
+
news: { path: 'news', label: 'News Search', price: '$0.003', when: 'not charged when there are no results' },
|
|
592
|
+
screenshot: { path: 'screenshot', label: 'Screenshot', price: '$0.004', when: 'failed captures are not charged' },
|
|
593
593
|
};
|
|
594
594
|
const domainList = (v) => String(v ?? '')
|
|
595
595
|
.split(',')
|
|
@@ -261,7 +261,7 @@ exports.MAX_PER_CALL_ATOMIC = 5000n;
|
|
|
261
261
|
/** AgentSearch's own x402 API on Base (opt-in "Payment Route: Direct"). */
|
|
262
262
|
exports.DIRECT_URL = 'https://api.agentsearchhq.com';
|
|
263
263
|
exports.DIRECT_PAYEE = '0xC49B157887e51c21CB655f39CF65D6a4c2a4C337';
|
|
264
|
-
/** $0.020 hard ceiling per direct call (extract $0.
|
|
264
|
+
/** $0.020 hard ceiling per direct call (extract $0.002, render $0.005, search_and_read $0.005). */
|
|
265
265
|
exports.DIRECT_MAX_PER_CALL_ATOMIC = 20000n;
|
|
266
266
|
const eqAddr = (a, b) => typeof a === 'string' && a.toLowerCase() === b.toLowerCase();
|
|
267
267
|
function atomicToUsd(a) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-agentsearch",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "AgentSearch",
|
|
6
6
|
"email": "AgentSearchhq@gmail.com",
|
|
7
7
|
"url": "https://agentsearchhq.com"
|
|
8
8
|
},
|
|
9
|
-
"description": "n8n community node for AgentSearch: free live web search for AI agents (no credentials), plus News Search ($0.
|
|
9
|
+
"description": "n8n community node for AgentSearch: free live web search for AI agents (no credentials), plus News Search ($0.003), page Extract ($0.002), JavaScript Render ($0.005), Screenshot ($0.004) and Search and Read ($0.005) per call, paid in USDC on Base via x402 to AgentSearch's own API",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"n8n-community-node-package",
|
|
12
12
|
"n8n",
|