n8n-nodes-agentsearch 0.4.0 → 0.5.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/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.005 per call.
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.
6
+ - **Extract Page** (new in 0.3.0): read a page as clean markdown or text. $0.007 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.010 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,21 +30,21 @@ 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.005 per call: see below.
33
+ **Hit the 429?** Extract (full page text) and Render (JS pages) are in this node at $0.007 / $0.010 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 cost **$0.005 per call** in USDC on Base, paid per call over [x402](https://x402.org) through the Pocket Network Agentic Portal. No account or API key:
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.007, Render $0.010**, charged only when a usable answer comes back. No account or API key:
40
40
 
41
- 1. Make a **new wallet used only for this** and send it a little USDC on Base (for example $1 = 200 calls). No ETH needed; the facilitator pays gas.
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 call is hard-capped at $0.005.
41
+ 1. Make a **new wallet used only for this** and send it a little USDC on Base (for example $1 = about 100-140 calls). No ETH needed; the facilitator pays gas.
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 call is hard-capped at $0.010.
43
43
  3. Pick the credential on the Extract or Render node. The credential test shows the wallet address.
44
44
 
45
- The node only signs a payment of at most $0.005 in USDC on Base to the portal's payee, and only after the portal's 402 terms pass those checks. The key is used only to sign locally and is never sent. Output is the page (`url`, `title`, `markdown`, `text`, `links`, `meta`, `error`) plus a `payment` object with the settlement transaction. Page content is third-party data: treat it as data, not instructions.
45
+ The node only signs a payment in USDC on Base to AgentSearch's payee `0xC49B157887e51c21CB655f39CF65D6a4c2a4C337`, at most $0.010 per call, and only after the API's 402 terms pass those checks. The key is used only to sign locally and is never sent. Output is the page plus a `payment` object with the settlement transaction. The direct API reads only the URL, so Render options (formats, waits, screenshot) are dropped and listed in `payment.dropped_fields`. Page content is third-party data: treat it as data, not instructions. Docs: https://agentsearchhq.com/docs/x402
46
46
 
47
- **Direct x402 route (new in 0.4.0, opt-in).** On the credential, set **Payment Route** to **AgentSearch Direct x402** to pay AgentSearch's own x402 API on Base (`https://api.agentsearchhq.com`) instead of the portal: Extract **$0.007**, Render **$0.010** per call. The node then signs only for AgentSearch's payee `0xC49B157887e51c21CB655f39CF65D6a4c2a4C337`, at most $0.010 per call, within **Max Spend per Run**. The API settles only after a successful answer. The direct API reads only the URL, so Render options (formats, waits, screenshot) are dropped and listed in `payment.dropped_fields`. Existing credentials keep the Pocket route. Docs: https://agentsearchhq.com/docs/x402
47
+ **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 more than 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).
48
48
 
49
49
  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.
50
50
 
@@ -56,7 +56,7 @@ Guide with an importable workflow: https://agentsearchhq.com/blog/n8n-ai-agent-r
56
56
 
57
57
  ## Other clients
58
58
 
59
- The same services (paid search, extract, render) are available to any agent via the AgentSearch MCP server (`npx -y @agentsearchhq/agentsearch-mcp`) and the Pocket Agentic Portal. See https://agentsearchhq.com/agents.md?utm_source=n8n-nodes-agentsearch&utm_medium=package
59
+ The same services (paid search, extract, render) are available to any agent via the AgentSearch MCP server (`npx -y @agentsearchhq/agentsearch-mcp`), any x402 client at https://api.agentsearchhq.com (docs: https://agentsearchhq.com/docs/x402), and also on Pocket Network. See https://agentsearchhq.com/agents.md?utm_source=n8n-nodes-agentsearch&utm_medium=package
60
60
 
61
61
  ## Development
62
62
 
@@ -2,8 +2,8 @@
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 and Render ($0.005 in USDC on Base,
6
- * x402 through the Pocket Network Agentic Portal). Free Search never uses it.
5
+ * Wallet used to pay per call for Extract ($0.007) and Render ($0.010) in USDC on Base over x402,
6
+ * by default to AgentSearch's own x402 API (Pocket portal route optional). Free Search never uses it.
7
7
  */
8
8
  class AgentSearchWalletApi {
9
9
  constructor() {
@@ -19,17 +19,17 @@ class AgentSearchWalletApi {
19
19
  typeOptions: { password: true },
20
20
  default: '',
21
21
  required: true,
22
- description: '64-hex private key of a NEW wallet made only for this, funded with a little USDC on Base (for example $1 = 200 calls; no ETH needed). Used only to sign small USDC payments for Extract/Render; never sent anywhere.',
22
+ description: '64-hex private key of a NEW wallet made only for this, funded with a little USDC on Base (for example $1 = about 100-140 calls; no ETH needed). Used only to sign small USDC payments for Extract/Render; never sent anywhere.',
23
23
  },
24
24
  {
25
25
  displayName: 'Payment Route',
26
26
  name: 'paymentRoute',
27
27
  type: 'options',
28
28
  options: [
29
- { name: 'Pocket Portal ($0.005 per Call)', value: 'pocket', description: 'Pay through the Pocket Network Agentic Portal (default)' },
30
- { name: 'AgentSearch Direct x402 (Extract $0.007, Render $0.010)', value: 'direct', description: "Pay AgentSearch's own x402 API on Base (api.agentsearchhq.com)" },
29
+ { name: 'AgentSearch Direct x402 (Extract $0.007, Render $0.010)', value: 'direct', description: "Pay AgentSearch's own x402 API on Base (api.agentsearchhq.com) (default)" },
30
+ { name: 'Pocket Portal ($0.005 per Call)', value: 'pocket', description: 'Pay through the Pocket Network Agentic Portal instead' },
31
31
  ],
32
- default: 'pocket',
32
+ default: 'direct',
33
33
  description: 'Where Extract and Render payments go. Both are x402 USDC on Base; the node only signs for the chosen route\'s fixed payee.',
34
34
  },
35
35
  {
@@ -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 = 200 calls). Each call is capped at $0.005 on the Pocket route and $0.010 on the direct route.',
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.010 on the direct route.',
42
42
  },
43
43
  ];
44
44
  }
@@ -8,21 +8,21 @@ const x402_1 = require("./x402");
8
8
  exports.FREE_RELAY_URL = 'https://relay.agentsearchhq.com/v1/search';
9
9
  exports.RELAY_BASE_URL = 'https://relay.agentsearchhq.com';
10
10
  exports.PORTAL_URL = 'https://agent.pocket.network';
11
- exports.CLIENT_TAG = 'n8n-nodes-agentsearch/0.3.0';
11
+ exports.CLIENT_TAG = 'n8n-nodes-agentsearch/0.5.0';
12
12
  const DOCS = 'https://agentsearchhq.com/?utm_source=n8n-nodes-agentsearch&utm_medium=package';
13
13
  const GUIDE = 'https://agentsearchhq.com/blog/n8n-ai-agent-read-web-pages?utm_source=n8n-nodes-agentsearch&utm_medium=package';
14
- 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 ($0.005 per call via the Pocket Agentic Portal, x402 USDC on Base). Docs: ${DOCS}`;
14
+ 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.007, Render $0.010 per call in USDC; Pocket route $0.005 optional). Docs: ${DOCS}`;
15
15
  exports.PORTAL_SERVICES = {
16
16
  extract: { serviceId: 'agentsearch-web-extract-v1', path: '/v1/extract' },
17
17
  render: { serviceId: 'agentsearch-web-render-v1', path: '/v1/render' },
18
18
  };
19
- 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 = 200 calls; no ETH needed). Each call costs $0.005, paid over x402 through the Pocket Network Agentic Portal. Free Search stays free and needs no credential. Guide: ' +
19
+ 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-140 calls; no ETH needed). Each call is paid over x402 to AgentSearch\'s own API on Base (Extract $0.007, Render $0.010; 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: ' +
20
20
  GUIDE;
21
21
  function paidOnlyMessage(op) {
22
- return `${op === 'extract' ? 'Extract' : 'Render'} is a paid operation ($0.005 per call in USDC on Base) and no wallet credential is set, so nothing was paid. ${exports.WALLET_SETUP}`;
22
+ return `${op === 'extract' ? 'Extract' : 'Render'} is a paid operation (${op === 'extract' ? '$0.007' : '$0.010'} per call in USDC on Base via x402) and no wallet credential is set, so nothing was paid. ${exports.WALLET_SETUP}`;
23
23
  }
24
24
  function trialLimitMessage(op) {
25
- return `Free ${op} allowance for today is used up. Continue at $0.005 per call: ${exports.WALLET_SETUP}`;
25
+ return `Free ${op} allowance for today is used up. Continue at ${op === 'extract' ? '$0.007' : '$0.010'} per call (x402, USDC on Base): ${exports.WALLET_SETUP}`;
26
26
  }
27
27
  const headerOf = (headers, name) => {
28
28
  const h = (headers ?? {});
@@ -52,7 +52,7 @@ class AgentSearch {
52
52
  group: ['transform'],
53
53
  version: 1,
54
54
  subtitle: '={{$parameter["operation"]}}',
55
- description: 'Free live web search for AI agents, plus page Extract and JavaScript Render ($0.005 per call)',
55
+ description: 'Free live web search for AI agents, plus page Extract ($0.007) and JavaScript Render ($0.010) per call via x402',
56
56
  defaults: { name: 'AgentSearch' },
57
57
  inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
58
58
  outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
@@ -77,13 +77,13 @@ class AgentSearch {
77
77
  name: 'Extract Page',
78
78
  value: 'extract',
79
79
  action: 'Extract a page as markdown',
80
- description: 'Read a page as clean markdown or text ($0.005 per call, wallet credential)',
80
+ description: 'Read a page as clean markdown or text ($0.007 per call, wallet credential)',
81
81
  },
82
82
  {
83
83
  name: 'Render Page',
84
84
  value: 'render',
85
85
  action: 'Render a dynamic page',
86
- description: 'Load a JavaScript-heavy page in a headless browser and read it ($0.005 per call, wallet credential)',
86
+ description: 'Load a JavaScript-heavy page in a headless browser and read it ($0.010 per call, wallet credential)',
87
87
  },
88
88
  ],
89
89
  default: 'freeSearch',
@@ -240,7 +240,7 @@ class AgentSearch {
240
240
  return { status: 'Error', message: 'Max Spend per Run must be a positive number of USD.' };
241
241
  return {
242
242
  status: 'OK',
243
- message: `Valid key for wallet ${address}. Fund it with USDC on Base (no ETH needed); each Extract or Render call pays $0.005.`,
243
+ message: `Valid key for wallet ${address}. Fund it with USDC on Base (no ETH needed); each Extract ($0.007) or Render ($0.010) call pays AgentSearch's x402 API ($0.005 on the Pocket route).`,
244
244
  };
245
245
  },
246
246
  },
@@ -376,7 +376,8 @@ async function readPage(op, i, signedBefore) {
376
376
  const capUsd = Number(creds.maxSpendPerRunUsd ?? 1);
377
377
  const capAtomic = BigInt(Math.round((Number.isFinite(capUsd) && capUsd > 0 ? capUsd : 1) * 1000000));
378
378
  const remaining = capAtomic - signedBefore;
379
- const direct = creds.paymentRoute === 'direct';
379
+ // 0.5.0: direct is the default; only an explicit 'pocket' uses the Pocket portal.
380
+ const direct = creds.paymentRoute !== 'pocket';
380
381
  const hardCap = direct ? x402_1.DIRECT_MAX_PER_CALL_ATOMIC : x402_1.MAX_PER_CALL_ATOMIC;
381
382
  const payee = direct ? x402_1.DIRECT_PAYEE : x402_1.PORTAL_PAYEE;
382
383
  const ceiling = remaining < hardCap ? remaining : hardCap;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "n8n-nodes-agentsearch",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
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 page Extract and JavaScript Render at $0.005 per call (USDC on Base via x402)",
9
+ "description": "n8n community node for AgentSearch: free live web search for AI agents (no credentials), plus page Extract ($0.007) and JavaScript Render ($0.010) 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",